/* Lineup v2 shell. No Pico, no web fonts: a system sans stack and a small token set.
   Light = mockup A "airy light"; dark = mockup B "calm dark".
   Theme contract: <html data-theme="light|dark"> forces a theme; no attribute follows the device. */

/* ---- tokens: light (A) --------------------------------------------------- */
:root {
  color-scheme: light;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --bg: #f6f7f9;            /* page */
  --top: #ffffff;           /* top bar */
  --lane: #eceef2;          /* columns and lanes */
  --lane-border: transparent;
  --card: #ffffff;
  --card-border: transparent;
  --ink: #1d2330;
  --muted: #667085;
  --line: #e7e9ee;
  --hover: #e2e5ea;         /* quiet hover fill on lanes and menus */
  --seg: #eef0f4;           /* segmented switch track */
  --seg-on: #ffffff;
  --seg-on-shadow: 0 1px 2px rgba(0, 0, 0, .08);
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lift: 0 8px 24px rgba(16, 24, 40, .16), 0 2px 6px rgba(16, 24, 40, .08);
  --accent: #3b82f6;        /* progress bars, focus ring */
  --add-bg: #1d2330;        /* the + Add card button */
  --add-ink: #ffffff;
  --field: #ffffff;
  --field-border: #d5d9e0;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --warn: #8a5a00;
  --warn-bg: #fdecc8;
  --backdrop: rgba(16, 24, 40, .35);

  /* area pills: palette keys from areas.AREA_COLORS */
  --area-blue-bg: #dbeafe;   --area-blue-ink: #1e40af;
  --area-green-bg: #dcfce7;  --area-green-ink: #166534;
  --area-amber-bg: #fdecc8;  --area-amber-ink: #8a5a00;
  --area-rose-bg: #fce7f3;   --area-rose-ink: #9d174d;
  --area-violet-bg: #ede9fe; --area-violet-ink: #5b21b6;
  --area-teal-bg: #ccfbf1;   --area-teal-ink: #115e59;
  --area-orange-bg: #ffedd5; --area-orange-ink: #9a3412;
  --area-slate-bg: #e5e7eb;  --area-slate-ink: #374151;

  --radius-lane: 12px;
  --radius-card: 9px;
  --radius-ctl: 8px;
  --ease: cubic-bezier(.2, .7, .3, 1);

  /* The shared login/password templates colour their errors with this name. */
  --pico-del-color: var(--danger);
  --pico-muted-border-color: var(--line);
}

/* ---- tokens: dark (B). Same block twice: device dark unless forced light, or forced dark. ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111318; --top: #111318; --lane: #171a20; --lane-border: #20232b;
    --card: #1f232b; --card-border: #2a2e38; --ink: #e6e8ee; --muted: #9aa1ad;
    --line: #22252d; --hover: #232731; --seg: #1b1e25; --seg-on: #2a2e38; --seg-on-shadow: none;
    --shadow: none; --shadow-lift: 0 10px 28px rgba(0, 0, 0, .5);
    --accent: #a78bfa; --add-bg: #e6e8ee; --add-ink: #111318;
    --field: #171a20; --field-border: #2a2e38;
    --danger: #f97066; --danger-bg: #3b1513; --warn: #fbbf24; --warn-bg: #3a2e12;
    --backdrop: rgba(0, 0, 0, .55);
    --area-blue-bg: #172554;   --area-blue-ink: #93c5fd;
    --area-green-bg: #052e16;  --area-green-ink: #86efac;
    --area-amber-bg: #3a2e12;  --area-amber-ink: #fbbf24;
    --area-rose-bg: #500724;   --area-rose-ink: #f9a8d4;
    --area-violet-bg: #2e1065; --area-violet-ink: #c4b5fd;
    --area-teal-bg: #042f2e;   --area-teal-ink: #5eead4;
    --area-orange-bg: #431407; --area-orange-ink: #fdba74;
    --area-slate-bg: #262a33;  --area-slate-ink: #cbd5e1;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111318; --top: #111318; --lane: #171a20; --lane-border: #20232b;
  --card: #1f232b; --card-border: #2a2e38; --ink: #e6e8ee; --muted: #9aa1ad;
  --line: #22252d; --hover: #232731; --seg: #1b1e25; --seg-on: #2a2e38; --seg-on-shadow: none;
  --shadow: none; --shadow-lift: 0 10px 28px rgba(0, 0, 0, .5);
  --accent: #a78bfa; --add-bg: #e6e8ee; --add-ink: #111318;
  --field: #171a20; --field-border: #2a2e38;
  --danger: #f97066; --danger-bg: #3b1513; --warn: #fbbf24; --warn-bg: #3a2e12;
  --backdrop: rgba(0, 0, 0, .55);
  --area-blue-bg: #172554;   --area-blue-ink: #93c5fd;
  --area-green-bg: #052e16;  --area-green-ink: #86efac;
  --area-amber-bg: #3a2e12;  --area-amber-ink: #fbbf24;
  --area-rose-bg: #500724;   --area-rose-ink: #f9a8d4;
  --area-violet-bg: #2e1065; --area-violet-ink: #c4b5fd;
  --area-teal-bg: #042f2e;   --area-teal-ink: #5eead4;
  --area-orange-bg: #431407; --area-orange-ink: #fdba74;
  --area-slate-bg: #262a33;  --area-slate-ink: #cbd5e1;
}

/* ---- base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh;
  background: var(--bg); color: var(--ink);
  font: 400 14px/1.4 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3 { margin: 0 0 .75rem; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.375rem; font-weight: 700; }
h2 { font-size: 1.125rem; font-weight: 650; }
h3 { font-size: .9375rem; font-weight: 600; }
p { margin: 0 0 .75rem; }
a { color: inherit; text-underline-offset: 2px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---- top bar --------------------------------------------------------------- */
.lx-top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 8px 16px;
  background: var(--top); border-bottom: 1px solid var(--line);
}
.lx-brand { font-weight: 700; font-size: 15px; letter-spacing: -.01em; text-decoration: none; margin-right: 4px; }
.lx-spacer { flex: 1; }

/* segmented switches: zoom (Me / Team / Org / Wins) and view (Board / Backlog) */
.lx-seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--radius-ctl); background: var(--seg); }
.lx-seg > a, .lx-seg-item > span {
  display: inline-block; padding: 4px 10px; border-radius: 6px;
  font-size: 12.5px; text-decoration: none; color: var(--muted); white-space: nowrap;
  cursor: pointer; user-select: none;
}
.lx-seg > a:hover { color: var(--ink); }
.lx-seg > a.on, .lx-seg-item > input:checked + span {
  background: var(--seg-on); color: var(--ink); font-weight: 600; box-shadow: var(--seg-on-shadow);
}
.lx-seg-item > input { position: absolute; opacity: 0; pointer-events: none; }
.lx-seg-item > input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.lx-seg-lg > a, .lx-seg-lg .lx-seg-item > span { padding: 6px 14px; font-size: 13px; }

.lx-icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 6px; border: 0; border-radius: var(--radius-ctl);
  background: transparent; color: var(--ink); font: inherit; font-size: 15px; line-height: 1;
  cursor: pointer; opacity: .75; transition: opacity .15s var(--ease);
}
.lx-icon-btn:hover { opacity: 1; }
.lx-badge {
  position: absolute; top: 1px; right: -2px; min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center;
}
.lx-add {
  border: 0; border-radius: var(--radius-ctl); padding: 7px 12px;
  background: var(--add-bg); color: var(--add-ink);
  font: 600 12.5px/1 var(--font); white-space: nowrap; cursor: pointer;
  transition: opacity .15s var(--ease), transform .15s var(--ease);
}
.lx-add:hover { opacity: .9; }
.lx-add:active { transform: scale(.97); }

/* avatar menu: a <details> so it needs no script */
.lx-menu { position: relative; }
.lx-menu > summary { list-style: none; cursor: pointer; display: flex; border-radius: 50%; }
.lx-menu > summary::-webkit-details-marker { display: none; }
.lx-menu > summary .lx-avatar { width: 28px; height: 28px; font-size: 11px; }
.lx-menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 168px; padding: 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lift);
  animation: lx-pop .14s var(--ease);
}
.lx-menu-pop a, .lx-menu-pop button {
  display: block; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px;
  background: none; color: var(--ink); font: inherit; font-size: 13px; text-align: left;
  text-decoration: none; cursor: pointer;
}
.lx-menu-pop a:hover, .lx-menu-pop button:hover { background: var(--hover); }
.lx-menu-pop form { margin: 0; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }

/* initials avatar (colour set inline per user) */
.lx-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 20px; height: 20px; border-radius: 50%;
  font-size: 9.5px; font-weight: 700; letter-spacing: .02em; color: #fff; background: #334155;
}

/* ---- page frame ------------------------------------------------------------ */
.lx-main { padding: 16px; }
.lx-page { max-width: 640px; margin: 0 auto; }
.lx-hint, .lx-muted { color: var(--muted); font-size: 12.5px; }
.lx-error { color: var(--danger); }

/* ---- board, lanes, cards (Task 7 onward fills these) ----------------------- */
.lx-board {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr);
  gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 8px;
}
.lx-col, .lx-lane {
  background: var(--lane); border: 1px solid var(--lane-border);
  border-radius: var(--radius-lane); padding: 8px; min-height: 120px;
}
.lx-col-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 2px 4px 8px; font-size: 12.5px; font-weight: 600;
}
.lx-col-head .lx-n { font-weight: 500; color: var(--muted); }
.lx-list { list-style: none; margin: 0; padding: 0; min-height: 8px; }
.lx-card {
  list-style: none; position: relative; margin: 0 0 7px; padding: 9px 10px;
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-card);
  box-shadow: var(--shadow); cursor: pointer;
  transition: transform .14s var(--ease), opacity .14s var(--ease);
}
.lx-card:hover { transform: translateY(-1px); }
.lx-card-title { display: block; font-weight: 500; overflow-wrap: anywhere; }
.lx-card-meta { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 11.5px; color: var(--muted); }
.lx-card-meta .lx-avatar { margin-left: auto; }
.lx-card.is-done { opacity: .7; }
.lx-pill {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; line-height: 1.5; white-space: nowrap;
  background: var(--area-slate-bg); color: var(--area-slate-ink);
}
.lx-pill.area-blue   { background: var(--area-blue-bg);   color: var(--area-blue-ink); }
.lx-pill.area-green  { background: var(--area-green-bg);  color: var(--area-green-ink); }
.lx-pill.area-amber  { background: var(--area-amber-bg);  color: var(--area-amber-ink); }
.lx-pill.area-rose   { background: var(--area-rose-bg);   color: var(--area-rose-ink); }
.lx-pill.area-violet { background: var(--area-violet-bg); color: var(--area-violet-ink); }
.lx-pill.area-teal   { background: var(--area-teal-bg);   color: var(--area-teal-ink); }
.lx-pill.area-orange { background: var(--area-orange-bg); color: var(--area-orange-ink); }
.lx-pill.area-slate  { background: var(--area-slate-bg);  color: var(--area-slate-ink); }
.lx-due.late { color: var(--danger); font-weight: 600; }
.lx-due.today { color: var(--warn); font-weight: 600; }
.lx-bar { height: 3px; margin-top: 7px; border-radius: 2px; overflow: hidden; background: var(--lane); }
.lx-bar > i { display: block; height: 100%; background: var(--accent); }
.lx-add-inline {
  display: block; width: 100%; padding: 6px 8px; border: 0; border-radius: var(--radius-ctl);
  background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer;
}
.lx-add-inline:hover { background: var(--hover); color: var(--ink); }

/* drag states (SortableJS: chosenClass lx-lifted, ghostClass lx-ghost; Task 9) */
.lx-card.lx-lifted, .lx-init-card.lx-lifted { transform: scale(1.02); box-shadow: var(--shadow-lift); }
.lx-card.lx-ghost, .lx-init-card.lx-ghost {
  background: transparent; box-shadow: none; transform: none;
  border: 1.5px dashed var(--field-border);
}
.lx-card.lx-ghost > *, .lx-init-card.lx-ghost > * { visibility: hidden; }
.sortable-fallback, .sortable-drag { transform: rotate(1.5deg); box-shadow: var(--shadow-lift); }
body.lx-dragging, body.lx-dragging * { cursor: grabbing !important; }
body.lx-dragging .lx-card:hover { transform: none; }
.lx-card.is-moving { opacity: .6; }
.lx-list { min-height: 24px; }

/* ---- controls: buttons, fields, panels ------------------------------------- */
.lx-btn, .lx-main button[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border: 0; border-radius: var(--radius-ctl);
  background: var(--add-bg); color: var(--add-ink);
  font: 600 13px/1.2 var(--font); cursor: pointer;
  transition: opacity .15s var(--ease), transform .15s var(--ease);
}
.lx-btn:hover, .lx-main button[type="submit"]:hover { opacity: .9; }
.lx-btn:active, .lx-main button[type="submit"]:active { transform: scale(.98); }
.lx-btn-quiet { background: var(--seg); color: var(--ink); }

input[type="text"], input[type="password"], input[type="email"], input[type="number"],
input[type="date"], input[type="search"], select, textarea {
  display: block; width: 100%; margin: 4px 0 0; padding: 8px 10px;
  background: var(--field); color: var(--ink);
  border: 1px solid var(--field-border); border-radius: var(--radius-ctl);
  font: inherit; font-size: 14px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
label { display: block; margin: 0 0 12px; font-size: 13px; font-weight: 500; }
label small { display: block; margin-top: 4px; font-weight: 400; color: var(--danger); }
.lx-check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
fieldset { margin: 0 0 12px; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 4px; font-size: 13px; font-weight: 600; }
.lx-panel {
  margin: 0 0 16px; padding: 16px; background: var(--card);
  border: 1px solid var(--card-border); border-radius: 12px; box-shadow: var(--shadow);
}

/* ---- auth pages (login, password): shared templates, an <article> card ------ */
.lx-main > article {
  width: 100%; max-width: 400px; margin: 48px auto; padding: 24px;
  background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; box-shadow: var(--shadow);
}
.lx-main > article > header h2 { font-size: 1.375rem; margin-bottom: 16px; }
.lx-main > article button[type="submit"] { width: 100%; padding: 10px 14px; margin-top: 4px; }
.lx-main > article > footer { margin-top: 16px; font-size: 13px; color: var(--muted); }
body.page-auth .lx-main { display: flex; align-items: center; justify-content: center; }

/* ---- overlays: popup, quick add, inbox drawer, toast ------------------------ */
.lx-dialog {
  width: min(32rem, calc(100vw - 32px)); padding: 16px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--card); color: var(--ink); box-shadow: var(--shadow-lift);
}
.lx-dialog[open] { animation: lx-pop .16s var(--ease); }
.lx-dialog::backdrop { background: var(--backdrop); }
.lx-popup { width: min(52rem, calc(100vw - 32px)); }
.lx-dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.lx-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.lx-form details { margin-top: 8px; }
.lx-form summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.lx-form details > * + * { margin-top: 8px; }
.lx-qa-result { list-style: none; margin: 10px 0 0; padding: 0; }
.lx-qa-result:empty { display: none; }

.lx-drawer {
  position: fixed; top: 52px; right: 0; bottom: 0; z-index: 25; width: min(380px, 100vw);
  padding: 16px; overflow-y: auto; background: var(--top);
  border-left: 1px solid var(--line); box-shadow: var(--shadow-lift);
  animation: lx-slide .18s var(--ease);
}
.lx-toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 50; transform: translateX(-50%);
  max-width: calc(100vw - 32px); pointer-events: none;
}
.lx-toast > * {
  padding: 10px 14px; border-radius: 10px; background: var(--add-bg); color: var(--add-ink);
  font-size: 13px; box-shadow: var(--shadow-lift); animation: lx-pop .16s var(--ease);
}

@keyframes lx-pop { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes lx-slide { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---- phone: top bar on two tidy rows (the board layout is in the Task 14 block at the end) ---- */
@media (max-width: 640px) {
  .lx-top { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .lx-top .lx-spacer { order: 1; }
  .lx-top #lx-zoom, .lx-top #lx-view { order: 2; }
  .lx-top #lx-zoom { flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; }
  .lx-main { padding: 12px; }
}

/* ---- My board extras (Task 7) ------------------------------------------------ */
.lx-card-parent { display: block; margin-bottom: 3px; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.lx-card-meta { flex-wrap: wrap; }
.lx-init, .lx-subs { white-space: nowrap; }
.lx-blocked { font-size: 11px; }
.lx-add-wrap > summary { list-style: none; }
.lx-add-wrap > summary::-webkit-details-marker { display: none; }
.lx-add-form { padding: 4px 0 2px; }
.lx-add-form input[type="text"] { margin: 0 0 6px; }
.lx-add-actions { display: flex; gap: 6px; }
.lx-filters { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; max-width: 520px; }
.lx-filters input[type="search"] { margin: 0; }
.lx-filters .lx-btn { text-decoration: none; white-space: nowrap; }

/* ---- Team lanes (T2) and filter row (T1) ----------------------------------- */
.lx-fbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 0 0 12px; }
.lx-fgroup { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.lx-fgroup select { margin: 0; width: auto; padding: 4px 28px 4px 8px; font-size: 12.5px; }
.lx-fav { text-decoration: none; opacity: .55; outline-offset: 1px; }
.lx-fav:hover, .lx-fav.on { opacity: 1; }
.lx-fav.on { outline: 2px solid var(--accent); }
.lx-fpill {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  text-decoration: none; color: var(--muted); background: var(--seg); opacity: .75;
}
.lx-fpill.lx-pill { color: inherit; }
.lx-fpill:hover { opacity: 1; }
.lx-fpill.on { opacity: 1; outline: 2px solid var(--accent); outline-offset: 1px; }
.lx-lanes { overflow-x: auto; padding-bottom: 8px; }
.lx-lane-grid { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 10px; align-items: start; }
.lx-lanes-head { padding: 0 0 6px 150px; font-size: 12.5px; font-weight: 600; min-width: 1070px; }
.lx-lanes-head > span:first-child { display: none; }
.lx-lane { display: flex; gap: 0; margin: 0 0 10px; min-width: 1070px; }
.lx-lane-label {
  position: sticky; left: 0; z-index: 2; flex: 0 0 140px; margin-right: 10px; align-self: stretch;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  padding: 8px; background: var(--bg); border-radius: var(--radius-lane);
}
.lx-lane-label .lx-n { font-size: 12px; color: var(--muted); }
.lx-lane-toggle { all: unset; cursor: pointer; font-size: 14px; color: var(--muted); padding: 0 4px; border-radius: 4px; }
.lx-lane-toggle:hover { background: var(--hover); color: var(--ink); }
.lx-lane-cells { flex: 1 1 auto; }
.lx-lane-cells .lx-col { min-height: 56px; }
.lx-lane.is-collapsed .lx-lane-cells { display: none; }
.lx-lane.is-collapsed .lx-lane-toggle { transform: rotate(-90deg); }
.lx-bl-area { margin: 0 0 18px; }
.lx-bl-area h3 { margin: 0 0 8px; font-size: 14px; }
.lx-board.lx-stack { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0, 640px); overflow-x: visible; }
/* My Backlog: the slim Up Next strip on top; a card dropped on it is promoted and leaves the list */
.lx-col.lx-drop-strip { min-height: 0; }
.lx-drop-strip .lx-col-head .lx-muted { font-weight: 400; }
.lx-drop-strip .lx-list { min-height: 44px; border: 2px dashed var(--line); border-radius: var(--radius-card); }

/* ---- card popup (Task 10; mockup card-popup.html) ---------------------------- */
.lx-popup { width: min(780px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; overflow: auto; overscroll-behavior: contain; }
.lx-popup:empty { display: none; }
.lx-popup.lx-drop { outline: 3px dashed var(--accent); outline-offset: -6px; }
.lx-pop { font-size: 13px; }
.lx-pop-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 12px 18px 0; font-size: 11.5px; color: var(--muted); }
.lx-pop-crumb .lx-pill { font-size: 11px; padding: 2px 8px; }
.lx-pill-init { background: var(--danger-bg); color: var(--danger); }
.lx-sep { color: var(--muted); }
.lx-pop-who { margin-left: auto; overflow-wrap: anywhere; }
.lx-pop-parent { display: inline-block; margin: 8px 18px 0; font-size: 12px; color: var(--muted); text-decoration: none; overflow-wrap: anywhere; }
.lx-pop-parent:hover { color: var(--ink); text-decoration: underline; }
.lx-pop-head { display: flex; align-items: flex-start; gap: 10px; padding: 10px 18px 6px; }
.lx-popup input.lx-pop-title {
  flex: 1; margin: 0; padding: 3px 6px; margin-left: -6px; border: 1px solid transparent; border-radius: 8px;
  background: transparent; font-size: 19px; font-weight: 650; letter-spacing: -.01em; color: var(--ink);
}
.lx-popup input.lx-pop-title:hover { border-color: var(--line); }
.lx-popup input.lx-pop-title:focus { background: var(--field); border-color: var(--accent); }
.lx-pop-x {
  flex: none; width: 28px; height: 28px; border: 0; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--seg); color: var(--muted); font: inherit; font-size: 13px;
}
.lx-pop-x:hover { color: var(--ink); background: var(--hover); }
.lx-pop-grid { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 20px; padding: 6px 18px 18px; }
.lx-pop-main { min-width: 0; }
.lx-sec { margin-top: 14px; }
.lx-sec:first-child { margin-top: 4px; }
.lx-sh {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.lx-notes {
  padding: 8px 10px; border: 1px solid transparent; border-radius: 8px; background: var(--bg);
  color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; cursor: text;
}
.lx-notes:hover { border-color: var(--line); }
.lx-notes.is-empty { color: var(--muted); }
.lx-notes-form textarea { margin: 0 0 6px; resize: vertical; }

/* checklist */
.lx-hide-done { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 11.5px; font-weight: 500; text-transform: none; letter-spacing: 0; cursor: pointer; }
.lx-chk-bar { height: 4px; margin: 2px 0 6px; background: var(--lane); }
.lx-chk-list { list-style: none; margin: 0; padding: 0; }
.lx-chk { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 7px; }
.lx-chk:hover { background: var(--bg); }
.lx-chk .lx-box { flex: none; width: 15px; height: 15px; margin: 0; cursor: pointer; }
.lx-chk-title { flex: 1; min-width: 0; text-decoration: none; overflow-wrap: anywhere; }
.lx-chk-title:hover { text-decoration: underline; }
.lx-chk.is-done .lx-chk-title { color: var(--muted); text-decoration: line-through; }
.lx-chk .lx-due { font-size: 11px; color: var(--muted); white-space: nowrap; }
.lx-chk select.lx-chk-owner { width: auto; max-width: 92px; margin: 0; padding: 2px 4px; border-color: transparent; background: transparent; font-size: 11.5px; color: var(--muted); }
.lx-chk select.lx-chk-owner:hover { border-color: var(--field-border); }
#lx-checklist.hide-done .lx-chk.is-done { display: none; }
.lx-chk-add { display: flex; gap: 6px; align-items: center; }
.lx-chk-add select.lx-chk-owner { width: auto; max-width: 110px; margin: 2px 0 0; padding: 2px 4px; font-size: 11.5px; color: var(--muted); }
.lx-chk-add input[type="text"] { flex: 1; min-width: 0; margin: 2px 0 0; padding: 5px 6px; border-color: transparent; background: transparent; font-size: 12.5px; }
.lx-chk-add input[type="text"]:hover { border-color: var(--line); }
.lx-chk-add input[type="text"]:focus { background: var(--field); }

/* attachments */
.lx-files { display: flex; flex-wrap: wrap; gap: 8px; }
.lx-file {
  display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 11.5px; max-width: 100%;
}
.lx-file a { text-decoration: none; overflow-wrap: anywhere; }
.lx-file a:hover { text-decoration: underline; }
.lx-file-x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 2px; font: inherit; }
.lx-file-x:hover { color: var(--danger); }
.lx-file-add { color: var(--muted); border-style: dashed; cursor: pointer; }
.lx-file-add label { margin: 0; font-size: 11.5px; font-weight: 400; cursor: pointer; }
.lx-file-add:hover { color: var(--ink); border-color: var(--field-border); }
.lx-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* comments and activity */
.lx-cm { display: flex; gap: 8px; margin-bottom: 10px; }
.lx-cm-b { flex: 1; min-width: 0; padding: 7px 10px; border-radius: 10px; background: var(--bg); }
.lx-cm-who { font-size: 11.5px; font-weight: 600; }
.lx-cm-when { margin-left: 6px; font-weight: 400; color: var(--muted); }
.lx-cm-body { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.lx-cm-form textarea { margin: 0; border-radius: 10px; resize: vertical; font-size: 13px; }
.lx-cm-actions { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.lx-cm-actions .lx-btn { padding: 6px 12px; font-size: 12.5px; }
.lx-cm-actions .lx-muted { font-size: 11px; }
.lx-activity { margin-top: 12px; }
.lx-activity > summary { cursor: pointer; font-size: 11.5px; color: var(--muted); }
.lx-act-list { list-style: none; margin: 6px 0 0; padding: 0; font-size: 11.5px; color: var(--muted); }
.lx-act-list li { padding: 2px 0; overflow-wrap: anywhere; }
.lx-act-who { color: var(--ink); font-weight: 600; }
.lx-act-when { margin-left: 4px; opacity: .8; }

/* side: properties, banners, actions */
.lx-props { display: flex; flex-direction: column; gap: 1px; }
.lx-prop {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0;
  padding: 3px 4px 3px 8px; border-radius: 8px; font-size: 12.5px; font-weight: 400;
}
.lx-prop:hover { background: var(--bg); }
.lx-prop .k { flex: none; color: var(--muted); }
.lx-prop .v, .lx-repeat-v select, .lx-repeat-v input {
  width: auto; min-width: 0; max-width: 140px; margin: 0; padding: 3px 6px;
  border: 1px solid transparent; background: transparent; color: var(--ink);
  font-size: 12.5px; font-weight: 550; text-align: right; text-align-last: right; cursor: pointer;
}
.lx-prop .v:hover, .lx-repeat-v select:hover, .lx-repeat-v input:hover { border-color: var(--field-border); }
.lx-prop .v:focus, .lx-repeat-v :focus { background: var(--field); }
.lx-prop .lx-ro { cursor: default; border: 0; color: var(--muted); }
.lx-prop input[type="date"].v { max-width: 132px; }
.lx-prop input[type="text"].v { text-align: right; }
.lx-repeat { flex-wrap: wrap; }
.lx-repeat-v { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px; }
.lx-repeat-v input[type="number"] { width: 56px; }
.lx-repeat [data-for] { display: none; }
.lx-repeat[data-kind="days"] [data-for="days"],
.lx-repeat[data-kind="weekly"] [data-for="weekly"],
.lx-repeat[data-kind="monthly"] [data-for="monthly"] { display: block; }
.lx-blk {
  margin: 8px 0 4px; padding: 7px 9px; border-radius: 8px; font-size: 12px;
  background: var(--danger-bg); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
  overflow-wrap: anywhere;
}
.lx-cancelled { background: var(--seg); color: var(--muted); border-color: var(--line); }
.lx-pop-actions form { margin: 0; }
.lx-pbtn {
  display: block; width: 100%; margin-top: 6px; padding: 7px 10px; border: 0; border-radius: 8px;
  background: var(--seg); color: var(--ink); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer;
  transition: background .12s var(--ease), transform .12s var(--ease);
}
.lx-pbtn:hover { background: var(--hover); }
.lx-pbtn:active { transform: scale(.98); }
.lx-pbtn.go { background: #16a34a; color: #fff; font-weight: 600; text-align: center; }
.lx-pbtn.go:hover { background: #15803d; }
.lx-pbtn.danger { color: var(--danger); }
.lx-pbtn-file { display: none; }
.lx-pop-hint { margin: 8px 0 0; font-size: 11px; color: var(--muted); text-align: center; }

/* phone: a full-screen sheet, properties as tap-chips, Done at thumb height */
@media (max-width: 640px) {
  .lx-popup {
    width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0;
    border: 0; border-radius: 0;
  }
  .lx-pop-crumb { padding: 12px 14px 0; }
  .lx-pop-who { margin-left: 0; flex-basis: 100%; }
  .lx-pop-parent { margin: 6px 14px 0; }
  .lx-pop-head { padding: 8px 14px 4px; }
  .lx-popup input.lx-pop-title { font-size: 16px; }
  .lx-pop-grid { display: flex; flex-direction: column; gap: 0; padding: 0 14px; }
  .lx-pop-side { display: contents; }
  .lx-props { order: -2; flex-direction: row; flex-wrap: wrap; gap: 6px; padding: 4px 0 8px; }
  .lx-prop { padding: 0; background: none; }
  .lx-prop:hover { background: none; }
  .lx-prop .k { display: none; }
  .lx-prop .v, .lx-repeat-v select, .lx-repeat-v input {
    max-width: none; padding: 5px 10px; border-radius: 999px; background: var(--seg);
    text-align: left; text-align-last: left; font-weight: 500; font-size: 12.5px; min-height: 30px;
  }
  .lx-repeat-v { justify-content: flex-start; gap: 6px; }
  .lx-blk { order: -1; }
  .lx-pop-main { order: 0; padding-bottom: 12px; }
  .lx-pop-hint { display: none; }
  .lx-pop-actions {
    order: 1; position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px;
    margin: 0 -14px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line); background: var(--top);
  }
  .lx-pop-actions > * { flex: 1 1 auto; }
  .lx-pbtn { margin: 0; text-align: center; padding: 10px 8px; min-height: 40px; }
  .lx-pbtn.go { order: 9; flex: 2 1 100%; }
  .lx-pbtn-file { display: block; }
  .lx-long { display: none; }
}

/* ---- Org: initiatives as big cards (Task 11) -------------------------------- */
.lx-org { grid-auto-columns: minmax(260px, 1fr); }
.lx-org-list { list-style: none; margin: 0; padding: 0; min-height: 40px; }
.lx-init-card {
  list-style: none; position: relative; margin: 0 0 9px; padding: 12px 12px 10px;
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-card);
  box-shadow: var(--shadow); cursor: pointer;
  transition: transform .14s var(--ease), opacity .14s var(--ease);
}
.lx-init-card:hover { transform: translateY(-1px); }
.lx-init-card .lx-card-title { font-size: 15px; font-weight: 600; color: var(--ink); text-decoration: none; }
.lx-init-desc { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.lx-init-prog { margin-top: 9px; font-size: 12px; font-weight: 600; }
.lx-init-prog .lx-bar { height: 5px; margin-top: 4px; }
.lx-init-owners { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; }
.lx-init-alldone { margin-top: 9px; width: 100%; }
.lx-init-card.is-moving { opacity: .6; }
.lx-init-head { margin: 0 0 14px; }
.lx-init-head h2 { margin: 2px 0 6px; }
.lx-init-actions { display: flex; gap: 8px; align-items: center; margin: 8px 0 12px; }
.lx-init-actions form { margin: 0; }
.lx-bl-list { list-style: none; margin: 0; padding: 0; max-width: 720px; }
.lx-bl-row {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 9px 10px; margin-bottom: 6px;
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-card);
}
.lx-bl-row.is-archived { opacity: .65; }
.lx-bl-row .lx-card-title { display: inline; flex: 1 1 200px; text-decoration: none; color: var(--ink); }

/* ---- Wins banner and tab (Task 12). The banner is dark in both themes, per the mockup. ---- */
.lx-banner { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr) 1.6fr; gap: 14px; align-items: center;
  margin: 12px 0 8px; padding: 14px 16px; border-radius: 14px; color: #fff; text-decoration: none;
  background: linear-gradient(120deg, #1d2330, #334155); }
.lx-banner:hover { filter: brightness(1.08); }
.lx-banner-title { font-size: 15px; font-weight: 650; }
.lx-banner-big { font-size: 26px; font-weight: 750; letter-spacing: -.02em; line-height: 1; }
.lx-banner-lbl { font-size: 11px; opacity: .7; margin-top: 4px; }
.lx-spark { display: flex; align-items: flex-end; gap: 3px; height: 38px; }
.lx-spark i { flex: 1; background: #60a5fa; border-radius: 2px 2px 0 0; opacity: .85; }
.lx-spark i.now { background: #facc15; opacity: 1; }
.lx-wins-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; margin: 12px 0 16px; }
.lx-wins-side { display: flex; flex-direction: column; gap: 12px; }
.lx-panel { background: var(--card); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.lx-panel-h { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.lx-wk { font-size: 11px; font-weight: 600; color: var(--muted); margin: 10px 0 2px; }
.lx-win { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.lx-win:last-child { border-bottom: 0; }
.lx-win-title { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.lx-clap { margin-left: auto; font: inherit; font-size: 11px; color: var(--muted); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; cursor: pointer; }
.lx-clap.clapped { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.lx-mom { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 6px; }
.lx-mom-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  gap: 3px; font-size: 9.5px; color: var(--muted); }
.lx-mom-bar b { width: 100%; background: color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 3px 3px 0 0; }
.lx-mom-bar.now b { background: var(--accent); }
.lx-mom-cap { margin: 6px 0 0; font-size: 11px; }
.lx-ini { margin-bottom: 9px; }
.lx-ini-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.lx-ini-row a { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .lx-banner { grid-template-columns: 1fr 1fr; }
  .lx-banner-head { grid-column: 1 / -1; }
  .lx-wins-grid { grid-template-columns: 1fr; }
}

/* ---- inbox drawer, quick add receipt, areas admin (Task 13) ------------------ */
.lx-inbox-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.lx-inbox-row { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.lx-inbox-title {
  display: block; width: 100%; padding: 0; border: 0; background: none; color: var(--ink);
  font: 600 14px/1.3 var(--font); text-align: left; cursor: pointer; overflow-wrap: anywhere;
}
.lx-inbox-form { display: flex; gap: 6px; margin-top: 8px; }
.lx-inbox-form select { flex: 1 1 0; min-width: 0; }
.lx-inbox-clear { display: none; margin-top: 12px; }
.lx-inbox-list:not(:has(li)) + .lx-inbox-clear { display: block; }
.lx-qa-done { padding: 6px 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.lx-qa-done strong { color: var(--ink); }
.lx-areas .lx-panel { margin-top: 10px; }
.lx-area-edit, .lx-area-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lx-area-edit input[type="text"], .lx-area-add input[type="text"] { flex: 1 1 10rem; min-width: 0; }
.lx-area-tools { display: flex; gap: 6px; margin-top: 8px; }
.lx-swatches { display: flex; flex-wrap: wrap; gap: 4px; }
.lx-swatch { position: relative; cursor: pointer; }
.lx-swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.lx-swatch span {
  display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 11.5px;
  border: 2px solid transparent;
}
.lx-swatch input:checked + span { border-color: var(--ink); }
.lx-swatch input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 1px; }
.lx-swatch.area-blue span   { background: var(--area-blue-bg);   color: var(--area-blue-ink); }
.lx-swatch.area-green span  { background: var(--area-green-bg);  color: var(--area-green-ink); }
.lx-swatch.area-amber span  { background: var(--area-amber-bg);  color: var(--area-amber-ink); }
.lx-swatch.area-rose span   { background: var(--area-rose-bg);   color: var(--area-rose-ink); }
.lx-swatch.area-violet span { background: var(--area-violet-bg); color: var(--area-violet-ink); }
.lx-swatch.area-teal span   { background: var(--area-teal-bg);   color: var(--area-teal-ink); }
.lx-swatch.area-orange span { background: var(--area-orange-bg); color: var(--area-orange-ink); }
.lx-swatch.area-slate span  { background: var(--area-slate-bg);  color: var(--area-slate-ink); }
.lx-area-blockers { margin: 6px 0 0; padding-left: 18px; }

/* ---- phone boards (Task 14): one column at a time, swipe to the next ----------- */
.lx-dots { display: none; }
@media (max-width: 640px) {
  /* top bar: brand, zoom, Board/Backlog (+ inbox and avatar); Add becomes a floating button */
  .lx-top #lx-theme { display: none; }
  .lx-add {
    position: fixed; right: 16px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 40;
    width: 56px; height: 56px; padding: 0; border-radius: 50%; font-size: 0;
    box-shadow: var(--shadow-lift); display: flex; align-items: center; justify-content: center;
  }
  .lx-add::before { content: "+"; font: 400 32px/1 var(--font); }
  .lx-main { padding-bottom: 88px; }

  /* column dots above the board, synced by lineup.js */
  .lx-dots { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 8px; min-height: 20px; }
  .lx-dots .lx-dot {
    width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%;
    background: var(--line); cursor: pointer;
  }
  .lx-dots .lx-dot[aria-current="true"] { background: var(--accent); transform: scale(1.25); }
  .lx-dots .lx-dots-label { margin-left: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }

  .lx-board:not(.lx-stack), .lx-lane-cells {
    display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px;
    scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
  }
  .lx-board:not(.lx-stack)::-webkit-scrollbar, .lx-lane-cells::-webkit-scrollbar { display: none; }
  .lx-board:not(.lx-stack) > .lx-col, .lx-lane-cells > .lx-col {
    flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always;
  }
  .lx-board.lx-stack { grid-template-columns: minmax(0, 1fr); }

  /* team lanes stack; each lane is its own snap row */
  .lx-lanes { overflow-x: visible; }
  .lx-lanes-head { display: none; }
  .lx-lane { flex-direction: column; min-width: 0; padding: 8px 8px 4px; }
  .lx-lane-label { position: static; flex: none; flex-direction: row; align-items: center; margin: 0 0 6px; padding: 0; background: none; }
  .lx-lane-cells .lx-col { padding: 0; border: 0; background: none; }
  .lx-card { padding: 11px 12px; }
}
