/* ELN Studio — Today and Plan.
 *
 * Calm, flat, one quiet accent. Colour says what kind of thing it is (or which
 * project, or what stage); its SHAPE says the stage, so nothing depends on
 * telling two colours apart: dashed = planned, filled = in progress, amber
 * corner = in review, lock = signed.
 *
 * Class names avoid the substrings the app-colour theme layer repaints
 * (-calendar, -controls, -section, -card, -panel, -modal, -legend, -popover,
 * -empty, -note, -hint, -btn, -chip, -pill …); tests/eln-plan-css.test.mjs
 * keeps it that way.
 */

.eln-pl, .eln-td {
  --pl-c0: #2f5d9e; /* navy blue   */
  --pl-c1: #5b7fa6; /* steel       */
  --pl-c2: #2f8f83; /* teal        */
  --pl-c3: #b9770e; /* amber       */
  --pl-c4: #3f8f5a; /* green       */
  --pl-c5: #7b5fa8; /* violet      */
  --pl-c6: #7a828f; /* grey        */
  --pl-c7: #8b95a5; /* slate       */
  --pl-line: var(--eln-line, #e2e8f0);
  --pl-line-soft: color-mix(in srgb, var(--pl-line) 55%, transparent);
  --pl-text: var(--eln-text, #0f172a);
  --pl-muted: var(--eln-muted, #64748b);
  --pl-surface: var(--eln-surface, #fff);
  --pl-subtle: var(--eln-surface-subtle, #f8fafc);
  --pl-accent: var(--eln-blue, #00376e);
  --pl-today: color-mix(in srgb, var(--pl-accent) 7%, var(--pl-surface));
  --pl-over: #c0392b;
  color: var(--pl-text);
}
.dark .eln-pl, .dark .eln-td {
  --pl-c0: #6b9be0; --pl-c1: #8aa8cc; --pl-c2: #52b8a9; --pl-c3: #e0a84a;
  --pl-c4: #6cc08a; --pl-c5: #a58ad4; --pl-c6: #a2a9b5; --pl-c7: #9aa4b4;
  --pl-over: #ef7b6e;
}

.eln-pl-c0 { --c: var(--pl-c0); } .eln-pl-c1 { --c: var(--pl-c1); } .eln-pl-c2 { --c: var(--pl-c2); } .eln-pl-c3 { --c: var(--pl-c3); }
.eln-pl-c4 { --c: var(--pl-c4); } .eln-pl-c5 { --c: var(--pl-c5); } .eln-pl-c6 { --c: var(--pl-c6); } .eln-pl-c7 { --c: var(--pl-c7); }

/* ---- an item on the calendar ------------------------------------------------------------ */

.eln-pl-evt {
  position: relative; display: flex; align-items: baseline; gap: 6px; min-width: 0;
  padding: 2px 7px 2px 8px; border-radius: 6px; font-size: 12px; line-height: 1.35; cursor: pointer;
  color: color-mix(in srgb, var(--c, var(--pl-c7)) 62%, var(--pl-text));
  background: color-mix(in srgb, var(--c, var(--pl-c7)) 15%, var(--pl-surface));
  border: 1px solid color-mix(in srgb, var(--c, var(--pl-c7)) 30%, transparent);
  border-left: 3px solid var(--c, var(--pl-c7));
  overflow: hidden; user-select: none; box-sizing: border-box;
}
.eln-pl-evt:hover { background: color-mix(in srgb, var(--c, var(--pl-c7)) 24%, var(--pl-surface)); }
.eln-pl-evt:focus-visible { outline: 2px solid var(--pl-accent); outline-offset: 1px; }
.eln-pl-evt.is-dragging { opacity: .35; }
.eln-pl-evt.is-fixed { cursor: default; }
.eln-pl-evt-time { font-size: 11px; opacity: .85; white-space: nowrap; font-variant-numeric: tabular-nums; }
.eln-pl-evt-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.eln-pl-evt.is-continued { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-width: 1px; }
.eln-pl-evt.is-continues { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.eln-pl-lock { display: inline-flex; align-items: center; opacity: .8; }

/* The stage, as a shape. */
.eln-pl-st-planned { border-style: dashed; border-left-style: solid; background: color-mix(in srgb, var(--c, var(--pl-c7)) 5%, var(--pl-surface)); }
.eln-pl-st-pending { border-style: dashed; border-left-style: solid; }
.eln-pl-st-review::after { content: ""; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 10px 10px 0; border-color: transparent var(--pl-c3) transparent transparent; }
.eln-pl-st-signed { background: color-mix(in srgb, var(--c, var(--pl-c7)) 24%, var(--pl-surface)); }
.eln-pl-evt.is-overdue { box-shadow: inset 0 -2px 0 var(--pl-over); }

/* Dragging */
body.eln-pl-dragging { cursor: grabbing; user-select: none; }
.eln-pl-ghost {
  position: fixed; left: 0; top: 0; z-index: 10050; pointer-events: none; padding: 4px 10px;
  background: var(--eln-blue, #00376e); color: #fff; border-radius: 7px; font-size: 12px; font-weight: 600;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .25); max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.is-drop-over { outline: 2px solid var(--eln-blue, #00376e); outline-offset: -2px; background: color-mix(in srgb, var(--eln-blue, #00376e) 9%, transparent) !important; }
.eln-pl-dropline { position: absolute; left: 0; right: 0; height: 2px; background: var(--eln-blue, #00376e); z-index: 6; pointer-events: none; }
.eln-pl-dropline span {
  position: absolute; left: 2px; top: -9px; padding: 0 5px; font-size: 10px; font-weight: 700; color: #fff;
  background: var(--eln-blue, #00376e); border-radius: 4px; font-variant-numeric: tabular-nums;
}

/* ---- Plan: frame ------------------------------------------------------------------------------ */

.eln-pl { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 0; width: 100%; background: var(--pl-surface); }
.eln-pl-head {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px;
  padding: 10px 16px; border-bottom: 1px solid var(--pl-line);
}
.eln-pl-nav { display: flex; align-items: center; gap: 6px; }
.eln-pl-titlewrap { margin: 0 0 0 4px; font-size: 16px; }
.eln-pl-title { all: unset; box-sizing: border-box; cursor: pointer; padding: 3px 8px; border-radius: 7px; font-size: 16px; font-weight: 650; letter-spacing: -.01em; color: var(--pl-text); }
.eln-pl-title:hover, .eln-pl-title[aria-expanded="true"] { background: var(--pl-subtle); }
.eln-pl-title:focus-visible { outline: 2px solid var(--pl-accent); outline-offset: 1px; }
.eln-pl-tools { display: flex; align-items: center; gap: 6px; }
.eln-pl-viewtog, .eln-pl-addtog {
  all: unset; box-sizing: border-box; cursor: pointer; padding: 5px 12px; font-size: 12.5px; border: 1px solid var(--pl-line); border-radius: 8px;
  background: var(--pl-surface); color: var(--pl-text); white-space: nowrap;
}
.eln-pl-viewtog:hover, .eln-pl-addtog:hover { background: var(--pl-subtle); }
.eln-pl-viewtog[aria-expanded="true"], .eln-pl-addtog[aria-expanded="true"] { border-color: var(--pl-accent); color: var(--pl-accent); background: color-mix(in srgb, var(--pl-accent) 8%, var(--pl-surface)); font-weight: 600; }
.eln-pl-viewtog:focus-visible, .eln-pl-addtog:focus-visible { outline: 2px solid var(--pl-accent); outline-offset: 1px; }
.eln-pl-switch { display: inline-flex; border: 1px solid var(--pl-line); border-radius: 8px; overflow: hidden; }
.eln-pl-switch button { all: unset; box-sizing: border-box; cursor: pointer; padding: 5px 12px; font-size: 12.5px; color: var(--pl-muted); }
.eln-pl-switch button + button { border-left: 1px solid var(--pl-line); }
.eln-pl-switch button:hover { background: var(--pl-subtle); }
.eln-pl-switch button.is-on { background: var(--pl-accent); color: #fff; }
.eln-pl-switch button:focus-visible { outline: 2px solid var(--pl-accent); outline-offset: -2px; }
.eln-pl-colour { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--pl-muted); }
.eln-pl-colour select { font-size: 12.5px; padding: 4px 6px; border: 1px solid var(--pl-line); border-radius: 6px; background: var(--pl-surface); color: var(--pl-text); }

.eln-pl-body { position: relative; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.eln-pl-body > .eln-pl-main { flex: 1; }
.eln-pl-rail { overflow: auto; padding: 12px; border-right: 1px solid var(--pl-line); display: flex; flex-direction: column; gap: 16px; background: var(--pl-subtle); }
.eln-pl-rail h3 { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--pl-muted); font-weight: 650; }
.eln-pl-main { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.eln-pl-tip { margin: 0 0 6px; font-size: 11.5px; color: var(--pl-muted); line-height: 1.4; }
.eln-pl-nothing { margin: 0; padding: 40px 24px; text-align: center; color: var(--pl-muted); font-size: 13px; }
.eln-pl-nothing.is-floating { position: absolute; left: 0; right: 0; top: 96px; padding: 0 24px; pointer-events: none; }

/* ---- the small calendar --------------------------------------------------------------------------- */

.eln-pl-mini { background: var(--pl-surface); border: 1px solid var(--pl-line); border-radius: 10px; padding: 8px; }
.eln-pl-mini-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.eln-pl-mini-label { font-size: 12.5px; font-weight: 650; }
.eln-pl-mini-step { all: unset; cursor: pointer; width: 24px; height: 24px; text-align: center; line-height: 22px; border-radius: 6px; color: var(--pl-muted); font-size: 16px; }
.eln-pl-mini-step:hover { background: var(--pl-subtle); color: var(--pl-text); }
.eln-pl-mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.eln-pl-mini-dow { text-align: center; font-size: 10px; color: var(--pl-muted); padding: 2px 0; }
.eln-pl-mini-day {
  all: unset; box-sizing: border-box; cursor: pointer; position: relative; height: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 11.5px; border-radius: 6px; font-variant-numeric: tabular-nums;
}
.eln-pl-mini-day:hover { background: var(--pl-subtle); }
.eln-pl-mini-day:focus-visible { outline: 2px solid var(--pl-accent); outline-offset: -2px; }
.eln-pl-mini-day.is-outside { color: var(--pl-muted); opacity: .55; }
.eln-pl-mini-day.is-today { font-weight: 800; color: var(--pl-accent); }
.eln-pl-mini-day.is-selected { background: var(--pl-accent); color: #fff; }
.eln-pl-dots { position: absolute; bottom: 3px; display: flex; gap: 2px; }
.eln-pl-dots::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .55; box-shadow: 0 0 currentColor; }
.eln-pl-dots[data-level="2"]::before { width: 10px; border-radius: 3px; }
.eln-pl-dots[data-level="3"]::before { width: 16px; border-radius: 3px; opacity: .8; }

/* ---- the template tray and key ------------------------------------------------------------------------ */

.eln-pl-tpl {
  all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 8px; width: 100%; cursor: grab;
  padding: 6px 8px; margin-bottom: 4px; font-size: 12.5px; border: 1px solid var(--pl-line); border-radius: 7px; background: var(--pl-surface);
}
.eln-pl-tpl::before { content: "⋮⋮"; color: var(--pl-muted); font-size: 11px; letter-spacing: -2px; }
.eln-pl-tpl:hover { border-color: var(--pl-accent); }
.eln-pl-tpl:focus-visible { outline: 2px solid var(--pl-accent); outline-offset: 1px; }
.eln-pl-tpl:active { cursor: grabbing; }
.eln-pl-key-row { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 2px 0; }
.eln-pl-swatch { width: 14px; height: 14px; border-radius: 4px; background: color-mix(in srgb, var(--c, var(--pl-c7)) 22%, var(--pl-surface)); border: 1px solid var(--c, var(--pl-c7)); border-left-width: 3px; box-sizing: border-box; flex: none; }
.eln-pl-layers label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 2px 0; cursor: pointer; }

/* ---- week and day: the time grid ---------------------------------------------------------------------------- */

.eln-pl-sched { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.eln-pl-sched-head, .eln-pl-alldayrow { display: grid; flex: none; border-bottom: 1px solid var(--pl-line); overflow: hidden; }
.eln-pl-colhead {
  all: unset; box-sizing: border-box; cursor: pointer; padding: 6px 8px; display: flex; flex-direction: column; gap: 1px;
  border-left: 1px solid var(--pl-line-soft); overflow: hidden;
}
.eln-pl-colhead strong { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--pl-muted); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.eln-pl-colhead small { font-size: 18px; font-weight: 650; line-height: 1.1; }
.eln-pl-colhead:hover { background: var(--pl-subtle); }
.eln-pl-colhead.is-today strong { color: var(--pl-accent); }
.eln-pl-colhead.is-today small { color: var(--pl-accent); }
.eln-pl-corner { font-size: 10px; color: var(--pl-muted); padding: 4px; display: flex; align-items: flex-end; justify-content: flex-end; }
.eln-pl-allday { display: flex; flex-direction: column; gap: 2px; min-height: 30px; padding: 3px; border-left: 1px solid var(--pl-line-soft); }
.eln-pl-allday .eln-pl-evt { position: static; }
.eln-pl-allday.is-today, .eln-pl-slotcol.is-today { background: var(--pl-today); }
.eln-pl-scroll { flex: 1; min-height: 0; overflow: auto; position: relative; }
.eln-pl-timebody { position: relative; display: grid; }
.eln-pl-hours { position: relative; }
.eln-pl-hour { position: absolute; right: 6px; transform: translateY(-50%); font-size: 10px; color: var(--pl-muted); font-variant-numeric: tabular-nums; }
.eln-pl-slotcol {
  position: relative; border-left: 1px solid var(--pl-line-soft);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 47px, var(--pl-line-soft) 47px, var(--pl-line-soft) 48px);
}
.eln-pl-slotcol.is-weekend, .eln-pl-colhead.is-weekend { background-color: color-mix(in srgb, var(--pl-subtle) 70%, transparent); }
.eln-pl-slotcol .eln-pl-evt { position: absolute; flex-direction: column; align-items: stretch; gap: 0; padding-top: 3px; z-index: 2; }
.eln-pl-slotcol .eln-pl-evt .eln-pl-evt-title { white-space: normal; overflow: hidden; }
.eln-pl-nowline { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--pl-over); z-index: 4; pointer-events: none; }
.eln-pl-nowline::before { content: ""; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--pl-over); }
.eln-pl-busy {
  position: absolute; left: 2px; right: 2px; z-index: 1; border-radius: 5px; overflow: hidden; pointer-events: none;
  background: color-mix(in srgb, var(--pl-c6) 20%, transparent); border: 1px dashed color-mix(in srgb, var(--pl-c6) 55%, transparent);
  font-size: 10.5px; color: var(--pl-muted); padding: 1px 5px;
}

/* ---- month --------------------------------------------------------------------------------------------------- */

.eln-pl-month { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.eln-pl-dowrow { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--pl-line); flex: none; }
.eln-pl-dow { padding: 6px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--pl-muted); }
.eln-pl-weeks { flex: 1; min-height: 0; display: grid; grid-template-rows: repeat(6, minmax(0, 1fr)); }
.eln-pl-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-height: 0; }
.eln-pl-mday { border-left: 1px solid var(--pl-line-soft); border-bottom: 1px solid var(--pl-line-soft); padding: 3px; display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow: hidden; }
.eln-pl-mday.is-outside { background: var(--pl-subtle); }
.eln-pl-mday.is-outside .eln-pl-daynum { opacity: .5; }
.eln-pl-mday.is-today { background: var(--pl-today); }
.eln-pl-daynum { all: unset; cursor: pointer; align-self: flex-start; font-size: 12px; font-weight: 600; padding: 1px 5px; border-radius: 10px; }
.eln-pl-mday.is-today .eln-pl-daynum { background: var(--pl-accent); color: #fff; }
.eln-pl-daynum:hover { background: var(--pl-subtle); }
.eln-pl-more { all: unset; cursor: pointer; font-size: 11px; color: var(--pl-muted); padding: 0 4px; }
.eln-pl-more:hover { color: var(--pl-accent); text-decoration: underline; }
.eln-pl-mday .eln-pl-evt { padding-top: 1px; padding-bottom: 1px; }

/* ---- timeline of experiments ---------------------------------------------------------------------------------------- */

.eln-pl-tl { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: auto; }
.eln-pl-tl-axis, .eln-pl-tl-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); flex: none; }
.eln-pl-tl-axis { position: sticky; top: 0; z-index: 3; background: var(--pl-surface); border-bottom: 1px solid var(--pl-line); }
.eln-pl-tl-track { position: relative; display: grid; grid-template-columns: repeat(28, minmax(0, 1fr)); min-height: 74px; }
.eln-pl-tl-axis .eln-pl-tl-track { min-height: 40px; }
.eln-pl-tl-day { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; border-left: 1px solid var(--pl-line-soft); }
.eln-pl-tl-day small { color: var(--pl-muted); font-size: 9.5px; }
.eln-pl-tl-day.is-today strong { color: #fff; background: var(--pl-accent); border-radius: 9px; padding: 0 5px; }
.eln-pl-tl-day.is-weekend, .eln-pl-tl-cell.is-weekend { background: color-mix(in srgb, var(--pl-subtle) 80%, transparent); }
.eln-pl-tl-cell { border-left: 1px solid var(--pl-line-soft); }
.eln-pl-tl-cell.is-today { background: var(--pl-today); }
.eln-pl-tl-body { display: flex; flex-direction: column; }
.eln-pl-tl-row { border-bottom: 1px solid var(--pl-line-soft); }
.eln-pl-tl-name { all: unset; box-sizing: border-box; padding: 8px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
div.eln-pl-tl-name { cursor: default; color: var(--pl-muted); font-weight: 500; }
button.eln-pl-tl-name:hover { color: var(--pl-accent); }
.eln-pl-tl-track > .eln-pl-bar { position: absolute; top: 8px; height: 26px; z-index: 2; }
.eln-pl-tl-track > .eln-pl-step { position: absolute; top: 40px; height: 22px; z-index: 2; padding: 0 4px; }
.eln-pl-tl-track > .eln-pl-evt:not(.eln-pl-bar):not(.eln-pl-step) { position: absolute; top: 8px; height: 22px; z-index: 2; }
.eln-pl-tick { position: absolute; bottom: 2px; height: 5px; background: var(--pl-c2); opacity: .7; border-radius: 3px; margin: 0 6px; box-sizing: border-box; }

/* ---- the card that opens on click ---------------------------------------------------------------------------------------- */

.eln-pl-peek {
  position: fixed; z-index: 10040; width: 340px; max-width: calc(100vw - 16px); box-sizing: border-box; padding: 12px 14px;
  background: var(--eln-surface, #fff); color: var(--eln-text, #0f172a); border: 1px solid var(--eln-line, #e2e8f0); border-radius: 12px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, .2); font-size: 12.5px; outline: none;
}
.eln-pl-peek-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.eln-pl-peek-title strong { font-size: 14px; line-height: 1.3; }
.eln-pl-peek-phase { flex: none; font-size: 10.5px; padding: 1px 7px; border-radius: 9px; background: color-mix(in srgb, var(--pl-c7, #8b95a5) 20%, transparent); color: var(--eln-muted, #64748b); }
.eln-pl-peek-row { display: flex; gap: 10px; padding: 2px 0; }
.eln-pl-peek-row span { width: 70px; color: var(--eln-muted, #64748b); flex: none; }
.eln-pl-peek-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.eln-pl-peek-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--eln-line, #e2e8f0); }
.eln-pl-peek-form label { width: 100%; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--eln-muted, #64748b); }
.eln-pl-peek-form input, .eln-pl-peek-form select { font-size: 12px; padding: 3px 5px; max-width: 120px; }

/* ---- Today --------------------------------------------------------------------------------------------------------------------- */

.eln-td { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; padding: 4px 0 16px; }
.eln-td-side, .eln-td-main, .eln-td-aside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.eln-td-side .eln-pl-tray h3, .eln-td-block h3, .eln-td-needs h3 {
  margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--pl-muted); font-weight: 650;
  display: flex; align-items: center; gap: 8px;
}
.eln-td-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.eln-td-title-acts { display: flex; gap: 8px; flex: none; }
.eln-td-title h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.eln-td-title p { margin: 2px 0 0; color: var(--pl-muted); font-size: 13px; }
.eln-td-block { background: var(--pl-surface); border: 1px solid var(--pl-line); border-radius: 12px; padding: 14px; }
.eln-td-rows { display: flex; flex-direction: column; gap: 4px; }
.eln-td-row {
  all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; padding: 7px 10px; cursor: pointer; border-radius: 8px;
  border-left: 3px solid var(--c, var(--pl-line)); background: color-mix(in srgb, var(--c, var(--pl-c7)) 6%, var(--pl-surface));
}
.eln-td-row:hover { background: color-mix(in srgb, var(--c, var(--pl-c7)) 14%, var(--pl-surface)); }
.eln-td-row:focus-visible { outline: 2px solid var(--pl-accent); outline-offset: 1px; }
.eln-td-row.eln-pl-st-planned { border-left-style: dashed; }
.eln-td-row.is-overdue { box-shadow: inset 0 -2px 0 var(--pl-over); }
.eln-td-row.is-dragging { opacity: .35; }
.eln-td-when { width: 64px; flex: none; font-size: 12px; color: var(--pl-muted); font-variant-numeric: tabular-nums; }
.eln-td-what { display: flex; flex-direction: column; min-width: 0; }
.eln-td-what strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eln-td-what small { font-size: 11.5px; color: var(--pl-muted); }
.eln-td-next { margin-left: auto; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--pl-accent); font-size: 12px; }
.eln-td-link { all: unset; cursor: pointer; margin-left: auto; text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--pl-accent); }
.eln-td-link:hover { text-decoration: underline; }
.eln-td-calm { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--pl-muted); font-size: 13px; padding: 4px 0; }
.eln-td-error { margin: 0; color: var(--pl-over); font-size: 13px; }

.eln-td-needs { background: var(--pl-surface); border: 1px solid var(--pl-line); border-radius: 12px; padding: 14px; position: sticky; top: 0; }
.eln-td-count { background: var(--pl-accent); color: #fff; font-size: 10.5px; border-radius: 9px; padding: 0 7px; text-transform: none; letter-spacing: 0; }
.eln-td-need-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.eln-td-need { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 4px 8px; padding-bottom: 10px; border-bottom: 1px solid var(--pl-line-soft); }
.eln-td-need:last-child { border-bottom: 0; padding-bottom: 0; }
.eln-td-need-mark { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--pl-c3) 18%, transparent); color: var(--pl-c3); font-size: 12px; }
.eln-td-need[data-kind="witness"] .eln-td-need-mark { background: color-mix(in srgb, var(--pl-c0) 16%, transparent); color: var(--pl-c0); }
.eln-td-need-text { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.eln-td-need-text strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eln-td-need-text small { font-size: 11.5px; color: var(--pl-muted); }
.eln-td-quote { font-style: italic; }
.eln-td-need-acts { grid-column: 2; display: flex; gap: 6px; margin-top: 4px; }

@container eln-studio (max-width: 1180px) {
  .eln-td { grid-template-columns: 220px minmax(0, 1fr); }
  .eln-td-needs { grid-column: 1 / -1; position: static; order: -1; }
}
@container eln-studio (max-width: 760px) {
  .eln-td { grid-template-columns: minmax(0, 1fr); }
  .eln-pl-body { grid-template-columns: minmax(0, 1fr); }
  .eln-pl-rail { max-height: 200px; border-right: 0; border-bottom: 1px solid var(--pl-line); flex-direction: row; flex-wrap: wrap; }
  .eln-pl-rail > * { flex: 1 1 220px; }
}

@media (prefers-reduced-motion: reduce) { .eln-pl *, .eln-td * { transition: none !important; } }

/* ---- Home becomes Today: a compact top, then the day ------------------------------------------------------------------------------------------ */

.eln-studio-root .eln-home-workspace.eln-home-today { max-width: 1480px; display: flex; flex-direction: column; gap: 14px; }
.eln-studio-root .eln-home-workspace.eln-home-today > * { flex: none; }
.eln-studio-root .eln-home-today .eln-home-hero { padding: 12px 16px; border-radius: 12px; }
.eln-studio-root .eln-home-today .eln-home-hero-top { gap: 16px; }
.eln-studio-root .eln-home-today .eln-home-hero h1 { font-size: 18px; letter-spacing: -.015em; line-height: 1.2; }
.eln-studio-root .eln-home-today .eln-home-hero-copy > p { display: none; }
.eln-studio-root .eln-home-today .eln-home-eyebrow { margin-bottom: 2px; }
.eln-studio-root .eln-home-today .eln-home-search-shell { margin-top: 10px; }
.eln-studio-root .eln-home-today .eln-home-context-note { margin-top: 8px; }
.eln-studio-root .eln-home-today .eln-home-library { margin: 0; }
.eln-home-today-host { min-width: 0; }

/* ---- the day-before check ------------------------------------------------------------------------------------------------------------- */

.eln-pf { margin: 0 0 12px; border: 1px solid var(--pl-line, #e2e8f0); border-radius: 10px; background: var(--pl-surface, #fff); overflow: hidden; }
.eln-pf-loading { margin: 0; padding: 10px 12px; font-size: 12.5px; color: var(--pl-muted, #64748b); }
.eln-pf-head { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; cursor: pointer; }
.eln-pf-head:hover { background: var(--pl-subtle, #f8fafc); }
.eln-pf-head:focus-visible { outline: 2px solid var(--pl-accent, #00376e); outline-offset: -2px; }
.eln-pf-title { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.eln-pf-title small { color: var(--pl-muted, #64748b); font-size: 11.5px; }
.eln-pf-count { font-size: 12px; color: var(--pl-muted, #64748b); }
.eln-pf-mark { flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; background: color-mix(in srgb, var(--pf, #8b95a5) 18%, transparent); color: var(--pf, #8b95a5); border: 1px solid color-mix(in srgb, var(--pf, #8b95a5) 40%, transparent); }
.eln-pf-ok { --pf: #3f8f5a; } .eln-pf-warn { --pf: #b9770e; } .eln-pf-fail { --pf: #c0392b; } .eln-pf-unknown { --pf: #7a828f; }
.eln-pf-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--pl-line, #e2e8f0); }
.eln-pf-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 9px 12px; border-bottom: 1px solid var(--pl-line-soft, #eef2f7); }
.eln-pf-row p { margin: 2px 0 0; font-size: 12.5px; color: var(--pl-muted, #64748b); line-height: 1.45; }
.eln-pf-row strong { font-size: 13px; }
.eln-pf-foot { padding: 6px 12px; }
.eln-td-row .eln-pf-mark { margin-left: auto; }
.eln-pl-peek-days { display: inline-flex; gap: 4px; width: 100%; font-size: 11px; }
.eln-pl-peek-days label { display: inline-flex; flex-direction: column; align-items: center; width: auto; font-size: 10.5px; text-transform: none; letter-spacing: 0; }

/* ---- help with the scientific record -------------------------------------------------------------------------------------------------- */

.eln-science-assist { display: grid; gap: 10px; margin: 0 0 12px; }
.eln-science-fills, .eln-science-checks { border: 1px solid var(--pl-line, #e2e8f0); border-radius: 10px; padding: 10px 12px; background: var(--pl-subtle, #f8fafc); }
.eln-science-fills p { margin: 2px 0 8px; font-size: 12px; color: var(--pl-muted, #64748b); }
.eln-science-fill { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid var(--pl-line-soft, #eef2f7); }
.eln-science-fill span { display: flex; flex-direction: column; min-width: 0; }
.eln-science-fill small { color: var(--pl-muted, #64748b); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eln-science-checks { background: color-mix(in srgb, #b9770e 8%, var(--pl-surface, #fff)); border-color: color-mix(in srgb, #b9770e 35%, transparent); }
.eln-science-checks p { margin: 4px 0 0; font-size: 12.5px; display: flex; gap: 8px; }
.eln-science-checks p span { flex: none; width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 800; background: #b9770e; color: #fff; }

.eln-pl-reagents-list { margin-top: 6px; }
.eln-pl-reagents-list .eln-pl-tpl { cursor: grab; }
.eln-pl-reagents-list .eln-pl-tpl span { display: flex; flex-direction: column; min-width: 0; }
.eln-pl-reagents-list .eln-pl-tpl small { font-size: 10.5px; color: var(--pl-muted, #64748b); }

/* ---- Team: the lab week, and a manager's block on Today ----------------------------------------- */

.eln-pl-tm { overflow: auto; border: 1px solid var(--pl-line); border-radius: 12px; background: var(--pl-surface); }
.eln-pl-tm-grid { display: grid; min-width: min-content; }
.eln-pl-tm-corner, .eln-pl-tm-day, .eln-pl-tm-who, .eln-pl-tm-cell { border-bottom: 1px solid var(--pl-line-soft); border-right: 1px solid var(--pl-line-soft); }
.eln-pl-tm-day { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 4px; font-size: 12px; color: var(--pl-muted); position: sticky; top: 0; background: var(--pl-surface); z-index: 2; border-bottom-color: var(--pl-line); }
.eln-pl-tm-day b { font-size: 15px; color: var(--pl-text); font-variant-numeric: tabular-nums; }
.eln-pl-tm-day.is-today b { color: #fff; background: var(--pl-accent); border-radius: 999px; min-width: 24px; text-align: center; padding: 0 5px; }
.eln-pl-tm-corner { position: sticky; top: 0; left: 0; z-index: 3; background: var(--pl-surface); border-bottom-color: var(--pl-line); }
.eln-pl-tm-who { position: sticky; left: 0; z-index: 1; background: var(--pl-surface); padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; min-height: 52px; }
.eln-pl-tm-who small { color: var(--pl-muted); font-size: 11.5px; }
.eln-pl-tm-cell { padding: 4px; display: flex; flex-direction: column; gap: 3px; min-height: 52px; min-width: 0; }
.eln-pl-tm-cell.is-today { background: var(--pl-today); }
.eln-pl-tm-busy {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 2px 7px; border-radius: 6px; font-size: 12px;
  color: var(--pl-muted); border: 1px dashed var(--pl-line); background: transparent;
}
.eln-pl-tm-busy small { font-size: 11px; font-variant-numeric: tabular-nums; }
.eln-pl-tm-rule { grid-column: 1 / -1; padding: 12px 10px 6px; border-bottom: 1px solid var(--pl-line); position: sticky; left: 0; }
.eln-pl-tm-rule h3 { margin: 0; font-size: 13px; }
.eln-pl-tm-rule small { color: var(--pl-muted); font-size: 11.5px; }
.eln-pl-tm-bar { height: 6px; border-radius: 3px; background: var(--pl-subtle); border: 1px solid var(--pl-line); overflow: hidden; }
.eln-pl-tm-bar span { display: block; height: 100%; background: color-mix(in srgb, var(--pl-accent) 55%, transparent); }
.eln-pl-tm-hours { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; padding: 2px 7px; border-radius: 6px; background: color-mix(in srgb, var(--pl-accent) 12%, var(--pl-surface)); border: 1px solid color-mix(in srgb, var(--pl-accent) 28%, transparent); display: flex; justify-content: space-between; gap: 6px; }
.eln-pl-tm-hours small { font-weight: 500; color: var(--pl-muted); }

.eln-td-mg-group { margin-top: 10px; }
.eln-td-mg-group h4 { margin: 0 0 4px; font-size: 12.5px; display: flex; align-items: baseline; gap: 8px; }
.eln-td-mg-group h4 small { color: var(--pl-muted); font-weight: 500; }

/* ---- Today, calmer: two columns, quiet empty blocks, folds ----------------------------------------------------------------------- */

.eln-td-block.is-quiet { display: flex; align-items: baseline; gap: 12px; padding: 9px 14px; }
.eln-td-block.is-quiet h3 { margin: 0; flex: none; }
.eln-td-block.is-quiet .eln-td-calm { padding: 0; }
.eln-td-mg > summary, .eln-td-plan > summary { list-style: none; cursor: pointer; }
.eln-td-mg > summary::-webkit-details-marker, .eln-td-plan > summary::-webkit-details-marker { display: none; }
.eln-td-mg > summary h3 { margin: 0; }
.eln-td-mg > summary h3::before { content: "▸"; font-size: 10px; color: var(--pl-muted); }
.eln-td-mg[open] > summary h3 { margin-bottom: 8px; }
.eln-td-mg[open] > summary h3::before { content: "▾"; }
.eln-td-plan { border: 1px solid var(--pl-line); border-radius: 12px; padding: 0 14px; background: var(--pl-surface); }
.eln-td-plan > summary { padding: 11px 0; font-size: 13px; font-weight: 600; color: var(--pl-accent); }
.eln-td-plan[open] { padding-bottom: 12px; }
.eln-td-plan[open] > summary { padding-bottom: 6px; }
.eln-td-plan .eln-pl-tpl { margin-top: 4px; }
.eln-td-plan .eln-pl-tip { margin: 0 0 8px; }
.eln-home-books-body { padding: 8px 4px 4px; display: flex; flex-direction: column; gap: 8px; }
@container eln-studio (max-width: 900px) {
  .eln-td { grid-template-columns: minmax(0, 1fr); }
  .eln-td-aside { order: -1; }
  .eln-td-needs { position: static; }
}

/* ---- Plan, calmer: the whole width for the calendar; the rest opens on request -------------------------------------------------- */

.eln-pl-add {
  position: absolute; left: 0; top: 0; bottom: 0; z-index: 6; box-sizing: border-box; width: 272px; overflow: auto;
  padding: 12px; display: flex; flex-direction: column; gap: 16px;
  background: var(--pl-surface); border-right: 1px solid var(--pl-line); box-shadow: 6px 0 24px rgba(15, 23, 42, .14);
  transition: opacity .1s ease;
}
.eln-pl-add[hidden] { display: none; }
/* While something is dragged out of it, it steps aside so every day and time under it can take the drop. */
body.eln-pl-dragging .eln-pl-add { opacity: .18; pointer-events: none; }
.eln-pl-add-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.eln-pl-add-head h3 { margin: 0; font-size: 13px; font-weight: 650; text-transform: none; letter-spacing: 0; }
.eln-pl-add-x { all: unset; cursor: pointer; padding: 3px 9px; border-radius: 7px; color: var(--pl-muted); font-size: 12px; }
.eln-pl-add-x:hover { background: var(--pl-subtle); color: var(--pl-text); }
.eln-pl-add-x:focus-visible { outline: 2px solid var(--pl-accent); outline-offset: 1px; }
.eln-pl-add h3 { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--pl-muted); font-weight: 650; }
.eln-pl-add-head h3 { text-transform: none; letter-spacing: 0; color: var(--pl-text); font-size: 13px; }

.eln-pl-pop {
  position: absolute; z-index: 30; box-sizing: border-box; max-width: min(340px, calc(100% - 16px)); padding: 10px;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--pl-surface); border: 1px solid var(--pl-line); border-radius: 12px; box-shadow: 0 14px 40px rgba(15, 23, 42, .2);
}
.eln-pl-pop .eln-pl-mini { width: 280px; border: 0; padding: 0; }
.eln-pl-pop .eln-pl-layers h3, .eln-pl-pop .eln-pl-key h3 { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--pl-muted); font-weight: 650; }
.eln-pl-pop .eln-pl-layers label { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 2px 0; }
