/* Three columns side by side from 1000px up.

   The base stylesheet stacks the detail panel UNDER the list below 1281px.
   Inside a fixed-height shell that is fatal: the two rows split the height and
   the center column gets half a screen. So the three-column layout has to hold
   at every width the shell is active, and the base stacking is undone here.

   The rail is only names, so it can be tight. The list keeps a real width -- it
   was never the column with space to spare. Everything else goes to detail. */
/* No rail any more: positions are a tab strip above. Two columns. The base
   stylesheet's three-column and stacking rules are overridden at every width. */
body.fixed-app .shell { grid-template-columns: 1fr; }

@media (min-width: 1000px) {
  body.fixed-app .shell {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);   /* list slightly wider than detail */
  }

  body.fixed-app .detail {
    grid-column: auto;        /* base rule set 1 / -1 at <=1280px */
  }

  /* At 1281px+ the detail fits its four sections side by side -- state,
     subtasks, issue and notes -- so the whole check is readable without
     scrolling the panel. */
  body.fixed-app .detail .dcols {
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  }
}

/* ---------------------------------------------------------------------------
   Board as a fixed app shell.

   The page itself does not scroll. Each of the three columns scrolls on its
   own, and only when its content actually overflows -- `auto`, never `scroll`,
   so no column shows a dead scrollbar it has no use for.

   Within the middle column the desk header and claim bar stay put; only the
   task list moves. Those are the things you act on, so they should not slide
   away while you read down the list.

   Scoped to `body.fixed-app` (the board). Every other page keeps ordinary
   document scrolling, which is what a long admin table wants.
   --------------------------------------------------------------------------- */

html { height: 100%; }

/* ---------------------------------------------------------------------------
   Width.

   One cap, 1920px, centred, applied to the header, the tabs and the content
   alike -- so the logo and the tab row start on exactly the same left edge as
   the positions rail beneath them, and the menu does not shift when you move
   between the board and the admin pages.

   The previous 1500px cap left a wide monitor half unused; going fully edge to
   edge stretched the header instead. This is the middle.
   --------------------------------------------------------------------------- */
.top > .top-in,
.top > .tabs,
main.wrap {
  max-width: 1920px;
  margin-inline: auto;
}

/* Base for the middle column at every width. Declared here rather than inline on
   the element, because an inline display would outrank the flex switch below. */
.mid {
  min-width: 0;
  display: grid;
  gap: 12px;
  align-content: start;
}

@media (min-width: 1000px) {
  body.fixed-app {
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  /* In a fixed shell the header is simply the first flex row; sticky would
     add an offset it no longer needs. */
  body.fixed-app > .top {
    position: static;
    flex: 0 0 auto;
  }

  body.fixed-app > main.wrap {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    /* THE bug behind every "board is too small":
       .wrap carries `margin-inline: auto` for centring. On a normal block that
       means "full width up to the cap, centred". But body.fixed-app makes .wrap
       a FLEX ITEM, and auto cross-axis margins on a flex item mean
       "shrink to content, then centre" -- so the whole board collapsed to the
       grid's intrinsic ~810px. An explicit width restores block semantics:
       fill the container, cap at 1920px, centre the remainder. */
    width: 100%;
  }

  body.fixed-app .shell {
    width: 100%;
  }

  body.fixed-app .shell {
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;     /* columns fill the height instead of hugging content */
  }

  /* min-height:0 is what actually lets a flex/grid child scroll rather than
     stretching its parent. Without it, nothing below overflows correctly. */
  body.fixed-app .shell > * {
    min-height: 0;
  }

  /* left rail: scrolls only when there are more desks than fit */
  body.fixed-app .shell > .panel {
    overflow-y: auto;
  }

  /* middle column: fixed head, scrolling list */
  body.fixed-app .mid {
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 12px;
  }

  body.fixed-app .mid > .panel {
    flex: 0 0 auto;           /* desk name + claim bar stay at the top */
  }

  body.fixed-app .mid > .flow {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 3px;       /* keeps a scrollbar off the band borders */
  }

  /* detail: the tallest column in practice, so it earns its own scroll */
  body.fixed-app .detail {
    overflow-y: auto;
  }

  /* A column that fits shows no scrollbar at all; these only style the ones
     that do appear, so they read as part of the panel rather than the OS. */
  body.fixed-app .shell > .panel,
  body.fixed-app .mid > .flow,
  body.fixed-app .detail {
    scrollbar-width: thin;
    scrollbar-color: var(--line-2) transparent;
  }

  body.fixed-app ::-webkit-scrollbar { width: 9px; height: 9px; }
  body.fixed-app ::-webkit-scrollbar-track { background: transparent; }
  body.fixed-app ::-webkit-scrollbar-thumb {
    background: var(--line-2);
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: content-box;
  }
  body.fixed-app ::-webkit-scrollbar-thumb:hover { background-color: var(--ink-3); background-clip: content-box; }
}

/* Below 1000px the columns stack, and a one-screen shell would split the height
   between the rows and trap the list in a sliver. Ordinary page scrolling is
   correct there, so the shell is simply off. */


/* ---------------------------------------------------------------------------
   Who ticked a subtask.

   Shown inline on the row rather than in a separate log: the useful question is
   almost always "who did this one", asked while looking at the row itself.
   --------------------------------------------------------------------------- */
.sub { gap: 9px; }
.sub > span:first-of-type { flex: 1 1 auto; min-width: 0; }
/* Everything on a step row sits on its first line. Centred, the checkbox
   jumped down whenever the row grew: a title wrapping onto two lines, or the
   "done by" line appearing after a tick. */
.sub { align-items: flex-start; }
.sub > span:first-of-type { line-height: 18px; }          /* the checkbox's height: first line and box align */
.sub .ticketmini, .sub .by { min-height: 18px; align-self: flex-start; }
.sub .ticketmini input { line-height: 12px; }

.sub .by {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--ink-3);
  white-space: nowrap;
}

.sub .by .av-s { width: 15px; height: 15px; font-size: 8px; }
.sub .by time { font-variant-numeric: tabular-nums; }

/* An open subtask renders no attribution element at all -- there is nothing to
   attribute yet, and a hidden placeholder is a string waiting to leak. */
@media (max-width: 560px) {
  .sub { flex-wrap: wrap; }
  .sub .by { width: 100%; padding-left: 27px; }
}


/* ---------------------------------------------------------------------------
   Position tabs.

   The two desks used to sit in a 170px rail that was mostly empty. As tabs
   they take one short row and the columns beneath get the full width. Each
   tab still carries what the rail showed: who has claimed it, and the late or
   open count -- so switching desks needs no extra look.
   --------------------------------------------------------------------------- */
.desktabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

body.fixed-app > main.wrap > .desktabs { flex: 0 0 auto; }

.desktab {
  display: grid;
  gap: 5px;
  min-width: 220px;
  padding: 9px 13px 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-width: 3px;
  border-radius: var(--r);
  color: var(--ink);
  text-decoration: none;
}

.desktab:hover { border-color: var(--line-2); }

.desktab[aria-current="page"] {
  border-bottom-color: var(--brand);
  background: var(--brand-wash);
}

.dt-name {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -.01em;
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.dt-short {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: .06em;
}

.desktab[aria-current="page"] .dt-short { color: var(--brand-2); }

.dt-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.desktab .stack { margin-top: 0; }
.desktab .stack .av-s { box-shadow: 0 0 0 1.5px var(--surface); }
.desktab[aria-current="page"] .stack .av-s { box-shadow: 0 0 0 1.5px var(--brand-wash); }

@media (max-width: 560px) {
  .desktab { min-width: 0; flex: 1 1 100%; }
}


/* Delegate button sits under the state facts, full width of its section. */
.detail .dsec form.delegate { display: block; margin-top: 8px; }
.detail .dsec form.delegate .btn { width: 100%; text-align: left; }

/* ---------------------------------------------------------------------------
   Flow canvas — the drag-and-drop if/else builder, and the read-only viewer
   on a check. Boxes are HTML (draggable, editable); connectors are SVG.
   --------------------------------------------------------------------------- */
.flow-toolbar { display: flex; gap: 8px; align-items: center; padding: 10px 13px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.flow-save { display: flex; gap: 12px; align-items: center; padding: 11px 13px; border-top: 1px solid var(--line); flex-wrap: wrap; }

.flowcanvas {
  position: relative; overflow: auto; min-height: 520px;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--surface-2);
  background-blend-mode: normal;
  touch-action: none;
}
.flowcanvas.flow-view { min-height: 240px; margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; }
.flow-edges { position: absolute; left: 0; top: 0; pointer-events: none; }
.flow-edges path { pointer-events: stroke; }

.flow-node {
  position: absolute; width: 224px; background: var(--surface); border: 1.5px solid var(--line-2);
  border-radius: 9px; box-shadow: var(--shadow); user-select: none; display: grid;
}
.flow-question { border-color: color-mix(in srgb, var(--next) 70%, var(--ink)); }
.flow-node.is-start { border-color: var(--brand); }
.flow-node.is-done { border-color: var(--done); background: var(--done-wash); }
.flow-node.is-current { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 35%, transparent), var(--shadow); border-color: var(--brand); }
.flow-node.is-target { outline: 2px dashed var(--brand); outline-offset: 3px; }

.flow-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--line); cursor: grab; border-radius: 8px 8px 0 0; background: var(--surface-2); }
.is-editor .flow-head:active { cursor: grabbing; }
.flow-type { font-size: 9.5px; font-weight: 800; letter-spacing: .12em; color: var(--ink-3); }
.flow-question .flow-type { color: color-mix(in srgb, var(--next) 65%, var(--ink)); }
.flow-startbadge { font-size: 9px; font-weight: 800; letter-spacing: .1em; color: var(--brand-2); background: var(--brand-wash); border-radius: 4px; padding: 1px 5px; }
.flow-tools { margin-left: auto; display: flex; gap: 2px; }
.flow-tools button { border: 0; background: none; color: var(--ink-3); font-size: 13px; line-height: 1; padding: 2px 5px; border-radius: 4px; cursor: pointer; }
.flow-tools button:hover { background: var(--raise); color: var(--ink); }

.flow-title { padding: 8px 9px; font-size: 12.5px; line-height: 1.35; }
textarea.flow-title { width: 100%; border: 0; background: transparent; resize: none; font: inherit; font-size: 12.5px; color: var(--ink); }
textarea.flow-title:focus { outline: none; background: var(--brand-wash); }
.flow-flag { display: flex; align-items: center; gap: 5px; padding: 0 9px 7px; font-size: 10.5px; color: var(--ink-3); }
.flow-answered { padding: 0 9px 7px; font-size: 10.5px; font-weight: 700; color: var(--brand-2); }

.flow-ports { display: flex; gap: 6px; padding: 0 8px 8px; }
.flow-port {
  flex: 1; font-size: 10px; font-weight: 700; letter-spacing: .06em; padding: 3px 0; border-radius: 5px;
  border: 1px dashed var(--line-2); background: var(--surface-2); color: var(--ink-3); cursor: crosshair;
}
.flow-port-yes { border-color: var(--done); color: var(--done); }
.flow-port-no { border-color: var(--late); color: var(--late); }
.flow-port:disabled { cursor: default; opacity: .8; }
.is-editor .flow-port:hover { background: var(--brand-wash); }

.edge { fill: none; stroke: var(--ink-3); stroke-width: 2; }
.edge-yes { stroke: var(--done); } .edge-no { stroke: var(--late); }
.edge-hot { stroke: var(--brand); stroke-width: 3; }
.edge-dim { stroke: var(--line-2); stroke-dasharray: 4 4; }
.edge-temp { stroke: var(--brand); stroke-dasharray: 6 4; }
.arrow { fill: var(--ink-3); } .arrow-yes { fill: var(--done); } .arrow-no { fill: var(--late); }
.arrow-hot { fill: var(--brand); } .arrow-dim { fill: var(--line-2); }

/* runtime: the walked path in the detail panel */
.sub.is-current { background: var(--brand-wash); }
.flow-q { margin: 6px 0; padding: 8px 9px; border: 1px solid var(--line); border-left: 3px solid color-mix(in srgb, var(--next) 70%, var(--ink)); border-radius: 7px; background: var(--surface-2); }
.flow-q.is-current { border-color: var(--brand); border-left-color: var(--brand); background: var(--brand-wash); }
.flow-q-title { font-size: 12.5px; font-weight: 600; display: flex; gap: 7px; align-items: baseline; }
.flow-q-buttons { display: flex; gap: 8px; margin-top: 8px; }
.flow-q-answer { display: flex; gap: 9px; align-items: center; margin-top: 6px; }
.dsec-flow { grid-column: 1 / -1; }

/* tickets, cancel, reschedule */
.ticketrow { display: flex; gap: 6px; }
.ticketrow input { flex: 1; min-width: 0; }
.ticketmini { display: inline-flex; flex: 0 0 auto; }
.ticketmini input { width: 92px; padding: 2px 6px; font-size: 11px; border: 1px dashed var(--line-2); border-radius: 5px; background: transparent; }
.ticketmini input:focus { border-style: solid; background: var(--surface); }
.ticketmini input:placeholder-shown { opacity: .55; }
.cancelled-box { margin-top: 9px; padding: 8px 10px; border-radius: 7px; background: var(--late-wash); color: var(--late); font-size: 12.5px; }
.cancelled-box div { color: var(--ink); margin-top: 3px; }
details.delegate > summary { list-style: none; cursor: pointer; }
details.delegate > summary::-webkit-details-marker { display: none; }
.band[data-k="cancelled"] { border-left: 3px solid var(--ink-3); }
.band[data-k="cancelled"] .bhead h3 { color: var(--ink-3); }
.trow2[data-s="cancelled"] .when { color: var(--ink-3); text-decoration: line-through; }

/* ---------------------------------------------------------------------------
   Audit page. Stat tiles for the headline (the figures are the point), tables
   with inline two-segment meters for per-person and per-desk comparison.
   On-time/late is green/red -- a colour-vision problem -- so every meter has
   its numbers beside it and the segments always sit in the same order.
   --------------------------------------------------------------------------- */
.audit-filter { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px 9px; display: grid; gap: 2px; border-top: 3px solid var(--line-2); }
.kpi[data-tone="good"] { border-top-color: var(--done); }
.kpi[data-tone="warn"] { border-top-color: var(--next); }
.kpi[data-tone="bad"]  { border-top-color: var(--late); }
.kpi .k { font-size: 9.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.kpi b { font-size: 24px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 11px; color: var(--ink-2); }
.tbl.audit th.num, .tbl.audit td.num { text-align: right; white-space: nowrap; }
.tbl.audit td { padding-top: 7px; padding-bottom: 7px; }
.meter2 { display: inline-flex; width: 120px; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line); vertical-align: middle; gap: 2px; }
.meter2 i { display: block; height: 100%; }
.meter2 i.ok { background: var(--done); }
.meter2 i.late { background: var(--late); }
.meter2-lab { font-size: 11px; color: var(--ink-2); margin-left: 8px; vertical-align: middle; }
.meter2-lab em { font-style: normal; color: var(--ink-3); }

/* task creator */
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.fgrid .fld input, .fgrid .fld select, .fgrid .fld textarea { width: 100%; }

/* tags */
.tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.tagchip { font-size: 9.5px; font-weight: 700; letter-spacing: .05em; padding: 1px 6px; border-radius: 999px;
  background: var(--raise); color: var(--ink-2); border: 1px solid var(--line); }
.tagchip.on { background: var(--brand-wash); color: var(--brand-2); border-color: var(--brand); }
a.tagchip { text-decoration: none; }

/* the check form: numbered sections, segmented steps switch, preview box */
.dsec { position: relative; }
.stepno { position: absolute; left: 13px; top: 11px; width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.dsec > .stepno + .dlab { margin-left: 28px; font-size: 11px; color: var(--ink); }
.segmented { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg { padding: 6px 13px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--ink-2); background: var(--surface-2); }
.seg + .seg { border-left: 1px solid var(--line-2); }
.seg[aria-checked="true"] { background: var(--brand); color: #fff; }
.prevbox { margin-top: 10px; }
[hidden] { display: none !important; }

/* flow trail (compact, in the detail panel) */
.trail { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin-top: 4px; }
.trail-node { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink-2); }
.trail-node.question { border-style: dashed; }
.trail-node.is-done { border-color: var(--done); background: var(--done-wash); color: var(--done); }
.trail-node.is-current { border-color: var(--brand); background: var(--brand-wash); color: var(--brand-2); font-weight: 700; }
.trail-node b { margin-left: 5px; }
.trail-arrow { color: var(--ink-3); font-size: 11px; }

/* the popup */
.flowdialog { border: 0; border-radius: 14px; padding: 0; width: min(560px, 94vw); background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px -20px rgba(0,0,0,.45); }
.flowdialog::backdrop { background: rgba(23,19,31,.45); backdrop-filter: blur(2px); }
.fd-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.fd-title { padding: 12px 16px 0; font-size: 13px; color: var(--ink-2); }
.fd-trail { display: flex; gap: 6px; padding: 10px 16px 0; flex-wrap: wrap; }
.fd-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.fd-dot.is-done { background: var(--done); }
.fd-dot.is-current { background: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent); }
.fd-node { margin: 12px 16px 16px; padding: 16px; border-radius: 10px; border: 1.5px solid var(--line-2); background: var(--surface-2); }
.fd-question { border-color: color-mix(in srgb, var(--next) 70%, var(--ink)); }
.fd-step { border-color: var(--brand); }
.fd-q { font-size: 18px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; margin: 6px 0 12px; }
.fd-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.fd-big { padding: 11px 22px; font-size: 14px; }
.fd-ticket { margin-bottom: 10px; }

/* one-off popup */
.flowdialog.oneoff { width: min(640px, 94vw); }
.fd-body { padding: 14px 16px 18px; }

/* ---------------------------------------------------------------------------
   Check detail for newcomers: what it is → do it → can't do it now? → the
   rest folded away. One primary button at a time; nothing asks for input
   until you open the thing that needs it.
   --------------------------------------------------------------------------- */
.dmeta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 6px; font-size: 12.5px; }
.dmeta-sep { color: var(--ink-3); }
.dmeta-due { font-weight: 700; font-variant-numeric: tabular-nums; }
.dmeta-due.late, .dmeta-due.esc { color: var(--late); }
.dmeta-due.now, .dmeta-due.hour { color: var(--brand-2); }
.dmeta-due.issue { color: var(--issue); }
.dmeta-due.done { color: var(--done); }
.dsec-do { background: var(--surface); }
.bigdone { width: 100%; padding: 13px; font-size: 15px; }
.donebox { background: var(--done-wash); color: var(--done); font-weight: 700; border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.actions { display: grid; gap: 7px; }
.actions .btn { width: 100%; text-align: left; }
.assignrow { display: flex; align-items: center; gap: 8px; }
.assignrow label { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.assignrow select { flex: 1; min-width: 0; }
details.quiet > summary { list-style: none; cursor: pointer; font-size: 12px; color: var(--ink-2); padding: 4px 0; }
details.quiet > summary::-webkit-details-marker { display: none; }
details.quiet > summary u { color: var(--brand); text-decoration: none; font-weight: 600; }
details.more { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 6px; }
details.more > summary { font-weight: 600; }
details.more > summary::before { content: '▸ '; color: var(--ink-3); }
details.more[open] > summary::before { content: '▾ '; }
.moregrid { display: grid; gap: 10px; margin-top: 8px; }
.morebox { display: grid; gap: 6px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.morebox .dlab { margin: 0; }

/* ---------------------------------------------------------------------------
   Playlist import + day view. The day view is a long list (up to ~975 events):
   one tight row per event, secondary events and commercial breaks folded away
   in native <details>, so it stays readable and needs no script to expand.
   --------------------------------------------------------------------------- */
.dropzone { display: grid; gap: 4px; place-items: center; text-align: center; padding: 26px 16px; border: 2px dashed var(--line-2);
  border-radius: 12px; background: var(--surface-2); cursor: pointer; color: var(--ink-2); font-size: 12.5px; }
.dropzone b { font-size: 15px; color: var(--ink); }
.dropzone.over { border-color: var(--brand); background: var(--brand-wash); }
.importlist { display: grid; gap: 8px; margin-top: 10px; }
.importcard { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: var(--surface); display: grid; gap: 5px; }
.importcard[data-status="refused"] { border-color: var(--late); background: var(--late-wash); }
.ic-head { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.ic-counts { font-size: 12px; }
.versions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.pl { overflow: hidden; }
.pl details > summary { list-style: none; cursor: pointer; }
.pl details > summary::-webkit-details-marker { display: none; }
.pl-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) 96px 70px minmax(0, 200px); gap: 10px; align-items: center;
  padding: 4px 12px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.pl-row:hover { background: var(--surface-2); }
.pl-t { color: var(--ink-2); font-size: 11.5px; }
.pl-title { min-width: 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pl-cat { font-size: 9px; font-weight: 800; letter-spacing: .08em; color: var(--ink-3); text-transform: uppercase; min-width: 62px; }
.pl-src, .pl-meta { font-size: 11px; color: var(--ink-3); }
.pl-meta { text-align: right; }
.pl-sec { display: flex; gap: 6px; justify-content: flex-end; align-items: center; font-size: 11px; }
.pl-ev.aired > summary { opacity: .6; }
.pl-ev[data-kind="hot"] > summary { background: color-mix(in srgb, var(--brand-wash) 50%, transparent); }
.pl-detail { background: var(--surface-2); border-bottom: 1px solid var(--line); padding: 4px 0 6px; }
.pl-facts { padding: 4px 12px 6px 98px; }
.pl-qc { padding: 2px 12px 4px 98px; color: var(--issue); font-size: 12px; font-weight: 600; }
.pl-sub { border-bottom: 0; padding-top: 2px; padding-bottom: 2px; font-size: 12px; }
.pl-sub .pl-title { padding-left: 14px; }
.pl-break > summary { background: var(--raise); }
.pl-break > summary .pl-cat { color: var(--ink-2); }
.plb { font-size: 9.5px; font-weight: 800; letter-spacing: .05em; padding: 1px 6px; border-radius: 4px; }
.plb.rec { background: var(--late-wash); color: var(--late); }
.plb.live { background: var(--next-wash); color: color-mix(in srgb, var(--next) 60%, var(--ink)); }
.plb.l2v { background: var(--brand-wash); color: var(--brand-2); }
.plb.qc { background: var(--issue-wash); color: var(--issue); }
.plb.ok { background: var(--done-wash); color: var(--done); }
.plb.det { background: color-mix(in srgb, var(--brand) 14%, var(--surface)); color: var(--brand-2); }
@media (max-width: 760px) {
  .pl-row { grid-template-columns: 64px minmax(0, 1fr); }
  .pl-src, .pl-meta, .pl-sec { display: none; }
  .pl-facts, .pl-qc { padding-left: 12px; }
}

/* one chip per check on a playlist row — each opens that check */
.chkchip { display: inline-flex; gap: 4px; align-items: center; font-size: 10.5px; font-weight: 600; padding: 1px 7px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.chkchip:hover { border-color: var(--brand); color: var(--brand-2); }
.chkchip.done { border-color: color-mix(in srgb, var(--done) 45%, var(--line)); color: var(--done); background: var(--done-wash); }
.chkchip.late, .chkchip.esc { border-color: var(--late); color: var(--late); background: var(--late-wash); }
.chkchip.issue { border-color: var(--issue); color: var(--issue); background: var(--issue-wash); }
.chkchip.hour { border-color: var(--brand); color: var(--brand-2); background: var(--brand-wash); }
.pl-sec { flex-wrap: wrap; }

.redate { gap: 8px; flex-wrap: wrap; background: var(--next-wash); }

/* ---------------------------------------------------------------------------
   Board: every band in the same compact row style, each band its own scroll
   area, issues last, done and cancelled folded shut. Bands are <details>, so
   any of them can be folded by hand.
   --------------------------------------------------------------------------- */
details.band > summary { list-style: none; cursor: pointer; }
details.band > summary::-webkit-details-marker { display: none; }
details.band > summary.bhead::before { content: '▾'; color: var(--ink-3); font-size: 10px; }
details.band:not([open]) > summary.bhead::before { content: '▸'; }
details.band:not([open]) > summary.bhead { border-bottom: 0; }
.bscroll { }   /* no per-group scroll: the whole list scrolls once */
.cr { display: grid; grid-template-columns: 42px 18px minmax(0, 1fr) auto auto; gap: 8px; align-items: center;
  padding: 3px 10px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 12.5px; line-height: 1.35; }
.cr:last-child { border-bottom: 0; }
.cr:hover { background: var(--surface-2); }
.cr[aria-current="true"] { background: var(--brand-wash); }
.cr .av-s { width: 16px; height: 16px; font-size: 7.5px; }
.cr-t { font-size: 11.5px; color: var(--ink-2); }
.cr-title { min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.cr[data-done="true"] .cr-title { color: var(--ink-3); text-decoration: line-through; }
.cr-steps { font-size: 10.5px; color: var(--ink-3); }
.cr-when { font-size: 10.5px; font-weight: 700; white-space: nowrap; text-align: right; min-width: 44px; }
.cr[data-s="late"] .cr-when, .cr[data-s="esc"] .cr-when { color: var(--late); }
.cr[data-s="hour"] .cr-when { color: var(--brand-2); }
.cr[data-s="issue"] .cr-when { color: var(--issue); }
.cr[data-s="done"] .cr-when { color: var(--done); }
.cr[data-s="cancelled"] .cr-when, .cr[data-s="out"] .cr-when { color: var(--ink-3); }
.cr.flash { animation: fl 1.1s ease-out 3; }


/* ---------------------------------------------------------------------------
   The list is ONE panel with ONE scroll. Groups are sections inside it, not
   separate boxes; each group header sticks to the top while its rows scroll
   past, so you always know which group you are in.
   --------------------------------------------------------------------------- */
.flow { gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.flow > details.band { border: 0; border-radius: 0; background: transparent; overflow: visible; }
.flow > details.band + details.band > summary.bhead { border-top: 1px solid var(--line-2); }
.flow > details.band > summary.bhead {
  position: sticky; top: 0; z-index: 2; background: var(--surface);
  border-left: 3px solid transparent; padding-left: 10px;
}
.flow > details.band[data-k="late"] > summary.bhead,
.flow > details.band[data-k="esc"] > summary.bhead { border-left-color: var(--late); }
.flow > details.band[data-k="hour"] > summary.bhead { border-left-color: var(--now); }
.flow > details.band[data-k="issue"] > summary.bhead { border-left-color: var(--issue); }
.flow > details.band[data-k="done"] > summary.bhead { border-left-color: var(--done); }
.flow > details.band[data-k="out"] > summary.bhead,
.flow > details.band[data-k="cancelled"] > summary.bhead { border-left-color: var(--line-2); }
.flow > details.band:first-child > summary.bhead { border-radius: var(--r) var(--r) 0 0; }

/* ---------- alerts: toasts + settings page ---------- */
.alertset { font-size: 12px; }
.nn-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.nn-toast { display: block; background: var(--surface); color: var(--ink); text-decoration: none; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 10px; box-shadow: var(--shadow); padding: 9px 12px; font-size: 12.5px; animation: nnin .2s ease-out; }
.nn-toast b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin-bottom: 2px; }
.nn-toast em { font-style: normal; color: var(--ink-3); }
.nn-toast[data-k="late"] { border-left-color: var(--late); }
.nn-toast[data-k="issue"] { border-left-color: var(--issue); }
.nn-toast[data-k="due"] { border-left-color: var(--next); }
@keyframes nnin { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.al-wrap { max-width: 980px; margin: 0 auto; }
.al-dev { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.al-dev .st { font-size: 12.5px; color: var(--ink-2); }
.al-dev .st b { color: var(--ink); }
.al-vol { display: flex; align-items: center; gap: 10px; }
.al-vol input { width: 180px; }
.al-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.al-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.al-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.al-table tr[data-off="true"] td:not(:first-child) { opacity: .45; }
.al-table .what b { display: block; font-weight: 600; }
.al-table .what small { color: var(--ink-3); font-size: 12px; }
.al-table select { max-width: 100%; }
.al-snd { display: flex; gap: 6px; align-items: center; }
.al-scope label { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; font-size: 13px; cursor: pointer; }
.al-note { font-size: 12px; color: var(--ink-3); margin: 8px 0 0; }
@media (max-width: 760px) {
  .al-table thead { display: none; }
  .al-table tr { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .al-table td { border: 0; padding: 0; }
  .al-table td:not(:first-child):not(.what) { grid-column: 2; }
}

/* ---------- audit: timing ---------- */
:root { --early: #2b7fd9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --early: #6aa8ff; } }
:root[data-theme="dark"] { --early: #6aa8ff; }
.c-early { color: var(--early); }
.c-late { color: var(--late); }
.c-ontime { color: var(--done); }
a.c-early, a.c-late { text-decoration: none; font-weight: 700; }
a.c-early small, a.c-late small { font-weight: 500; opacity: .8; }
.au-filters { padding: 8px 12px; margin-bottom: 8px; display: grid; gap: 6px; }
.au-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 12px; }
.au-row label { display: inline-flex; gap: 5px; align-items: center; color: var(--ink-2); font-weight: 600; }
.au-row select { font-size: 12px; padding: 3px 6px; }
.au-periods { display: inline-flex; gap: 4px; }
.au-rule { color: var(--ink-2); }
.au-rule input[type=number] { width: 52px; font-size: 12px; padding: 2px 4px; }
.au-csv { position: relative; }
.au-csv > summary { list-style: none; cursor: pointer; }
.au-csv > summary::-webkit-details-marker { display: none; }
.au-csv > div { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 4px; min-width: 210px; display: grid; }
.au-csv > div a { padding: 6px 10px; border-radius: 6px; text-decoration: none; color: var(--ink); font-size: 12.5px; }
.au-csv > div a:hover { background: var(--raise); }
.au-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.au-tabs a { padding: 7px 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.au-tabs a[aria-current="true"] { color: var(--brand-2); border-bottom-color: var(--brand); }
.au-tabs b { font-size: 10.5px; background: var(--raise); border-radius: 999px; padding: 1px 6px; margin-left: 4px; }
.au-kpis { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 10px; }
.au-kpis a.kpi { text-decoration: none; color: inherit; }
.au-kpis a.kpi:hover { border-color: var(--brand); }
.au-kpis .kpi { padding: 7px 10px 6px; }
.au-kpis .kpi b { font-size: 20px; }
.au-kpis .kpi b.au-small { font-size: 15px; padding: 3px 0 2px; }
.au-hint { font-size: 11px; color: var(--ink-3); }
.au-active { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.au-list { margin-bottom: 10px; }
.au-listscroll { max-height: 420px; overflow: auto; }
.au-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr)); gap: 10px; }
.tbl.dense th { padding: 6px 9px; }
.tbl.dense td { padding: 4px 9px; font-size: 12px; }
.tbl.dense a { color: inherit; }
.tbl.dense td a b { color: var(--brand-2); }
.au-edit { font-size: 10.5px; color: var(--ink-3) !important; margin-left: 4px; }
.au-advice { font-size: 11px; color: var(--issue); margin-top: 1px; }
.meter3 { display: inline-flex; width: 110px; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line); vertical-align: middle; }
.meter3 i { display: block; height: 100%; }
.meter3 i.early { background: var(--early); }
.meter3 i.ok { background: var(--done); }
.meter3 i.late { background: var(--late); }
.au-hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; align-items: end; height: 110px; padding: 10px 12px 4px; }
.au-hours a { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; text-decoration: none; }
.au-hours .col { display: flex; flex-direction: column; justify-content: flex-end; background: var(--done); border-radius: 3px 3px 0 0; min-height: 2px; overflow: hidden; }
.au-hours .col i { display: block; width: 100%; }
.au-hours .col i.late { background: var(--late); order: 0; }
.au-hours .col i.early { background: var(--early); order: 1; }
.au-hours em { font-style: normal; font-size: 9px; color: var(--ink-3); text-align: center; margin-top: 2px; }
.au-hours a[aria-current="true"] em { color: var(--brand-2); font-weight: 700; }
.au-hours a:hover .col { outline: 2px solid var(--brand); }

/* ---------- checks tab: dense, filterable ---------- */
.ck-filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.ck-filters input[type=search] { width: 220px; font-size: 12.5px; padding: 5px 8px; }
.ck-filters .seg { padding: 4px 10px; font-size: 12px; }
.ck-paused { font-size: 12px; color: var(--ink-2); display: inline-flex; gap: 5px; align-items: center; }
.ck-tags { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; padding: 7px 12px; border-bottom: 1px solid var(--line); }
.ck-tags button.tagchip { cursor: pointer; font-family: inherit; }
.ck-tags button.tagchip em { font-style: normal; opacity: .6; margin-left: 2px; }
.ck-clear { border: 0; background: none; color: var(--brand-2); font-size: 11.5px; cursor: pointer; text-decoration: underline; }
.ck-tbl .ck-group td { background: var(--raise); font-size: 9.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: 3px 9px; }
.ck-tbl .ck-row[data-href] { cursor: pointer; }
.ck-tbl .ck-row:hover td { background: var(--surface-2); }
.ck-tbl .ck-row[data-active="0"] td { opacity: .55; }
.ck-tbl .ck-name a { font-weight: 600; text-decoration: none; }
.ck-tbl .ck-name .tagchip, .ck-tbl .ck-name .st { margin-left: 4px; }
.ck-tbl .ck-runs { color: var(--ink-2); max-width: 340px; }
.ck-perf { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; }
.ck-perf .meter3 { width: 70px; }

/* ---------- audit: needs action ---------- */
.au-sum { font-size: 13.5px; margin: 2px 0 10px; color: var(--ink-2); }
.au-sum b { color: var(--ink); }
.au-findings { display: grid; gap: 8px; }
.au-find { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line-2); border-radius: var(--r); padding: 10px 12px; }
.au-find[data-level="act"] { border-left-color: var(--late); }
.au-find[data-level="watch"] { border-left-color: var(--next); }
.au-find[data-level="ok"] { border-left-color: var(--done); }
.au-lvl { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 3px 0; text-align: center; border-radius: 5px; background: var(--raise); color: var(--ink-2); }
.au-find[data-level="act"] .au-lvl { background: var(--late-wash); color: var(--late); }
.au-find[data-level="watch"] .au-lvl { background: var(--next-wash); color: color-mix(in srgb, var(--next) 60%, var(--ink)); }
.au-find[data-level="ok"] .au-lvl { background: var(--done-wash); color: var(--done); }
.au-body b { font-size: 14px; display: block; }
.au-ev { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.au-adv { font-size: 12.5px; margin-top: 5px; }
.au-acts { display: flex; flex-direction: column; gap: 5px; align-items: stretch; }
.au-acts .btn { font-size: 12px; white-space: nowrap; text-align: center; }
.au-foot { font-size: 11.5px; color: var(--ink-3); margin: 10px 2px; }
@media (max-width: 700px) {
  .au-find { grid-template-columns: 1fr; }
  .au-lvl { justify-self: start; padding: 2px 8px; }
  .au-acts { flex-direction: row; flex-wrap: wrap; }
}

/* ---------- pending NPO ---------- */
.wait-tag { font-size: 9.5px; font-weight: 800; letter-spacing: .04em; padding: 1px 6px; border-radius: 4px; background: var(--next-wash); color: color-mix(in srgb, var(--next) 55%, var(--ink)); margin-right: 4px; }
.npo-form { display: grid; gap: 6px; margin: 0 0 7px; }
.npo-form input[type=text] { width: 100%; min-width: 0; font-size: 12.5px; }
.npo-form .btn { width: 100%; text-align: left; }

/* ---------- user menu + view as ---------- */
.who-menu { position: relative; }
.who-menu > summary { list-style: none; cursor: pointer; }
.who-menu > summary::-webkit-details-marker { display: none; }
.who-menu .caret { font-size: 10px; color: var(--ink-3); margin-left: 2px; }
.who-menu[open] > summary { border-color: var(--brand); }
.who-drop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; width: 300px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; display: grid; gap: 2px; }
.who-drop .who-head { font-size: 11.5px; color: var(--ink-3); padding: 4px 8px 6px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.who-drop a, .who-drop button { display: block; width: 100%; text-align: left; padding: 7px 8px; border-radius: 6px; font: inherit; font-size: 13px; color: var(--ink); background: none; border: 0; cursor: pointer; text-decoration: none; }
.who-drop a:hover, .who-drop button:hover { background: var(--raise); }
.who-drop .who-back { color: var(--brand-2); font-weight: 700; }
.who-as { padding: 6px 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 2px 0; display: grid; gap: 4px; }
.who-as label { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.who-as select { width: 100%; font-size: 12.5px; }
.viewas-bar { position: sticky; top: 0; z-index: 70; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: center; padding: 7px 16px; background: var(--brand); color: #fff; font-size: 12.5px; }
.viewas-bar .btn { background: #fff; color: var(--brand-2); border-color: #fff; font-weight: 700; }

/* ---------- team: inline edit ---------- */
.uedit { display: inline-block; vertical-align: top; }
.uedit > summary { list-style: none; cursor: pointer; }
.uedit > summary::-webkit-details-marker { display: none; }
.uedit[open] > form { display: grid; gap: 6px; margin: 8px 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); min-width: 280px; white-space: normal; }
.uedit label { display: grid; gap: 2px; font-size: 11px; font-weight: 700; color: var(--ink-3); }
.uedit input, .uedit select { font-size: 12.5px; }
.ck-clone { font-size: 11.5px; color: var(--ink-3); text-decoration: none; } .ck-clone:hover { color: var(--brand-2); text-decoration: underline; }

/* ---------- desks ---------- */
.dk { border-top: 1px solid var(--line); }
.dk > summary { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 9px 13px; cursor: pointer; list-style: none; }
.dk > summary::-webkit-details-marker { display: none; }
.dk[open] > summary { background: var(--surface-2); }
.dk-state { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 1px 7px; border-radius: 999px; }
.dk-state.open { background: var(--done-wash); color: var(--done); }
.dk-state.closed { background: var(--late-wash); color: var(--late); }
.dk-form { padding: 10px 13px; display: grid; gap: 10px; }
.dk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.dk-grid label { display: grid; gap: 3px; font-size: 11px; font-weight: 700; color: var(--ink-3); }
.dk-grid .wide { grid-column: span 2; }
.dk-hours { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12.5px; }
.dk-hours label { display: inline-flex; gap: 4px; align-items: center; }
.dk-days { display: inline-flex; flex-wrap: wrap; gap: 4px 8px; }
.dk-actions { display: flex; gap: 8px; }
.dk-danger { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 8px 13px 12px; border-top: 1px dashed var(--line); }
.dk-danger form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.desktab .dt-closed { font-size: 9.5px; font-weight: 800; letter-spacing: .05em; color: var(--late); margin-left: 4px; }

/* ---------- board rows: missed = soft red + gentle pulse, this hour = soft purple, still ---------- */
.cr[data-s="late"], .cr[data-s="esc"] {
  background: color-mix(in srgb, var(--late) 8%, var(--surface));
  animation: nn-missed 2.4s ease-in-out infinite;
}
.cr[data-s="late"]:hover, .cr[data-s="esc"]:hover { background: color-mix(in srgb, var(--late) 14%, var(--surface)); animation-play-state: paused; }
.cr[data-s="hour"] { background: color-mix(in srgb, var(--brand) 7%, var(--surface)); }
.cr[data-s="hour"]:hover { background: color-mix(in srgb, var(--brand) 12%, var(--surface)); }
/* the selected row keeps its colour and gets a clear edge instead */
.cr[aria-current="true"] { box-shadow: inset 3px 0 0 var(--brand); }
@keyframes nn-missed {
  0%, 100% { background: color-mix(in srgb, var(--late) 6%, var(--surface)); }
  50%      { background: color-mix(in srgb, var(--late) 17%, var(--surface)); }
}
@media (prefers-reduced-motion: reduce) {
  .cr[data-s="late"], .cr[data-s="esc"] { animation: none; background: color-mix(in srgb, var(--late) 12%, var(--surface)); }
}

/* ---------- done with an incident ---------- */
.inc-tag { font-size: 9.5px; font-weight: 800; letter-spacing: .03em; padding: 1px 6px; border-radius: 4px; background: var(--issue-wash); color: var(--issue); }
.incbox { background: var(--issue-wash); color: var(--ink); border-radius: 7px; padding: 8px 10px; font-size: 12.5px; }
.incform { display: grid; gap: 6px; margin-top: 7px; }

/* the tab row scrolls sideways on a narrow screen, but never shows a scrollbar
   (overflow-x alone makes the browser add a vertical one for the 1px tab underline) */
.top > .tabs { overflow-y: hidden; scrollbar-width: none; }
.top > .tabs::-webkit-scrollbar { display: none; }

/* ---------- desks: tab order ---------- */
.dk-order { padding: 10px 13px; border-top: 1px solid var(--line); }
.dk-order ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; max-width: 520px; }
.dk-late { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.dk-late .dlab { flex-basis: 100%; }
.dk-order li { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
.dk-order li form { display: inline; }
.dk-order .btn { padding: 2px 9px; }
.dk-pos { width: 18px; color: var(--ink-3); font-size: 11px; }

/* ---------- people picker (several at once) ---------- */
.pp { border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); }
.pp-head { display: flex; gap: 6px; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pp-head input[type=search] { flex: 1 1 140px; min-width: 0; font-size: 12.5px; padding: 3px 6px; }
.pp-all { border: 0; background: none; color: var(--brand-2); font-size: 11.5px; cursor: pointer; text-decoration: underline; }
.pp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 10px; padding: 6px 8px; max-height: 180px; overflow: auto; }
.pp-list label { display: flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 500; color: var(--ink); text-transform: none; letter-spacing: 0; padding: 2px 0; }

/* ---------- check windows ---------- */
.winrow { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: 12.5px; margin: 10px 0; }
.winrow .nmeta { flex-basis: 100%; }
.cr-t small { display: block; font-size: 9.5px; color: var(--ink-3); line-height: 1; }
.earlynote { margin-top: 6px; font-size: 12px; background: color-mix(in srgb, var(--early, #2b7fd9) 10%, var(--surface)); border-radius: 6px; padding: 5px 8px; }

/* ---------- desk tab: the claim lives on the tab itself ---------- */
.desktab { display: flex; flex-direction: column; gap: 6px; }
.desktab .dt-link { display: grid; gap: 5px; color: inherit; text-decoration: none; }
.desktab .dt-claim { display: flex; align-items: center; }
.desktab .dt-claim .btn { padding: 3px 12px; font-size: 12px; }
.desktab span.dt-claim { font-size: 11.5px; }
.desktab .stack em { font-style: normal; }

/* ---------- one slim top bar: brand, menu, then clock and account ---------- */
.top > .top-in { padding-block: 5px; gap: 10px; flex-wrap: nowrap; }
.top-in .mark { width: 24px; height: 24px; }
.top-in .wordmark b { font-size: 14px; }
.top-in .wordmark span { font-size: 8.5px; margin-top: 2px; }
.top-in > .tabs {
  max-width: none; margin: 0 0 0 8px; padding: 0; border: 0;
  flex: 0 1 auto; min-width: 0; gap: 2px;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
}
.top-in > .tabs::-webkit-scrollbar { display: none; }
.top-in .tab { padding: 5px 10px; border: 0; margin: 0; border-radius: 7px; font-size: 12.5px; }
.top-in .tab:hover { background: var(--surface-2); color: var(--ink); }
.top-in .tab[aria-selected="true"] { background: var(--brand-wash); color: var(--brand-2); }
.top-in .clock b { font-size: 15px; }
.top-in .clock span { font-size: 9px; }
.top-in .bell { padding: 4px 10px; }
.top-in .who { padding: 3px 8px 3px 4px; }
.top-in .btn { padding-block: 4px; }
.top-in > * { flex-shrink: 0; }
.top-in > .tabs, .top-in > .spacer { flex-shrink: 1; }
@media (max-width: 1250px) {
  .top-in .clock span, .top-in .wordmark span { display: none; }
}
@media (max-width: 900px) {
  .top > .top-in { flex-wrap: wrap; }
  .top-in > .tabs { order: 10; flex-basis: 100%; margin: 0; }
}

/* ---------- groups & rights matrix ---------- */
.tbl.rights th.rg, .tbl.rights td.rg { text-align: center; white-space: nowrap; }
.tbl.rights td.rg input[type=checkbox] { width: 16px; height: 16px; }
.tbl.rights .rt-all { color: var(--brand-2); font-weight: 800; }
.tbl.rights .rt-save td { background: var(--surface-2); }
.tbl.rights .rt-save form { display: inline-block; margin: 2px; }
.rt-new { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 13px; border-top: 1px solid var(--line); }

/* ---------- explanation for the operator ---------- */
.introbox { margin-top: 8px; padding: 9px 11px; border-radius: 8px; background: var(--brand-wash); border-left: 3px solid var(--brand); font-size: 13px; line-height: 1.45; color: var(--ink); }
.introbox a { color: var(--brand-2); word-break: break-all; }
/* long overdue: explain before closing (full width above the do-it column), and the explanation once given */
.dcols > .latebox { grid-column: 1 / -1; border-right: 0; background: var(--late-wash); box-shadow: inset 3px 0 0 var(--late); }
.latebox textarea { display: block; width: 100%; margin: 6px 0; }
.latebox .dlab { color: var(--late); }
.latebox.done { margin-top: 8px; padding: 8px 11px; border-radius: 8px; background: var(--late-wash); border-left: 3px solid var(--late); font-size: 12.5px; }
.latebox.done div { margin-top: 3px; color: var(--ink); }

/* ---------- playlist manager ---------- */
.pm-set, .pm-due { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 10px 13px; border-top: 1px solid var(--line); font-size: 12.5px; }
.pm-set .nmeta { flex-basis: 100%; }
.pm-due form { display: inline; }
.pm-v { display: flex; flex-wrap: wrap; gap: 4px; }
.adm-tabs { margin-top: 2px; }
.roles-page { display: grid; gap: 12px; }

/* ---------- search ---------- */
.topsearch input { width: 190px; font-size: 12.5px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); }
.topsearch input:focus { width: 260px; background: var(--surface); outline: 2px solid var(--brand-wash); }
@media (max-width: 1250px) { .topsearch { display: none; } }
.sr-form { padding: 12px 14px; display: grid; gap: 8px; margin-bottom: 12px; }
.sr-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sr-bar input[type=search] { flex: 1 1 380px; min-width: 0; font-size: 15px; padding: 9px 12px; border-radius: 9px; }
.sr-notes { font-size: 12px; color: var(--ink-2); display: inline-flex; gap: 5px; align-items: center; }
.sr-row { display: flex; flex-wrap: wrap; gap: 5px 6px; align-items: center; font-size: 12.5px; }
.sr-row .dlab { width: 52px; margin: 0; }
.sr-row select { font-size: 12.5px; padding: 3px 6px; }
.sr-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 12px; font-weight: 600; text-decoration: none; }
.sr-chip:hover { border-color: var(--line-2); color: var(--ink); }
.sr-chip[aria-current="true"] { background: var(--brand-wash); border-color: var(--brand); color: var(--brand-2); }
.sr-chip[aria-disabled="true"] { opacity: .4; }
.sr-custom { display: inline-flex; gap: 4px; align-items: center; margin-left: 6px; }
.sr-custom input { font-size: 12px; padding: 2px 5px; }
.sr-results { margin-bottom: 12px; }
.sr-day { position: sticky; top: 0; z-index: 1; padding: 5px 13px; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); background: var(--raise); border-top: 1px solid var(--line); }
.sr-item { display: grid; grid-template-columns: 52px 150px minmax(0, 1fr) 40px 130px 110px; gap: 10px; align-items: center; padding: 6px 13px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 12.5px; }
a.sr-item:hover { background: var(--surface-2); }
.sr-t { font-size: 11.5px; color: var(--ink-2); }
.sr-t small { display: block; font-size: 9.5px; color: var(--ink-3); }
.sr-code { font-size: 11px; color: var(--brand-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-title { min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.sr-ticket { font-size: 10.5px; color: var(--ink-3); }
.sr-desk { font-size: 11px; color: var(--ink-3); }
.sr-who { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-st { justify-self: end; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: var(--raise); color: var(--ink-2); }
.sr-st[data-k="late"] { background: var(--late-wash); color: var(--late); }
.sr-st[data-k="done"] { background: var(--done-wash); color: var(--done); }
.sr-st[data-k="early"] { background: color-mix(in srgb, var(--early) 12%, var(--surface)); color: var(--early); }
.sr-st[data-k="incident"] { background: var(--issue-wash); color: var(--issue); }
.sr-st[data-k="todo"] { background: var(--brand-wash); color: var(--brand-2); }
.sr-st[data-k="planned"] { background: transparent; border: 1px dashed var(--line-2); color: var(--ink-3); }
.sr-planned .sr-item { color: var(--ink-2); }
.sr-empty { padding: 18px 13px; color: var(--ink-3); font-size: 13px; }
.sr-pages { padding: 10px 13px; border-top: 1px solid var(--line); }
.sr-pager { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
@media (max-width: 760px) {
  .sr-item { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .sr-code, .sr-desk, .sr-who { display: none; }
}

/* search: same shell as a desk — list left, the check right */
.sr-flow .sr-results + .sr-results { border-top: 6px solid var(--raise); }
.sr-flow .phead { position: sticky; top: 0; z-index: 2; background: var(--surface); }
.sr-item[aria-current="true"] { background: var(--brand-wash); box-shadow: inset 3px 0 0 var(--brand); }
@media (min-width: 1000px) {
  .sr-shell .sr-item { grid-template-columns: 46px 140px minmax(0, 1fr) 34px 110px 96px; gap: 8px; }
  .sr-shell .sr-form { padding: 9px 12px; gap: 5px; }
}

/* audit: people against the team */
.au-team td { background: var(--surface-2); border-bottom: 2px solid var(--line-2); }
.vs { display: block; font-size: 10px; font-weight: 700; }
.vs.worse { color: var(--late); }
.vs.better { color: var(--done); }
.vs.same { color: var(--ink-3); font-weight: 500; }
.sr-bulk { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; padding: 8px 13px; background: var(--late-wash); border-top: 1px solid var(--line); font-size: 12.5px; }
.sr-bulk input[type=text] { flex: 1 1 240px; min-width: 0; font-size: 12.5px; }

/* ---------- board rows: title, labels on the right, a fixed repeat column ---------- */
.cr { grid-template-columns: 42px 18px minmax(0, 1fr) auto 16px 34px auto; }
.cr-title { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-labels { display: flex; flex-wrap: wrap; gap: 3px 5px; justify-content: flex-end; align-items: center; }
.cr-labels:empty { display: none; }
.cr-labels .info { color: var(--brand-2); }
.cr-rep { font-size: 12px; font-weight: 800; line-height: 1; text-align: center; color: var(--line-2); }
.cr-rep.on { color: var(--brand); }
.cr-steps { text-align: right; }
/* search rows: title left, labels right */
.sr-title { flex-wrap: nowrap; justify-content: space-between; }
.sr-tt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-labels { display: flex; flex-wrap: wrap; gap: 3px 5px; justify-content: flex-end; align-items: center; flex: 0 1 auto; }
.al-url { width: 100%; margin-top: 5px; font-size: 12px; }

/* ---------- Jira tickets on a check ---------- */
.tkrow { display: flex; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.tkrow b { color: var(--brand-2); }
.tk-note { flex: 1 1 auto; min-width: 0; color: var(--ink-2); }
.tkrow form { display: inline; }
.tk-x { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 12px; }
.tk-x:hover { color: var(--late); }
.tkform { display: grid; gap: 6px; margin-top: 8px; }
.tk-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.tk-tag { font-size: 9.5px; font-weight: 800; letter-spacing: .03em; padding: 1px 6px; border-radius: 4px; background: var(--brand-wash); color: var(--brand-2); }
.desktabs .dt-paper { align-self: center; font-size: 12px; }
.paperform { display: inline-flex; gap: 6px; align-items: center; }
.paperform select { font-size: 12px; }
.runbook { display: inline-block; margin-top: 8px; font-weight: 700; }

/* right-click menu (super admin: cancel all missed) */
.ctxmenu { position: fixed; z-index: 80; display: grid; gap: 4px; max-width: 320px; padding: 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px; box-shadow: var(--shadow); }
.ctxmenu[hidden] { display: none; }
.ctxmenu button { text-align: left; padding: 7px 9px; border: 0; border-radius: 6px; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--late); cursor: pointer; }
.ctxmenu button:hover, .ctxmenu button:focus { background: var(--late-wash); outline: none; }
.ctxmenu .nmeta { padding: 0 9px 4px; font-size: 11px; }

/* straight columns: every row is its own grid, so everything right of the
   title has a FIXED width — then the icon, the n/n and the time line up */
.cr { grid-template-columns: 42px 18px minmax(0, 1fr) auto 16px 44px 76px; }
.cr-steps { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cr[data-done="true"] .cr-steps { color: var(--done); }
.cr-when { min-width: 0; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }

/* rows without the steps count: title · labels · repeat · time */
.cr { grid-template-columns: 42px 18px minmax(0, 1fr) auto 16px 76px; }

/* rows without the assignee avatar */
.cr { grid-template-columns: 42px minmax(0, 1fr) auto 16px 76px; }

/* checks tab: list left, the check right */
.ck-flow { background: var(--surface); }
.ck-flow thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.ck-tbl .ck-row { cursor: pointer; }
.ck-tbl .ck-row[aria-current="true"] td { background: var(--brand-wash); }
.ck-tbl .ck-row[aria-current="true"] td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.ck-actions { display: flex; gap: 6px; margin-top: 10px; }
.ck-recent { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px dashed var(--line); text-decoration: none; color: var(--ink); font-size: 12px; }
.ck-recent:hover { background: var(--surface-2); }

/* live board: someone else changed something while you were typing */
.liveupd { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 70; display: flex; gap: 10px; align-items: center; padding: 8px 10px 8px 14px; background: var(--surface); border: 1px solid var(--brand); border-radius: 10px; box-shadow: var(--shadow); font-size: 13px; }
.liveupd[hidden] { display: none; }

.linkrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.linkrow .runbook { margin-top: 0; }

/* release notes */
.rel-wrap { max-width: 860px; margin: 0 auto; }
.rel-intro { padding: 4px 16px 0; font-size: 13px; color: var(--ink-2); }
.rel { padding: 12px 16px 14px; border-top: 1px solid var(--line); }
.rel h3 { margin: 0 0 6px; font-size: 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rel h3 .mono { color: var(--brand-2); }
.rel ul { margin: 4px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.5; }
.rel-state { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; }
.rel-state.live { background: var(--done-wash); color: var(--done); }
.rel-state.next { background: var(--brand-wash); color: var(--brand-2); }
.rel-build { margin: 10px 0 0 4px; padding-left: 12px; border-left: 2px solid var(--line-2); }
.rel-bh { font-size: 12.5px; font-weight: 700; }

/* Personal task steps: the same first-line alignment as on a desk check. */
.pitem { align-items: flex-start; }
.pitem span { line-height: 18px; }

/* Personal & training tab: how many tasks wait for you — brand colour, red once one is overdue */
.tab b.todo { background: var(--brand); }
.personal-waiting { display: block; margin: 0 0 8px; padding: 6px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 600;
  background: var(--brand-wash); color: var(--brand-2); text-decoration: none; }
.personal-waiting[data-over="true"] { background: var(--late-wash); color: var(--late); }

/* A step is one line: a long one ends in "…", the whole text is on hover.
   Rows keep their height, so the checkboxes never move. */
.sub .sub-t, .pitem .sub-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* Theme switch in the menu under your name */
.who-drop .who-theme { display: flex; align-items: center; gap: 4px; padding: 6px 12px; }
.who-drop .who-theme span { flex: 1; font-size: 12.5px; color: var(--ink-2); }
.who-drop .who-theme button { display: inline-block; text-align: center; width: auto; padding: 3px 8px; font-size: 11.5px; border: 1px solid var(--line-2); border-radius: 6px;
  background: var(--surface); color: var(--ink-2); }
.who-drop .who-theme button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

/* The logo catches the light: a glare sweeps over the mark and the name every
   few seconds. Off for people who ask their computer for less motion. */
.top-in .brand { position: relative; overflow: hidden; isolation: isolate; }
.top-in .brand::after {
  content: ""; position: absolute; top: -40%; bottom: -40%; left: -40%; width: 28px; pointer-events: none; z-index: 1;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75) 45%, rgba(255, 255, 255, .95) 50%, rgba(255, 255, 255, .75) 55%, transparent);
  transform: skewX(-22deg); opacity: .85;
  animation: nn-glare 6.5s ease-in-out 1.2s infinite;
}
.top-in .brand .mark { animation: nn-mark-glow 6.5s ease-in-out 1.2s infinite; }
@keyframes nn-glare {
  0% { left: -40%; }
  22% { left: 125%; }
  100% { left: 125%; }
}
@keyframes nn-mark-glow {
  0%, 100% { filter: none; }
  8% { filter: drop-shadow(0 0 5px color-mix(in srgb, var(--brand) 70%, transparent)) brightness(1.15); }
  20% { filter: none; }
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .top-in .brand::after { opacity: .5; } }
:root[data-theme="dark"] .top-in .brand::after { opacity: .5; }
@media (prefers-reduced-motion: reduce) {
  .top-in .brand::after, .top-in .brand .mark { animation: none; }
  .top-in .brand::after { display: none; }
}

/* Delegate: one tile per desk, its icon and name */
.dlg { width: 100%; display: grid; gap: 5px; margin-top: 4px; }
.dlg-lab { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.dlg-row { display: flex; flex-wrap: wrap; gap: 6px; }
.dlg-row form { margin: 0; }
.dlg-btn { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 7px; border: 1px solid var(--line-2); border-radius: 9px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: border-color .12s, background .12s, transform .12s; }
.dlg-btn:hover { border-color: var(--brand); background: var(--brand-wash); transform: translateY(-1px); }
.dlg-btn:active { transform: none; }
.dlg-ico { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-size: 15px; line-height: 1;
  background: var(--raise); flex: 0 0 auto; }
.dlg-ico .mono { font-size: 10px; font-weight: 700; color: var(--brand-2); }

/* Desk icon picker in the desk settings */
.dk-icons { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 8px 0; }
.dk-icons .dlab { margin-right: 6px !important; }
.dk-icons label { cursor: pointer; }
.dk-icons input { position: absolute; opacity: 0; pointer-events: none; }
.dk-icons label > span { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 4px; border-radius: 8px; font-size: 17px;
  border: 1px solid var(--line); background: var(--surface); }
.dk-icons label > span.mono { font-size: 10px; font-weight: 700; color: var(--ink-2); }
.dk-icons input:checked + span { border-color: var(--brand); background: var(--brand-wash); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 30%, transparent); }
.dk-icons input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 1px; }

.dt-ico { margin-right: 5px; }

/* Desk tools admin */
.tl-shell { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 12px; align-items: start; }
@media (max-width: 900px) { .tl-shell { grid-template-columns: 1fr; } }
.tl-item { display: flex; gap: 10px; align-items: center; padding: 9px 13px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.tl-item:hover { background: var(--raise); }
.tl-item[aria-current="true"] { background: var(--brand-wash); }
.tl-code { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 13px 13px; }
@media (max-width: 1100px) { .tl-code { grid-template-columns: 1fr; } }
.tl-pane { display: grid; gap: 5px; align-content: start; }
.tl-pane textarea { min-height: 460px; font: 12px/1.45 "IBM Plex Mono", ui-monospace, monospace; tab-size: 2; white-space: pre; resize: vertical; }
.tl-frame { width: 100%; min-height: 460px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }

/* Desk tools on the board: buttons in the tab bar, the tool in a dialog */
.dt-tools { display: inline-flex; gap: 4px; align-items: center; }
.dt-tool { display: inline-flex; align-items: center; gap: 5px; }
.tooldialog { width: min(760px, 96vw); height: min(640px, 90vh); padding: 0; border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--surface); color: var(--ink); }
.tooldialog[open] { display: flex; flex-direction: column; }
.tooldialog::backdrop { background: rgba(10, 6, 20, .45); }
.tooldialog .fd-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.tooldialog iframe { flex: 1; width: 100%; border: 0; background: var(--surface); }

/* "Never missed": the two words blink one after the other, once every 20 seconds */
.wordmark .tagline em { font-style: normal; display: inline-block; }
.wordmark .tagline em:first-child { animation: nn-blink-never 20s linear 3s infinite; }
.wordmark .tagline em:last-child { animation: nn-blink-missed 20s linear 3s infinite; }
@keyframes nn-blink-never {
  0%, 3.5%, 100% { color: inherit; text-shadow: none; }
  1%, 2.5% { color: var(--brand); text-shadow: 0 0 6px color-mix(in srgb, var(--brand) 60%, transparent); }
}
@keyframes nn-blink-missed {
  0%, 3.5%, 7%, 100% { color: inherit; text-shadow: none; }
  4.5%, 6% { color: var(--late); text-shadow: 0 0 6px color-mix(in srgb, var(--late) 60%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .wordmark .tagline em { animation: none !important; } }

/* Own icon images: always a small square picture */
.ico-img { width: 18px; height: 18px; object-fit: contain; vertical-align: -3px; border-radius: 3px; }
.dlg-ico .ico-img { width: 20px; height: 20px; }
.dt-ico .ico-img { width: 15px; height: 15px; }
.ico-preview { width: 32px; height: 32px; border: 1px solid var(--line); background: var(--surface); padding: 2px; }
.dk-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 8px; }

.tl-desk { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 13px 5px; border-top: 1px solid var(--line);
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.tl-desk a { text-transform: none; letter-spacing: 0; font-weight: 600; }
.tl-none { padding: 2px 13px 10px; }

/* A desk tool fills the board area, where the checks are */
.toolpane { display: flex; flex-direction: column; min-height: calc(100vh - 150px); border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); overflow: hidden; }
.toolpane[hidden] { display: none; }
.toolpane-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.toolpane iframe { flex: 1; width: 100%; min-height: calc(100vh - 200px); border: 0; background: var(--surface); }
.dt-tool[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-wash); color: var(--brand-2); }
@media (min-width: 1000px) {
  /* on the fixed-height board the tool takes exactly the room the checks had */
  body.fixed-app .toolpane { flex: 1 1 auto; min-height: 0; }
  body.fixed-app .toolpane iframe { min-height: 0; }
}

/* A check's widget: its own page, sealed off, in the check pane */
.cwidget { display: block; width: 100%; height: 260px; margin: 10px 0 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }

/* "Update the open checks too?" after editing a repeating check */
.stale-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; padding: 9px 12px; border-radius: 8px;
  background: var(--next-wash); border: 1px solid color-mix(in srgb, var(--next) 50%, var(--line)); font-size: 13px; }
.stale-ask > span:first-child { flex: 1 1 auto; }

/* who is on a desk: a small count, names on hover */
.dt-claims { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--brand-wash); color: var(--brand-2); cursor: default; }
.dt-claims.none { background: var(--raise); color: var(--ink-3); font-weight: 600; }
.dt-claims.mine { box-shadow: 0 0 0 1.5px var(--brand); }

/* Expired: closed because nobody did it in time — folded, a muted red edge */
.band[data-k="expired"] { border-left: 3px solid color-mix(in srgb, var(--late) 45%, var(--line-2)); }

/* Rule form: what a rule leaves out */
.lo-block { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 4px; }
.lo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 6px; }
.lo-grid textarea { width: 100%; }

/* Rule flow: cards read top to bottom, + between them, a condition splits into two columns */
.fx { padding: 10px 0 6px; }
.fx-col, .fx-branch { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.fx-card { width: min(460px, 100%); border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.fx-card.is-open { width: min(620px, 100%); border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }
.fx-head { display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 11px; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; border-radius: 10px; }
.fx-head:hover { background: var(--surface-2); }
.fx-ic { flex: 0 0 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; background: var(--surface-2); font-size: 14px; }
.fx-tt { display: grid; gap: 1px; flex: 1 1 auto; min-width: 0; }
.fx-tt small { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.fx-tt b { font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.fx-n { font: 600 12px var(--mono, "IBM Plex Mono", monospace); color: var(--brand-2); white-space: nowrap; }
.fx-chev { color: var(--ink-3); font-size: 11px; }
.fx-body { padding: 4px 12px 11px; border-top: 1px solid var(--line); }
.fx-trigger .fx-ic { background: var(--brand-wash); color: var(--brand-2); }
.fx-if .fx-ic { background: color-mix(in srgb, var(--brand) 18%, var(--surface)); }
.fx-check { background: var(--done-wash); border-color: color-mix(in srgb, var(--done) 40%, var(--line-2)); }
.fx-check .fx-ic { background: var(--surface); color: var(--done); }
.fx-g .fx-tt small { color: var(--issue); }
.fx-line { width: 2px; height: 10px; background: var(--line-2); }
.fx-pluswrap { position: relative; }
.fx-plus { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--brand-2); font: 700 14px/1 inherit; cursor: pointer; }
.fx-plus:hover, .fx-plus[aria-expanded="true"] { border-color: var(--brand); background: var(--brand-wash); }
.fx-menu { position: absolute; z-index: 5; top: 28px; left: 50%; transform: translateX(-50%); width: 260px; display: grid; padding: 4px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); box-shadow: 0 6px 20px rgb(0 0 0 / .14); }
.fx-mi { display: grid; gap: 1px; padding: 7px 9px; border: 0; border-radius: 6px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.fx-mi:hover, .fx-mi:focus-visible { background: var(--surface-2); }
.fx-mi small { color: var(--ink-3); font-size: 11.5px; }
.fx-end { font-size: 11.5px; color: var(--ink-3); border: 1px dashed var(--line-2); border-radius: 8px; padding: 5px 10px; }
.fx-ifwrap { display: flex; flex-direction: column; align-items: center; width: 100%; }
.fx-branches { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; border-top: 2px solid var(--line-2); margin-top: 10px; }
.fx-branch { padding: 0 2px; }
.fx-lab { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; border-radius: 5px; padding: 2px 7px; }
.fx-yes .fx-lab { color: var(--done); background: var(--done-wash); }
.fx-no .fx-lab { color: var(--issue); background: color-mix(in srgb, var(--issue) 12%, var(--surface)); }
.fx-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 6px; }
.fx-value { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fx-value textarea { min-width: min(420px, 100%); }
.fx-checks { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.fx-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.fx-checkform { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 12px; margin-top: 8px; }
.fx-checkform .fx-wide { grid-column: 1 / -1; }
.fx-checkform .fld { display: grid; gap: 3px; }
.fx-fl { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.fx-when { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fx-body > .fx-panel { margin-top: 8px; }
@media (max-width: 640px) { .fx-branches { grid-template-columns: 1fr; border-top: 0; } }

/* Check blocks: a repeating check or playlist rule as connected blocks — runs → goes to → check → its life —
   each opening in place, with a column at the side that stays in view (next runs, how it went, save) */
.cbx { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .cbx { grid-template-columns: minmax(0, 1fr); } }
.cbx-side { position: sticky; top: 12px; display: grid; gap: 12px; }
.cbx-side .panel { padding: 12px 14px; margin: 0; }
.cbx-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cbx-head h2 { margin: 0; font-size: 18px; }
.cbx-crumb { color: var(--ink-3); font-size: 12.5px; }
.cb { border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); }
.cb.is-open { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 18%, transparent); }
.cb-head { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 13px; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; border-radius: 12px; }
.cb-head:hover { background: var(--surface-2); }
.cb-ic { flex: 0 0 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; background: var(--surface-2); }
.cb-runs .cb-ic { background: var(--brand-wash); color: var(--brand-2); }
.cb-goes .cb-ic { background: var(--raise); color: var(--ink-2); }
.cb-check .cb-ic { background: var(--done-wash); color: var(--done); }
.cb-life .cb-ic { background: var(--next-wash); color: color-mix(in srgb, var(--next) 55%, var(--ink)); }
.cb-tt { display: grid; gap: 1px; flex: 1 1 auto; min-width: 0; }
.cb-tt small { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.cb-tt b { font-size: 13.5px; line-height: 1.35; overflow-wrap: anywhere; }
.cb-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 3px; }
.cb-chip { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.cb-chip.desk { background: var(--brand-wash); border-color: transparent; color: var(--brand-2); }
.cb-chev { color: var(--ink-3); font-size: 11px; }
.cb-body { padding: 4px 14px 14px; border-top: 1px solid var(--line); }
.cb-line { width: 2px; height: 16px; background: var(--line-2); margin: 0 auto; }
.cb-sub { border-top: 1px solid var(--line); }
.cb-sub > summary { display: flex; align-items: center; gap: 8px; padding: 9px 2px; cursor: pointer; font-size: 13px; font-weight: 600; list-style: none; }
.cb-sub > summary::-webkit-details-marker { display: none; }
.cb-sub > summary::after { content: '▾'; margin-left: 6px; color: var(--ink-3); font-size: 11px; }
.cb-sub[open] > summary::after { content: '▴'; }
.cb-sub > summary .spacer { flex: 1; }
.cb-sub > .fgrid, .cb-sub > div { padding-bottom: 10px; }
.cb-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.cb-pill { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.cb-pill[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
/* "Goes to": the conditions, first that fits */
.gt-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; padding: 7px 9px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); margin-top: 6px; }
.gt-row .gt-to { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.gt-row.otherwise { background: none; border-style: dashed; }
.gt-row .dowmini { display: inline-flex; gap: 2px; }
.gt-row .dowmini label { font-size: 11px; padding: 2px 5px; border-radius: 5px; border: 1px solid var(--line-2); cursor: pointer; }
.gt-row .dowmini input:checked + span { color: var(--brand-2); font-weight: 700; }
.gt-central { font-size: 12px; color: var(--ink-2); margin-top: 8px; }
/* steps as a list you can drag */
.st-list { display: grid; gap: 4px; margin: 6px 0; }
.st-row { display: flex; align-items: center; gap: 7px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.st-row.dragging { opacity: .5; }
.st-grip { cursor: grab; color: var(--ink-3); user-select: none; padding: 0 2px; }
.st-n { font: 600 11.5px var(--mono, "IBM Plex Mono", monospace); color: var(--ink-3); width: 18px; text-align: right; }
.st-row input { flex: 1; border: 0; background: none; padding: 4px 2px; font: inherit; color: var(--ink); }
.st-row input:focus { outline: none; }
.st-x { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 14px; }
/* its life: one timeline */
.lf-line { position: relative; height: 54px; margin: 14px 8px 4px; user-select: none; touch-action: none; }
.lf-track { position: absolute; top: 22px; left: 0; right: 0; height: 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); }
.lf-seg { position: absolute; top: 23px; height: 6px; }
.lf-seg.early { background: color-mix(in srgb, var(--brand) 25%, transparent); }
.lf-seg.ok { background: color-mix(in srgb, var(--done) 45%, transparent); }
.lf-seg.late { background: color-mix(in srgb, var(--next) 70%, transparent); }
.lf-seg.ask { background: color-mix(in srgb, var(--late) 35%, transparent); }
.lf-mark { position: absolute; top: 14px; width: 14px; height: 24px; margin-left: -7px; border-radius: 6px; background: var(--surface); border: 2px solid var(--ink-2); cursor: ew-resize; }
.lf-mark.due { border-color: var(--ink); cursor: default; }
.lf-mark.ask { border-color: var(--late); }
.lf-mark.exp { border-color: var(--late); background: var(--late); }
.lf-lab { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; color: var(--ink-2); white-space: nowrap; }
.lf-lab.below { top: 40px; color: var(--ink-3); }
.lf-hint { font-size: 11.5px; color: var(--ink-3); }
/* the side */
.sd-runs { display: grid; gap: 3px; font: 12px var(--mono, "IBM Plex Mono", monospace); }
.sd-runs div { display: flex; align-items: center; gap: 8px; }
.sd-stats { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; font-size: 12.5px; }
.sd-stats b { text-align: right; }
.cb-switch { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.cb-switch input { width: 34px; height: 20px; appearance: none; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; transition: background .15s; }
.cb-switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.cb-switch input:checked { background: var(--done); }
.cb-switch input:checked::after { left: 16px; }

/* fields in a block: one per row, the label in a fixed column on the left, hints under the field */
.cb-rows { display: grid; gap: 10px; }
.cb-rows > .fld { display: grid; grid-template-columns: 190px minmax(0, 1fr); column-gap: 14px; row-gap: 3px; align-items: center; }
.cb-rows > .fld > label { grid-column: 1; grid-row: 1 / span 3; align-self: start; padding-top: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.cb-rows > .fld > label em { display: block; font-weight: 400; }
.cb-rows > .fld > :not(label) { grid-column: 2; }
.cb-rows > .fld > input:not([type=checkbox]), .cb-rows > .fld > select, .cb-rows > .fld > textarea { max-width: 420px; }
.cb-rows > .fld[hidden] { display: none; }
@media (max-width: 640px) { .cb-rows > .fld { grid-template-columns: minmax(0, 1fr); } .cb-rows > .fld > label { grid-row: auto; padding-top: 0; } }
/* hours as buttons */
.hr-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; max-width: 520px; }
.hr-b { padding: 5px 0; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); color: var(--ink-2); font: 600 11.5px var(--mono, "IBM Plex Mono", monospace); cursor: pointer; }
.hr-b[aria-pressed="true"] { background: var(--late-wash); border-color: var(--late); color: var(--late); text-decoration: line-through; }

.gt-range { width: 140px; accent-color: var(--brand); }
.gt-win { font-size: 12px; color: var(--brand-2); white-space: nowrap; }

/* Denser desk tabs: one row each — icon, name and code, who is on it, the count, claim — smaller and closer together */
.desktabs { gap: 6px; margin-bottom: 8px; align-items: stretch; }
.desktab { flex-direction: row; align-items: center; gap: 8px; min-width: 0; padding: 5px 9px 4px; border-bottom-width: 2px; border-radius: 8px; }
.desktab .dt-link { display: flex; align-items: center; gap: 8px; }
.desktab .dt-name { font-size: 12.5px; gap: 5px; align-items: center; white-space: nowrap; }
.desktab .dt-short { font-size: 9.5px; }
.desktab .dt-meta { gap: 5px; justify-content: flex-start; }
.desktab .pill { padding: 1px 7px; font-size: 11px; }
.desktab .dt-claims { padding: 0 6px; font-size: 10.5px; }
.desktab .dt-closed { font-size: 9px; margin-left: 2px; }
.desktab .dt-claim .btn { padding: 2px 9px; font-size: 11.5px; }
.desktab span.dt-claim { font-size: 11px; max-width: 240px; line-height: 1.25; }
@media (max-width: 560px) { .desktab { flex: 1 1 100%; } }

/* Display: the open checks of chosen desks, large, a column per desk — for a screen on the wall */
.dp-pickbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.dp { display: flex; flex-direction: column; gap: 10px; height: calc(100vh - 170px); min-height: 420px; }
.dp:fullscreen { height: 100vh; padding: 18px 22px; background: var(--ground); font-size: 115%; }
.dp-top { display: flex; align-items: baseline; gap: 12px; }
.dp-clock { font: 700 28px var(--mono, "IBM Plex Mono", monospace); }
.dp:fullscreen .dp-clock { font-size: 40px; }
.dp-date { color: var(--ink-2); font-weight: 600; }
#dpGrid { flex: 1 1 auto; min-height: 0; }
.dp-grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 12px; height: 100%; }
.dp-col { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.dp-head { padding: 10px 14px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.dp-name { font-size: 1.15em; font-weight: 800; }
.dp-short { font-size: 11px; color: var(--ink-3); }
.dp-counts { display: flex; gap: 6px; flex-wrap: wrap; }
.dp-n { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--raise); color: var(--ink-2); }
.dp-n.late { background: var(--late-wash); color: var(--late); }
.dp-n.issue { background: var(--issue-wash); color: var(--issue); }
.dp-n.soon { background: var(--now-wash); color: var(--brand-2); }
.dp-who { font-size: 12px; color: var(--ink-3); }
.dp-list { flex: 1 1 auto; min-height: 0; overflow: hidden; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.dp-card { padding: 8px 11px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); border-left: 5px solid var(--line-2); }
.dp-card.b-late, .dp-card.b-esc { border-left-color: var(--late); background: var(--late-wash); }
.dp-card.b-issue { border-left-color: var(--issue); background: var(--issue-wash); }
.dp-card.b-hour { border-left-color: var(--now); }
.dp-card.b-out { border-left-color: var(--next); }
.dp-when { font-size: 12px; font-weight: 800; color: var(--ink-2); }
.dp-card.b-late .dp-when, .dp-card.b-esc .dp-when { color: var(--late); }
.dp-title { font-size: 1.05em; font-weight: 700; line-height: 1.3; }
.dp-meta { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.dp-bar { height: 4px; border-radius: 2px; background: var(--line); margin-top: 5px; overflow: hidden; }
.dp-bar i { display: block; height: 100%; background: var(--done); }
.dp-empty { padding: 20px; text-align: center; color: var(--done); font-weight: 700; }
.dp-more { padding: 6px 12px 10px; font-size: 12px; font-weight: 700; color: var(--ink-2); text-align: center; }
@media (max-width: 760px) { .dp { height: auto; } .dp-grid { grid-template-columns: minmax(0, 1fr); } .dp-list { max-height: 60vh; } }

/* the selected desk's bar under the desk tabs: its tools, then paper and display */
.deskbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 5px 8px; margin: -2px 0 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.deskbar-lab { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); margin-right: 2px; }
.deskbar .btn { padding: 3px 10px; font-size: 12px; }
body.fixed-app > main.wrap > .deskbar { flex: 0 0 auto; }

.dp-n.done { background: var(--done-wash); color: var(--done); }

/* The check, for the person doing it: how it stands in plain words, who has it, one time line; then the work */
.cd-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cd-status form { display: inline; }
.cd-words { font-size: 12.5px; padding: 3px 10px; text-transform: none; letter-spacing: 0; }
.cd-top .dtitle { margin-top: 6px; }
.cd-tl { position: relative; height: 40px; margin: 12px 4px 2px; }
.cd-tl-track { position: absolute; top: 20px; left: 0; right: 0; height: 6px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); }
.cd-tl-seg { position: absolute; top: 21px; height: 5px; }
.cd-tl-seg.ok { background: color-mix(in srgb, var(--done) 45%, transparent); }
.cd-tl-seg.late { background: color-mix(in srgb, var(--late) 30%, transparent); }
.cd-tl-lab { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; color: var(--ink-2); white-space: nowrap; }
.cd-tl-lab.due { font-weight: 700; color: var(--ink); }
.cd-tl-lab.exp { color: var(--late); }
.cd-tl-now { position: absolute; top: 14px; width: 2px; height: 18px; margin-left: -1px; background: var(--brand); }
.cd-tl-now i { position: absolute; top: 19px; left: 50%; transform: translateX(-50%); font: 700 10px var(--mono, "IBM Plex Mono", monospace); color: var(--brand-2); font-style: normal; }
.cd-finish { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.cd-finish form { display: inline; }
.cd-kinds { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 8px; }
.cd-kind input { position: absolute; opacity: 0; pointer-events: none; }
.cd-kind span { display: inline-block; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.cd-kind input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.cd-kind input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.cd-fold > summary { cursor: pointer; list-style: none; }
.cd-fold > summary::-webkit-details-marker { display: none; }
.cd-fold > summary::after { content: ' ▾'; color: var(--ink-3); }
.cd-fold[open] > summary::after { content: ' ▴'; }
.tkhide { display: inline-flex; align-items: center; }
.tkhide > summary { list-style: none; cursor: pointer; font-size: 11px; color: var(--ink-3); padding: 0 4px; white-space: nowrap; }
.tkhide > summary::-webkit-details-marker { display: none; }
.tkhide[open] > summary { display: none; }
.noteitem.auto { font-size: 12px; color: var(--ink-2); }

/* search: the due time first; the window's start small under it */
.sr-t .sr-from { display: block; font-size: 10px; font-weight: 500; color: var(--ink-3); white-space: nowrap; }

/* day view: the day on the left, the clicked check on the right */
.day-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 440px); gap: 12px; align-items: start; }
.day-split > .day-detail { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; margin: 0; }
.day-split tr.is-current > td { background: var(--brand-wash); }
@media (max-width: 1000px) { .day-split { grid-template-columns: minmax(0, 1fr); } .day-split > .day-detail { position: static; max-height: none; } }

/* if / else steps as cards (repeating check editor, and read only on a check) */
.sf-step .fx-ic { background: var(--surface-2); }
.fx-card.sf-done { border-color: color-mix(in srgb, var(--done) 50%, var(--line-2)); }
.fx-card.sf-done .fx-ic { background: var(--done-wash); color: var(--done); }
.fx-card.sf-current { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }
.fx-branch.sf-dim { opacity: .45; }
.sf-view .fx-card { width: min(380px, 100%); }
.sf-view .fx-head { cursor: default; }
.sf-loose { margin-top: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* the display in fullscreen: the logo square left of the clock, catching the light like in the header — no name */
.dp-logo { display: none; position: relative; overflow: hidden; isolation: isolate; border-radius: 8px; align-self: center; }
.dp:fullscreen .dp-logo { display: inline-block; }
.dp-logo .mark { width: 44px; height: 44px; border-radius: 8px; animation: nn-mark-glow 6.5s ease-in-out 1.2s infinite; }
.dp-logo::after {
  content: ""; position: absolute; top: -40%; bottom: -40%; left: -40%; width: 18px; pointer-events: none; z-index: 1;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75) 45%, rgba(255, 255, 255, .95) 50%, rgba(255, 255, 255, .75) 55%, transparent);
  transform: skewX(-22deg); opacity: .85; animation: nn-glare 6.5s ease-in-out 1.2s infinite;
}
.dp:fullscreen .dp-top { align-items: center; }
@media (prefers-reduced-motion: reduce) { .dp-logo .mark { animation: none; } .dp-logo::after { display: none; } }

/* Admin → Mail: a light per thing that must be in place */
.ml-status { display: grid; gap: 7px; }
.ml-row { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; }
.ml-row > span:last-child { display: grid; gap: 1px; min-width: 0; overflow-wrap: anywhere; }
.ml-dot { flex: 0 0 10px; height: 10px; border-radius: 50%; margin-top: 4px; background: var(--line-2); }
.ml-dot.ok { background: var(--done); }
.ml-dot.bad { background: var(--late); }

/* the display's own sound controls */
.dp-sound { display: inline-flex; align-items: center; gap: 6px; }
.dp-sound input[type=range] { width: 90px; accent-color: var(--brand); }

/* a card's own cards: the conditions on each secondary event */
.fx-where { width: 100%; border-left: 2px solid var(--line-2); padding-left: 10px; margin-top: 6px; display: flex; flex-direction: column; align-items: center; }
.fx-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 4px; }
.fx-chip { font-size: 11px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-family: inherit; }
.fx-chip:hover { border-color: var(--brand); }

/* the Checks section: its tabs, and the "+ New check" chooser */
.ck-tabs { margin: 0 0 10px; }
.panel.ck .ck-tabs { margin: 0 0 6px; }
.ck-new { position: relative; }
.ck-new summary { list-style: none; cursor: pointer; }
.ck-new summary::-webkit-details-marker { display: none; }
.ck-newmenu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 300px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 6px; display: flex; flex-direction: column; }
.ck-newmenu a { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 7px; text-decoration: none; color: inherit; }
.ck-newmenu a:hover { background: var(--wash, rgba(127,127,127,.12)); }
.ck-newmenu a small { color: var(--ink-3); font-size: 11.5px; }

/* API cards (Admin → APIs): one row per call, cards left to right */
.apc { display: grid; gap: 10px; }
.apc-row { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: var(--surface-2); }
.apc-row.apc-off { opacity: .55; }
.apc-line { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }
.apc-card { width: min(300px, 100%); flex: 1 1 200px; }
.apc-card .fx-t { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.apc-arrow { color: var(--ink-3); align-self: center; font-size: 14px; }
.apc-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.apc-add { padding-top: 4px; }
.apc-f { display: grid; gap: 3px; margin-top: 8px; }
.apc-f input, .apc-f select { width: 100%; }
