/* Laneboard workspace. Root rules are scoped to .uwapp-root.uwapp-laneboard (the body carries the app class too).
   Light and dark tokens follow html[data-theme] / prefers-color-scheme. Board backgrounds are classes (CSP: no inline styles). */
.uwapp-root.uwapp-laneboard {
  --lb-bg: #eef1f6; --lb-surface: #ffffff; --lb-surface-2: #eef1f7; --lb-list: #f1f3f8; --lb-ink: #172033; --lb-muted: #4b5568;
  --lb-line: #d6dbe5; --lb-control: #6f7a8f; --lb-accent: #0b6bcb; --lb-accent-ink: #0a58a8; --lb-on-accent: #ffffff;
  --lb-warn: #a3271b; --lb-warn-bg: #fde4e1; --lb-focus: #b45309; --lb-ok: #0d5a2e;
  background: var(--lb-bg); color: var(--lb-ink); color-scheme: light;
}
:root[data-theme="dark"] .uwapp-root.uwapp-laneboard {
  --lb-bg: #11151d; --lb-surface: #1b212c; --lb-surface-2: #262e3b; --lb-list: #171c25; --lb-ink: #eef1f6; --lb-muted: #b7c0cf;
  --lb-line: #364152; --lb-control: #8d99ad; --lb-accent: #7fb6f5; --lb-accent-ink: #a8cdf8; --lb-on-accent: #0b1a2e;
  --lb-warn: #ffb3a8; --lb-warn-bg: #4a1d19; --lb-focus: #fbbf24; --lb-ok: #9be3b5;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .uwapp-root.uwapp-laneboard {
    --lb-bg: #11151d; --lb-surface: #1b212c; --lb-surface-2: #262e3b; --lb-list: #171c25; --lb-ink: #eef1f6; --lb-muted: #b7c0cf;
    --lb-line: #364152; --lb-control: #8d99ad; --lb-accent: #7fb6f5; --lb-accent-ink: #a8cdf8; --lb-on-accent: #0b1a2e;
    --lb-warn: #ffb3a8; --lb-warn-bg: #4a1d19; --lb-focus: #fbbf24; --lb-ok: #9be3b5;
    color-scheme: dark;
  }
}

/* Platform element defaults (buttons, tables, code) leak into app workspaces: reset them at zero specificity. */
:where(.lb-app, .lb-dialog) button { font: inherit; font-size: .9rem; font-weight: 600; padding: 0; border: 0; border-radius: 8px; background: none; color: inherit; cursor: pointer; width: auto; min-height: 0; margin: 0; }
:where(.lb-app, .lb-dialog) button:hover { background: none; }
:where(.lb-app, .lb-dialog) :is(input, select, textarea) { font: inherit; color: var(--lb-ink); background: var(--lb-surface); border: 1px solid var(--lb-control); border-radius: 8px; width: auto; margin: 0; }
:where(.lb-app, .lb-dialog) table { border-collapse: collapse; width: 100%; margin: 0; font-size: .9rem; }
:where(.lb-app, .lb-dialog) :is(th, td) { text-align: start; padding: 6px 8px; border-bottom: 1px solid var(--lb-line); vertical-align: top; }
:where(.lb-app, .lb-dialog) thead th { background: var(--lb-surface-2); color: var(--lb-ink); }
:where(.lb-app, .lb-dialog) kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; padding: 1px 6px; border: 1px solid var(--lb-control); border-bottom-width: 2px; border-radius: 5px; background: var(--lb-surface-2); color: var(--lb-ink); white-space: nowrap; }
:where(.lb-app, .lb-dialog) a { color: var(--lb-accent-ink); }
:where(.lb-app, .lb-dialog) :is(code, pre) { background: var(--lb-surface-2); color: var(--lb-ink); border-radius: 5px; }
:where(.lb-app, .lb-dialog) code { padding: 0 .25em; font-size: .9em; }
:where(.lb-app, .lb-dialog) pre { padding: .5rem .6rem; overflow: auto; max-width: 100%; }
:where(.lb-app, .lb-dialog) fieldset { border: 1px solid var(--lb-line); border-radius: 10px; padding: .5rem .7rem; margin: 0 0 .7rem; min-width: 0; }
:where(.lb-app, .lb-dialog) legend { font-weight: 700; font-size: .88rem; padding: 0 .3rem; }
:where(.lb-app, .lb-dialog) progress { width: 100%; height: 10px; accent-color: var(--lb-accent); }

.lb-app { display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; background: var(--lb-bg); color: var(--lb-ink); }
.lb-app :focus-visible, .lb-dialog :focus-visible { outline: 3px solid var(--lb-focus); outline-offset: 2px; }
.lb-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.lb-spacer, .lb-grow { flex: 1; min-width: 0; }
.lb-hint { color: var(--lb-muted); font-size: .84rem; margin: .25rem 0 .5rem; }
.lb-muted { color: var(--lb-muted); font-size: .85rem; }
.lb-note { font-size: .88rem; color: var(--lb-ink); background: var(--lb-surface-2); border-radius: 8px; padding: .5rem .7rem; margin: .4rem 0; }
.lb-error { color: var(--lb-warn); font-weight: 600; font-size: .88rem; margin: .2rem 0; }
.lb-wide { width: 100%; box-sizing: border-box; }
.lb-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; }
.lb-empty { color: var(--lb-muted); padding: 1.5rem 1rem; margin: 0; }

/* ---------- buttons */
.lb-btn { display: inline-flex; align-items: center; gap: .35rem; min-height: 34px; padding: .3rem .7rem; border: 1px solid var(--lb-control); border-radius: 8px; background: var(--lb-surface); color: var(--lb-ink); font-size: .86rem; white-space: nowrap; }
.lb-btn:hover:not([disabled]) { background: var(--lb-surface-2); }
.lb-btn[disabled], .lb-icon-btn[disabled] { opacity: .5; cursor: not-allowed; }
.lb-btn-primary, :is(.lb-app, .lb-dialog) button[type=submit].lb-btn-primary { background: var(--lb-accent); border-color: var(--lb-accent); color: var(--lb-on-accent); }
.lb-btn-primary:hover:not([disabled]), :is(.lb-app, .lb-dialog) button[type=submit].lb-btn-primary:hover:not([disabled]) { background: var(--lb-accent-ink); border-color: var(--lb-accent-ink); color: var(--lb-on-accent); }
.lb-btn-on { border-color: var(--lb-accent); box-shadow: inset 0 0 0 1px var(--lb-accent); }
.lb-icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid transparent; border-radius: 8px; color: var(--lb-ink); flex: none; }
.lb-icon-btn:hover:not([disabled]) { background: var(--lb-surface-2); border-color: var(--lb-line); }
.lb-icon-btn.lb-small { width: 28px; height: 28px; }
.lb-link-btn { color: var(--lb-accent-ink); text-decoration: underline; text-align: start; font-weight: 600; overflow-wrap: anywhere; }

/* ---------- toolbar */
.lb-toolbar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; padding: .4rem .8rem; background: var(--lb-surface); border-bottom: 1px solid var(--lb-line); }
.lb-tb-group { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem; min-width: 0; }
.lb-menu-wrap { position: relative; }
.lb-menu-btn { display: inline-flex; align-items: center; gap: .2rem; min-height: 34px; padding: .3rem .55rem; border-radius: 8px; color: var(--lb-ink); }
.lb-menu-btn:hover, .lb-menu-btn[aria-expanded="true"] { background: var(--lb-surface-2); }
.lb-menu { position: fixed; z-index: 40; min-width: 15rem; max-width: min(24rem, 94vw); max-height: calc(100dvh - 12px); overflow-y: auto; padding: .3rem; background: var(--lb-surface); color: var(--lb-ink); border: 1px solid var(--lb-control); border-radius: 10px; box-shadow: 0 12px 30px rgb(0 0 0 / .25); }
.lb-menu[hidden] { display: none; }
.lb-menu-item { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 1rem; min-height: 32px; padding: .35rem .6rem; border-radius: 6px; text-align: start; font-weight: 500; color: var(--lb-ink); }
.lb-menu-item:hover, .lb-menu-item:focus { background: var(--lb-surface-2); }
.lb-menu-item[aria-disabled="true"] { color: var(--lb-muted); cursor: not-allowed; }
.lb-menu-key { color: var(--lb-muted); font-size: .78rem; font-weight: 600; }
.lb-menu-sep { height: 1px; margin: .3rem .2rem; background: var(--lb-line); }
.lb-title { font-size: 1rem; font-weight: 700; padding: .3rem .5rem; border-radius: 8px; max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--lb-ink); }
.lb-title:hover { background: var(--lb-surface-2); }
.lb-banner { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; padding: .5rem .9rem; background: #fff4cc; color: #3d2f00; border-bottom: 1px solid #e3c766; font-weight: 600; }
:root[data-theme="dark"] .lb-banner { background: #3a3110; color: #fdf1c4; border-color: #6b5a1c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lb-banner { background: #3a3110; color: #fdf1c4; border-color: #6b5a1c; } }
.lb-banner[hidden] { display: none; }

/* ---------- board backgrounds (colour pair + optional pattern); white text keeps ≥ 4.5:1 on every pair */
.lb-bg-ocean { --bg1: #174a8b; --bg2: #1f3f73; }
.lb-bg-forest { --bg1: #1d6a3b; --bg2: #164a37; }
.lb-bg-sunset { --bg1: #a2421c; --bg2: #7a2f4f; }
.lb-bg-plum { --bg1: #5d2f8a; --bg2: #3e2a6d; }
.lb-bg-slate { --bg1: #3b4656; --bg2: #252c37; }
.lb-bg-sand { --bg1: #7a5a1c; --bg2: #5c4523; }
.lb-bg-rose { --bg1: #9e2a4d; --bg2: #6e2342; }
.lb-bg-teal { --bg1: #0f6466; --bg2: #134a5c; }
.lb-pat-none { --pat: none; --pat-size: auto; }
.lb-pat-dots { --pat: radial-gradient(rgb(255 255 255 / .17) 1.6px, transparent 1.8px); --pat-size: 18px 18px; }
.lb-pat-grid { --pat: linear-gradient(rgb(255 255 255 / .09) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / .09) 1px, transparent 1px); --pat-size: 26px 26px; }
.lb-pat-diagonal { --pat: repeating-linear-gradient(45deg, rgb(255 255 255 / .08) 0 2px, transparent 2px 14px); --pat-size: auto; }
.lb-pat-waves { --pat: radial-gradient(circle at 50% 120%, transparent 13px, rgb(255 255 255 / .1) 14px 16px, transparent 17px); --pat-size: 34px 20px; }
.lb-swatch { display: inline-block; width: 2.2rem; height: 1.4rem; border-radius: 6px; background-image: var(--pat, none), linear-gradient(160deg, var(--bg1), var(--bg2)); background-size: var(--pat-size, auto), auto; border: 1px solid var(--lb-line); flex: none; }

/* ---------- board bar */
.lb-boardbar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .8rem; padding: .45rem .8rem; background: linear-gradient(90deg, var(--bg1, #174a8b), var(--bg2, #1f3f73)); color: #ffffff; }
.lb-boardbar :focus-visible { outline-color: #fde68a; }
.lb-bb-left { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; min-width: 0; }
.lb-board-title { margin: 0; font-size: 1.12rem; font-weight: 800; color: #ffffff; overflow-wrap: anywhere; }
.lb-board-switch { min-height: 34px; max-width: 14rem; padding: .2rem .4rem; }
.lb-views { display: flex; gap: .2rem; padding: 2px; border-radius: 10px; background: rgb(0 0 0 / .22); }
.lb-view-tab { display: inline-flex; align-items: center; gap: .3rem; min-height: 32px; padding: .25rem .6rem; border-radius: 8px; color: #ffffff; }
.lb-view-tab[aria-selected="true"] { background: #ffffff; color: #172033; }
.lb-view-tab:hover:not([aria-selected="true"]) { background: rgb(255 255 255 / .16); }
.lb-bb-right { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-inline-start: auto; min-width: 0; }
.lb-search-wrap { position: relative; display: flex; align-items: center; color: var(--lb-muted); }
.lb-search-wrap svg { position: absolute; inset-inline-start: .5rem; pointer-events: none; color: #4b5568; }
.lb-search { min-height: 34px; width: 13rem; max-width: 46vw; padding: .2rem .5rem; padding-inline-start: 1.9rem; }

/* ---------- canvas, lists, cards */
.lb-main { position: relative; flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.lb-main:focus { outline: none; }
.lb-canvas { flex: 1; min-height: 0; overflow: auto; background-color: var(--bg2, #1f3f73); background-image: var(--pat, none), linear-gradient(160deg, var(--bg1), var(--bg2)); background-size: var(--pat-size, auto), auto; background-attachment: local, local; }
.lb-canvas > .lb-empty { color: #ffffff; }
.lb-lists { list-style: none; margin: 0; padding: .8rem; display: flex; align-items: flex-start; gap: .7rem; min-height: 100%; box-sizing: border-box; width: max-content; }
.lb-list { flex: none; width: 17.5rem; max-height: 100%; display: flex; }
.lb-list-inner { display: flex; flex-direction: column; width: 100%; max-height: calc(100dvh - 15rem); min-height: 0; background: var(--lb-list); color: var(--lb-ink); border-radius: 12px; box-shadow: 0 1px 2px rgb(0 0 0 / .25); }
.lb-list-head { display: flex; align-items: center; gap: .2rem; padding: .4rem .4rem 0; }
.lb-grip { display: inline-grid; place-items: center; width: 28px; height: 32px; border-radius: 6px; color: var(--lb-muted); cursor: grab; touch-action: none; flex: none; }
.lb-grip:hover { background: var(--lb-surface-2); color: var(--lb-ink); }
.lb-list-h { margin: 0; flex: 1; min-width: 0; font-size: .98rem; }
.lb-list-title { width: 100%; text-align: start; padding: .3rem .35rem; border-radius: 6px; font-size: .98rem; font-weight: 700; overflow-wrap: anywhere; color: var(--lb-ink); }
.lb-list-title:hover { background: var(--lb-surface-2); }
.lb-list-rename { flex: 1; min-width: 0; min-height: 34px; padding: .2rem .4rem; font-weight: 700; }
.lb-list-meta { display: flex; flex-wrap: wrap; gap: .2rem .5rem; padding: 0 .75rem .35rem; font-size: .8rem; color: var(--lb-muted); }
.lb-count-over { color: var(--lb-warn); font-weight: 700; }
.lb-wip-warn { display: inline-flex; align-items: center; gap: .2rem; color: var(--lb-warn); font-weight: 700; }
.lb-list-over .lb-list-inner { box-shadow: 0 0 0 3px var(--lb-warn); }
.lb-hidden-n { font-style: italic; }
.lb-cards { list-style: none; margin: 0; padding: .1rem .5rem .3rem; display: flex; flex-direction: column; gap: .45rem; overflow-y: auto; min-height: 2.2rem; }
.lb-card { position: relative; }
.lb-card-btn { display: flex; flex-direction: column; gap: .35rem; width: 100%; text-align: start; padding: .5rem .6rem; background: var(--lb-surface); color: var(--lb-ink); border-radius: 9px; box-shadow: 0 1px 1px rgb(0 0 0 / .18), 0 0 0 1px var(--lb-line); font-weight: 500; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.lb-card-btn:hover { box-shadow: 0 1px 2px rgb(0 0 0 / .2), 0 0 0 2px var(--lb-accent); }
.lb-card-title { font-size: .92rem; font-weight: 600; overflow-wrap: anywhere; line-height: 1.35; }
.lb-cover { display: block; height: 1.6rem; margin: -.5rem -.6rem 0; background: var(--lc); }
.lb-labels { display: flex; flex-wrap: wrap; gap: .25rem; }
.lb-label { display: inline-flex; align-items: center; max-width: 100%; padding: .05rem .4rem; border-radius: 5px; font-size: .74rem; font-weight: 700; line-height: 1.4; background: var(--lc-bg); color: var(--lc-ink); border-inline-start: 4px solid var(--lc); overflow-wrap: anywhere; }
.lb-card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem; }
.lb-badges { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; }
.lb-badge { display: inline-flex; align-items: center; gap: .2rem; padding: .05rem .35rem; border-radius: 5px; font-size: .76rem; font-weight: 600; color: var(--lb-muted); background: transparent; }
.lb-badge-ok { color: var(--lb-ok); }
.lb-due-overdue { background: #fde2e1; color: #8f1a1a; }
.lb-due-today { background: #fff1c2; color: #5f4500; }
.lb-due-soon { background: #fde7d3; color: #7f3500; }
.lb-due-later { background: var(--lb-surface-2); color: var(--lb-ink); }
.lb-due-done { background: #d7f5e3; color: #0d5a2e; }
:root[data-theme="dark"] :is(.lb-app, .lb-dialog) .lb-due-overdue { background: #5a1f1f; color: #ffd2cc; }
:root[data-theme="dark"] :is(.lb-app, .lb-dialog) .lb-due-today { background: #4a3c0b; color: #ffe9a3; }
:root[data-theme="dark"] :is(.lb-app, .lb-dialog) .lb-due-soon { background: #4d2c12; color: #ffd8b3; }
:root[data-theme="dark"] :is(.lb-app, .lb-dialog) .lb-due-done { background: #15432a; color: #bdf0d0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.lb-app, .lb-dialog) .lb-due-overdue { background: #5a1f1f; color: #ffd2cc; }
  :root:not([data-theme="light"]) :is(.lb-app, .lb-dialog) .lb-due-today { background: #4a3c0b; color: #ffe9a3; }
  :root:not([data-theme="light"]) :is(.lb-app, .lb-dialog) .lb-due-soon { background: #4d2c12; color: #ffd8b3; }
  :root:not([data-theme="light"]) :is(.lb-app, .lb-dialog) .lb-due-done { background: #15432a; color: #bdf0d0; }
}
.lb-avatars { display: inline-flex; flex-wrap: wrap; gap: 2px; margin-inline-start: auto; }
.lb-avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: .7rem; font-weight: 800; color: #ffffff; flex: none; letter-spacing: .02em; }
.lb-av-0 { background: #1f5fbf; } .lb-av-1 { background: #a1371b; } .lb-av-2 { background: #1d7a45; } .lb-av-3 { background: #7b3fb0; }
.lb-av-4 { background: #9b2c61; } .lb-av-5 { background: #0f6b80; } .lb-av-6 { background: #6b5800; } .lb-av-7 { background: #4a5566; }
.lb-add-card, .lb-add-list { display: flex; align-items: center; gap: .35rem; width: 100%; padding: .5rem .7rem; color: var(--lb-muted); border-radius: 0 0 12px 12px; font-weight: 600; text-align: start; }
.lb-add-card:hover { background: var(--lb-surface-2); color: var(--lb-ink); }
.lb-list-new .lb-add-list { border-radius: 12px; background: rgb(255 255 255 / .22); color: #ffffff; min-height: 44px; }
.lb-list-new .lb-add-list:hover { background: rgb(255 255 255 / .32); }
.lb-list-new .lb-list-inner { padding: .5rem; gap: .4rem; }
.lb-composer { padding: .2rem .5rem .5rem; display: grid; gap: .35rem; }
.lb-composer-input { width: 100%; box-sizing: border-box; padding: .4rem .5rem; resize: vertical; min-height: 36px; }
.lb-composer-actions { display: flex; flex-wrap: wrap; gap: .35rem; }

/* drag and drop */
.lb-lifted > .lb-card-btn, .lb-list.lb-lifted .lb-list-inner { box-shadow: 0 0 0 3px var(--lb-focus), 0 10px 22px rgb(0 0 0 / .3); transform: rotate(-1.5deg); }
.lb-dragging { opacity: .35; }
.lb-ghost { position: fixed; top: 0; left: 0; z-index: 60; pointer-events: none; margin: 0; list-style: none; opacity: .95; box-shadow: 0 16px 34px rgb(0 0 0 / .35); border-radius: 10px; }
.lb-drop-line { height: 4px; border-radius: 2px; background: var(--lb-focus); list-style: none; }
.lb-drop-col { flex: none; width: 6px; align-self: stretch; border-radius: 3px; background: #fde68a; list-style: none; }
body.lb-is-dragging, body.lb-is-dragging * { cursor: grabbing !important; user-select: none; }

/* ---------- table + calendar */
.lb-tableview, .lb-calview { flex: 1; min-height: 0; overflow: auto; padding: .8rem; background: var(--lb-bg); }
.lb-table-wrap { overflow-x: auto; max-width: 100%; position: relative; border: 1px solid var(--lb-line); border-radius: 10px; background: var(--lb-surface); }
.lb-table { min-width: 36rem; }
.lb-table caption { text-align: start; font-weight: 700; padding: .4rem .6rem; }
.lb-table tbody th { font-weight: 600; }
.lb-sort { display: inline-flex; align-items: center; gap: .3rem; font-weight: 700; color: var(--lb-ink); padding: .1rem .2rem; }
.lb-sort-ind { font-size: .7rem; }
.lb-cal-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin-bottom: .6rem; }
.lb-cal-title { margin: 0 .4rem; font-size: 1.1rem; min-width: 10rem; }
.lb-cal-wrap { overflow-x: auto; position: relative; border: 1px solid var(--lb-line); border-radius: 10px; background: var(--lb-surface); }
/* sub-pixel table widths would show a needless scrollbar where the 44rem calendar fits anyway */
@media (min-width: 50rem) { .lb-cal-wrap { overflow-x: hidden; } }
.lb-cal { table-layout: fixed; min-width: 44rem; }
.lb-cal th { text-align: center; font-size: .82rem; }
.lb-cal-day { height: 6.5rem; border-inline-end: 1px solid var(--lb-line); padding: .25rem; }
.lb-cal-out { background: var(--lb-surface-2); color: var(--lb-muted); }
.lb-cal-today { box-shadow: inset 0 0 0 2px var(--lb-accent); }
.lb-cal-num { display: block; font-weight: 700; font-size: .82rem; margin-bottom: .2rem; }
.lb-cal-today .lb-cal-num { color: var(--lb-accent-ink); }
.lb-cal-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; }
.lb-cal-card { display: flex; align-items: center; gap: .2rem; width: 100%; max-width: 100%; min-width: 0; padding: .1rem .3rem; border-radius: 5px; font-size: .76rem; font-weight: 600; text-align: start; overflow: hidden; white-space: nowrap; border-inline-start: 4px solid transparent; }
.lb-cal-card > span:not(.lb-sr) { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-cal-day { overflow: hidden; }
.lb-cal-card[class*="lb-cvb-"] { border-inline-start-color: var(--lc); }

/* ---------- label colours: --lc strong, --lc-bg chip background, --lc-ink chip text (≥ 4.5:1) */
:is(.lb-lc-green, .lb-cv-green, .lb-cvb-green) { --lc: #1f8a4c; --lc-bg: #d7f5e3; --lc-ink: #0b4d27; }
:is(.lb-lc-yellow, .lb-cv-yellow, .lb-cvb-yellow) { --lc: #d4a106; --lc-bg: #fdf0c2; --lc-ink: #5c4300; }
:is(.lb-lc-orange, .lb-cv-orange, .lb-cvb-orange) { --lc: #e0700f; --lc-bg: #fde3cc; --lc-ink: #7a3300; }
:is(.lb-lc-red, .lb-cv-red, .lb-cvb-red) { --lc: #d13a33; --lc-bg: #fddcdc; --lc-ink: #8a1717; }
:is(.lb-lc-purple, .lb-cv-purple, .lb-cvb-purple) { --lc: #8a4ccc; --lc-bg: #ecdffb; --lc-ink: #522083; }
:is(.lb-lc-blue, .lb-cv-blue, .lb-cvb-blue) { --lc: #2f6fd6; --lc-bg: #d9e7fd; --lc-ink: #143f8c; }
:is(.lb-lc-sky, .lb-cv-sky, .lb-cvb-sky) { --lc: #1495b8; --lc-bg: #d3f0f7; --lc-ink: #054e62; }
:is(.lb-lc-lime, .lb-cv-lime, .lb-cvb-lime) { --lc: #6aa012; --lc-bg: #e5f5c8; --lc-ink: #375500; }
:is(.lb-lc-pink, .lb-cv-pink, .lb-cvb-pink) { --lc: #d34a8d; --lc-bg: #fbdcea; --lc-ink: #851c50; }
:is(.lb-lc-grey, .lb-cv-grey, .lb-cvb-grey) { --lc: #6b7385; --lc-bg: #e6e8ec; --lc-ink: #353b45; }
:root[data-theme="dark"] :is(.lb-app, .lb-dialog) .lb-label { background: color-mix(in srgb, var(--lc) 30%, #11151d); color: #f3f5f9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.lb-app, .lb-dialog) .lb-label { background: color-mix(in srgb, var(--lc) 30%, #11151d); color: #f3f5f9; } }
.lb-dot { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; background: var(--lc); flex: none; }

/* ---------- dialogs */
.lb-dialog { width: min(34rem, calc(100vw - 1.5rem)); max-height: calc(100dvh - 1.5rem); padding: 0; border: 1px solid var(--lb-control); border-radius: 14px; background: var(--lb-surface); color: var(--lb-ink); box-shadow: 0 24px 60px rgb(0 0 0 / .35); }
.lb-dialog-wide { width: min(62rem, calc(100vw - 1.5rem)); }
.lb-dialog::backdrop { background: rgb(10 14 24 / .55); }
.lb-dialog-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1rem .5rem; background: var(--lb-surface); border-bottom: 1px solid var(--lb-line); }
.lb-dialog-head h2 { margin: 0; font-size: 1.15rem; overflow-wrap: anywhere; }
.lb-dialog-lede { margin: .5rem 0 0; padding: 0 1rem; color: var(--lb-muted); font-size: .9rem; }
.lb-dialog-body { padding: .6rem 1rem 1rem; }
.lb-dialog-body h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.lb-dialog-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.lb-form { display: grid; gap: .2rem; }
.lb-field { display: grid; gap: .2rem; margin: 0 0 .6rem; min-width: 0; }
.lb-field > label { font-weight: 600; font-size: .85rem; }
.lb-field :is(select, input, textarea) { min-height: 36px; padding: .3rem .5rem; min-width: 0; width: 100%; box-sizing: border-box; }
.lb-field textarea { resize: vertical; }
.lb-check { display: flex; align-items: flex-start; gap: .5rem; margin: .25rem 0; font-size: .9rem; }
.lb-check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--lb-accent); }
.lb-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .4rem .6rem; }
.lb-inline > .lb-field { flex: 1 1 11rem; margin-bottom: 0; }
.lb-inline > .lb-btn { margin-bottom: 1px; }
.lb-rows { list-style: none; margin: 0 0 .6rem; padding: 0; display: grid; gap: .35rem; }
.lb-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; padding: .3rem 0; border-bottom: 1px solid var(--lb-line); }
.lb-row > input[type=text] { flex: 1 1 10rem; min-height: 34px; padding: .2rem .45rem; min-width: 0; }
.lb-row > select { min-height: 34px; padding: .2rem .35rem; }
.lb-swatches { display: flex; flex-wrap: wrap; gap: .3rem .9rem; }
.lb-swatch-label { display: inline-flex; align-items: center; gap: .35rem; font-size: .88rem; min-height: 32px; }
.lb-swatch-label input { width: 18px; height: 18px; accent-color: var(--lb-accent); margin: 0; }
.lb-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .2rem .8rem; }
.lb-fs .lb-check { align-items: center; }
.lb-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .7rem; }
.lb-tcard { border: 1px solid var(--lb-line); border-radius: 12px; padding: .2rem .8rem .8rem; background: var(--lb-surface); }
.lb-tcard p { color: var(--lb-muted); font-size: .88rem; }
.lb-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .5rem; margin: .4rem 0 .8rem; }
.lb-metric { padding: .5rem .65rem; border: 1px solid var(--lb-line); border-radius: 10px; background: var(--lb-surface-2); }
.lb-metric dt { font-size: .78rem; color: var(--lb-muted); font-weight: 600; }
.lb-metric dd { margin: .1rem 0 0; font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.lb-figure { margin: .4rem 0 .6rem; }
.lb-svg { width: 100%; height: auto; display: block; border-radius: 10px; border: 1px solid var(--lb-line); }

/* card dialog */
.lb-cd-where { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; margin: 0 0 .6rem; color: var(--lb-muted); font-size: .9rem; }
.lb-tag-arch { display: inline-flex; align-items: center; gap: .25rem; color: var(--lb-warn); }
.lb-cd-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 0 1.4rem; }
.lb-cd-sec { margin-bottom: .6rem; min-width: 0; }
.lb-cd-sec > h3 { font-size: .95rem; margin: .7rem 0 .35rem; }
details.lb-cd-sec > summary { cursor: pointer; font-weight: 700; margin: .7rem 0 .35rem; }
.lb-chips { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.lb-toggle { display: inline-flex; align-items: center; gap: .3rem; min-height: 34px; padding: .2rem .45rem; border: 1px solid var(--lb-line); border-radius: 8px; color: var(--lb-ink); font-weight: 500; }
.lb-toggle svg { visibility: hidden; color: var(--lb-ok); }
.lb-toggle-on { border-color: var(--lb-accent); background: var(--lb-surface-2); }
.lb-toggle-on svg { visibility: visible; }
.lb-person { display: inline-flex; align-items: center; gap: .3rem; }
.lb-cl { margin: .4rem 0 .8rem; }
.lb-cl-head { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; }
.lb-cl-head h4 { margin: 0; font-size: .92rem; flex: 1; min-width: 0; }
.lb-cl-items { list-style: none; margin: .35rem 0; padding: 0; display: grid; gap: .1rem; }
.lb-cl-items li { display: flex; align-items: center; gap: .3rem; }
.lb-cl-items label { display: flex; align-items: center; gap: .5rem; flex: 1; min-height: 32px; min-width: 0; overflow-wrap: anywhere; }
.lb-cl-items input[type=checkbox] { width: 20px; height: 20px; flex: none; accent-color: var(--lb-accent); }
.lb-cl-done label span { text-decoration: line-through; color: var(--lb-muted); }
.lb-links { list-style: none; margin: 0 0 .4rem; padding: 0; display: grid; gap: .25rem; }
.lb-links li { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; overflow-wrap: anywhere; }
.lb-url { font-size: .78rem; overflow-wrap: anywhere; }
.lb-comments, .lb-activity { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .5rem; }
.lb-comments li { border: 1px solid var(--lb-line); border-radius: 10px; padding: .4rem .6rem; background: var(--lb-surface-2); }
.lb-com-head { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .6rem; margin: 0; }
.lb-com-text { margin: .25rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.lb-activity li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem .8rem; font-size: .86rem; border-bottom: 1px solid var(--lb-line); padding-bottom: .25rem; }

/* markdown */
.lb-md { overflow-wrap: anywhere; font-size: .93rem; line-height: 1.5; }
.lb-md :is(h4, h5, h6) { margin: .6rem 0 .3rem; font-size: 1rem; }
.lb-md p { margin: .35rem 0; }
.lb-md blockquote { margin: .4rem 0; padding: .2rem .7rem; border-inline-start: 4px solid var(--lb-line); color: var(--lb-muted); }
.lb-md-list { margin: .3rem 0; padding-inline-start: 1.4rem; }
.lb-md-task { list-style: none; margin-inline-start: -1.3rem; }
.lb-md-box { display: inline-grid; place-items: center; width: 1rem; height: 1rem; border: 2px solid var(--lb-control); border-radius: 4px; font-size: .7rem; vertical-align: -2px; color: var(--lb-ok); font-weight: 900; }
.lb-md-box-done { border-color: var(--lb-ok); }
.lb-md-table { overflow-x: auto; position: relative; margin: .4rem 0; }
.lb-md-table table { min-width: 18rem; }

/* date picker */
.lb-dp-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.lb-dp-month { margin: 0; font-size: 1.05rem; text-align: center; flex: 1; }
.lb-dp-grid { margin-top: .5rem; table-layout: fixed; }
.lb-dp-grid :is(th, td) { padding: 2px; text-align: center; border: 0; }
.lb-dp-grid thead th { background: none; font-size: .78rem; color: var(--lb-muted); }
.lb-dp-day { width: 100%; min-height: 40px; border-radius: 8px; font-variant-numeric: tabular-nums; color: var(--lb-ink); font-weight: 600; }
.lb-dp-day:hover { background: var(--lb-surface-2); }
.lb-dp-out { color: var(--lb-muted); font-weight: 400; }
.lb-dp-today { box-shadow: inset 0 0 0 2px var(--lb-accent); }
.lb-dp-sel { background: var(--lb-accent); color: var(--lb-on-accent); }
.lb-dp-sel:hover { background: var(--lb-accent-ink); }

/* ---------- status bar */
.lb-status { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; padding: .3rem .9rem; border-top: 1px solid var(--lb-line); background: var(--lb-surface); font-size: .82rem; color: var(--lb-muted); }
.lb-status-text { color: var(--lb-ink); font-weight: 600; }

.uwapp-root.uwapp-laneboard [hidden], .lb-dialog [hidden] { display: none !important; }

@media (forced-colors: active) {
  .lb-view-tab[aria-selected="true"], .lb-toggle-on { outline: 2px solid Highlight; }
  .lb-label { border: 1px solid CanvasText; }
  .lb-list-over .lb-list-inner { outline: 3px solid Mark; }
}
@media (prefers-reduced-motion: reduce) {
  .lb-lifted > .lb-card-btn, .lb-list.lb-lifted .lb-list-inner { transform: none; }
}
@media (max-width: 900px) {
  .lb-cd-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .lb-toolbar { padding: .35rem .5rem; gap: .3rem .5rem; }
  .lb-title { max-width: 11rem; }
  .lb-boardbar { padding: .4rem .5rem; }
  .lb-bb-right { margin-inline-start: 0; }
  .lb-search { width: 10rem; }
  .lb-list { width: min(82vw, 17.5rem); }
  .lb-lists { padding: .6rem; gap: .55rem; }
  .lb-list-inner { max-height: calc(100dvh - 17rem); }
  .lb-btn span + span { display: none; }
  .lb-tableview, .lb-calview { padding: .5rem; }
}
@media print {
  .lb-toolbar, .lb-status, .lb-add-card, .lb-list-new, .lb-grip, .lb-list-menu, .lb-bb-right, .lb-views, .lb-board-switch, .lb-banner { display: none !important; }
  .lb-canvas { overflow: visible; background: none; }
  .lb-boardbar { background: none; color: #000; }
  .lb-board-title { color: #000; }
  .lb-lists { flex-wrap: wrap; width: auto; }
  .lb-list-inner, .lb-cards { max-height: none; overflow: visible; box-shadow: 0 0 0 1px #999; }
}

/* Teamspaces chip in the status bar (public/teams.css styles the chip itself) */
.lb-ws-chip { display: inline-flex; min-width: 0; max-width: 100%; color: var(--lb-ink); }
.lb-ws-chip:empty { display: none; }
.uwapp-root.uwapp-laneboard .uwt-readonly { flex: none; }
