/* Widgets: the cards Ken chooses and fills (web/widgets.js) — shared by Live's table and the Board's tabs.
   Scoped to .lv (the Live page) and .wg (any other widget host, e.g. a Board tab). */

.wg .w svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.wg .w button { font: inherit; color: inherit; cursor: pointer; }

.wg .btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--hair-strong); background: rgba(255, 255, 255, .8); border-radius: 999px; padding: 5px 12px; font-size: 13px; text-decoration: none; color: var(--text); }

.wg .btn svg.i { width: 14px; height: 14px; }

.wg .pl-name a { color: inherit; text-decoration: none; }

.wg .pl-name a:hover { text-decoration: underline; text-underline-offset: 2px; }

@keyframes lv-flash { 0% { opacity: 1; } 35% { opacity: .9; } 100% { opacity: 0; } }

/* ---------- widgets ---------- */

:is(.lv, .wg) .w {
  position: relative; border-radius: var(--r-lg); padding: 12px 14px 10px; display: flex; flex-direction: column; min-width: 0;
  background: var(--glass-hi); border: 1px solid var(--glass-edge); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .6);
}

/* (a widget's width on the page grid is its size — see "the card grid" below) */

:is(.lv, .wg) .w.pinned { box-shadow: var(--shadow), 0 0 0 1.5px rgba(91, 91, 214, .35); }

:is(.lv, .wg) .w::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; opacity: 0; background: rgba(91, 91, 214, .07); box-shadow: inset 0 0 0 1.5px rgba(91, 91, 214, .4); }

:is(.lv, .wg) .w.flash::after { animation: lv-flash 1.8s cubic-bezier(.2, .8, .2, 1); }

:is(.lv, .wg) .w-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-height: 26px; padding-right: 6px; }

:is(.lv, .wg) .w-ico { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: #fff; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--hair); color: var(--muted); flex: none; }

:is(.lv, .wg) .w-ico svg.i { width: 13px; height: 13px; }

:is(.lv, .wg) .w-title { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

:is(.lv, .wg) .w-tag { font-size: 10px; font-weight: 600; color: var(--accent); background: rgba(91, 91, 214, .09); border-radius: 999px; padding: 0 7px; line-height: 17px; white-space: nowrap; }

:is(.lv, .wg) .w-tools { position: absolute; z-index: 2; top: 9px; right: 9px; display: flex; gap: 1px; padding: 2px; border-radius: 10px; background: rgba(255, 255, 255, .94); box-shadow: var(--shadow-sm), 0 0 0 1px var(--hair); opacity: 0; transition: opacity .2s; }

:is(.lv, .wg) .w:hover .w-tools, :is(.lv, .wg) .w:focus-within .w-tools, :is(.lv, .wg) .w.pinned .w-tools, :is(.lv, .wg) .w.why-open .w-tools { opacity: 1; }

:is(.lv, .wg) .w-btn { width: 24px; height: 24px; border-radius: 7px; border: 0; background: none; display: grid; place-items: center; color: var(--faint); }

:is(.lv, .wg) .w-btn:hover { background: rgba(17, 24, 39, .05); color: var(--text); }

:is(.lv, .wg) .w-btn svg.i { width: 13px; height: 13px; }

:is(.lv, .wg) .w-btn[aria-pressed="true"], :is(.lv, .wg) .w-btn[aria-expanded="true"] { color: var(--accent); }

:is(.lv, .wg) .w-btn[aria-pressed="true"] svg.i { fill: rgba(91, 91, 214, .2); }

:is(.lv, .wg) .w-why { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s cubic-bezier(.2, .9, .2, 1); }

:is(.lv, .wg) .w-why > div { overflow: hidden; min-height: 0; }

:is(.lv, .wg) .w.why-open .w-why { grid-template-rows: 1fr; }

:is(.lv, .wg) .w-why span { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; color: var(--accent); margin-top: 8px; }

:is(.lv, .wg) .w-why span svg.i { width: 11px; height: 11px; }

:is(.lv, .wg) .w-why p { margin: 2px 0 2px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }

:is(.lv, .wg) .w-body { margin-top: 10px; min-width: 0; }

:is(.lv, .wg) .w-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--hair); font-size: 11px; color: var(--faint); min-width: 0; }

:is(.lv, .wg) .w-foot time { margin-left: auto; flex: none; font-variant-numeric: tabular-nums; }

:is(.lv, .wg) .w-prov { min-width: 0; display: flex; }

:is(.lv, .wg) .w-note { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }

:is(.lv, .wg) .w-note b { color: var(--text); font-weight: 600; }

:is(.lv, .wg) .delta { font-size: 12px; font-weight: 600; display: inline-block; }

:is(.lv, .wg) .delta.up { color: var(--warn); }
 
:is(.lv, .wg) .delta.down { color: var(--ok); }

/* compare */

:is(.lv, .wg) .cmp { display: grid; gap: 0; font-size: 13px; }

:is(.lv, .wg) .cmp-row { display: grid; grid-template-columns: minmax(64px, .8fr) repeat(var(--n), minmax(0, 1fr)); align-items: center; border-top: 1px solid var(--hair); }

:is(.lv, .wg) .cmp-row:first-child { border-top: 0; }

:is(.lv, .wg) .cmp-row > span { padding: 7px 8px; min-width: 0; overflow-wrap: anywhere; display: block; }

:is(.lv, .wg) .cmp-h > span { font-weight: 600; color: var(--ink); font-size: 12.5px; padding-top: 4px; }

:is(.lv, .wg) .cmp-l { color: var(--faint); font-size: 11.5px; font-weight: 500; }

:is(.lv, .wg) .cmp .best { background: rgba(91, 91, 214, .06); color: var(--ink); font-weight: 600; }

:is(.lv, .wg) .cmp-h .best { border-radius: 10px 10px 0 0; }

:is(.lv, .wg) .cmp-row:last-child .best { border-radius: 0 0 10px 10px; }

:is(.lv, .wg) .cmp em { display: flex; align-items: center; gap: 3px; font-style: normal; font-size: 10px; color: var(--accent); font-weight: 600; margin-top: 1px; }

:is(.lv, .wg) .cmp em svg.i { width: 10px; height: 10px; }

/* gauge */

:is(.lv, .wg) .gauge { position: relative; display: grid; justify-items: center; }

:is(.lv, .wg) .gauge svg { width: 100%; max-width: 210px; height: auto; overflow: visible; }

:is(.lv, .wg) .g-track { fill: none; stroke: rgba(17, 24, 39, .07); stroke-width: 9; stroke-linecap: round; }

:is(.lv, .wg) .g-fill { fill: none; stroke: var(--ok); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 1.1s cubic-bezier(.2, .9, .2, 1); }

:is(.lv, .wg) .gauge.over .g-fill { stroke: var(--warn); }

:is(.lv, .wg) .g-target { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }

:is(.lv, .wg) .g-val { position: absolute; bottom: 0; display: grid; justify-items: center; }

:is(.lv, .wg) .g-val span { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); line-height: 1.1; display: inline-block; }

:is(.lv, .wg) .g-val small { font-size: 11px; color: var(--faint); }

:is(.lv, .wg) .g-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12px; color: var(--muted); }

:is(.lv, .wg) .g-foot b { color: var(--ink); }

/* timeline */

:is(.lv, .wg) .tl2 { --lw: 92px; position: relative; display: grid; gap: 7px; padding-top: 22px; }

:is(.lv, .wg) .tl2-lane { display: grid; grid-template-columns: var(--lw) 1fr; align-items: center; gap: 0; }

:is(.lv, .wg) .tl2-l { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 8px; }

:is(.lv, .wg) .tl2-track { position: relative; height: 12px; border-radius: 6px; background: rgba(17, 24, 39, .04); }

:is(.lv, .wg) .tl2-bar { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: var(--ink); opacity: .82; transition: left 1s cubic-bezier(.2, .9, .2, 1), width 1s cubic-bezier(.2, .9, .2, 1); }

:is(.lv, .wg) .tl2-bar.alt { background: var(--accent); opacity: .75; }

:is(.lv, .wg) .tl2-axis .tl2-track { background: none; height: 14px; }

:is(.lv, .wg) .tl2-axis .tl2-track span { position: absolute; top: 0; transform: translateX(-50%); font-size: 10.5px; color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }

:is(.lv, .wg) .tl2-axis .tl2-track span:first-child { transform: none; }

:is(.lv, .wg) .tl2-axis .tl2-track span:last-child { transform: translateX(-100%); }

:is(.lv, .wg) .tl2-marker { position: absolute; top: 0; bottom: 16px; left: calc(var(--lw) + (100% - var(--lw)) * var(--mf, 0)); width: 0; border-left: 1.5px dashed var(--warn); }

:is(.lv, .wg) .tl2-marker span { position: absolute; top: 0; left: 0; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; font-size: 10.5px; font-weight: 600; color: var(--warn); background: #fff; border-radius: 999px; padding: 1px 7px; box-shadow: 0 0 0 1px rgba(194, 65, 12, .2); }

:is(.lv, .wg) .tl2-marker span svg.i { width: 10px; height: 10px; }

/* checklist */

:is(.lv, .wg) .ck-prog { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }

:is(.lv, .wg) .ck-prog span { display: inline-block; white-space: nowrap; }

:is(.lv, .wg) .bar { flex: 1; height: 5px; border-radius: 3px; background: rgba(17, 24, 39, .06); overflow: hidden; }

:is(.lv, .wg) .bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--ok); transition: width .9s cubic-bezier(.2, .9, .2, 1); }

:is(.lv, .wg) .ck { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 1px; }

:is(.lv, .wg) .ck label { display: flex; align-items: center; gap: 9px; padding: 5px 6px; margin: 0 -6px; border-radius: 9px; cursor: pointer; font-size: 13.5px; }

:is(.lv, .wg) .ck label:hover { background: rgba(17, 24, 39, .035); }

:is(.lv, .wg) .ck label > span { flex: 1; min-width: 0; }

:is(.lv, .wg) .ck small { font-size: 11px; color: var(--faint); white-space: nowrap; }

:is(.lv, .wg) .ck input { appearance: none; width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--hair-strong); background: #fff; margin: 0; flex: none; display: grid; place-items: center; cursor: pointer; transition: background .15s, border-color .15s; }

:is(.lv, .wg) .ck input:checked { background: var(--ok); border-color: var(--ok); }

:is(.lv, .wg) .ck input:checked::after { content: ""; width: 7px; height: 3.5px; border: 1.8px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }

:is(.lv, .wg) .ck input:checked + span { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--hair-strong); }

/* stat */

:is(.lv, .wg) .st { display: grid; gap: 2px; }

:is(.lv, .wg) .st-v { font-size: 30px; font-weight: 700; letter-spacing: -0.035em; color: var(--ink); line-height: 1.1; display: inline-block; }

:is(.lv, .wg) .st-l { font-size: 12.5px; color: var(--muted); }

:is(.lv, .wg) .st-l b { color: var(--text); }

/* people */

:is(.lv, .wg) .ppl-n { font-size: 11.5px; color: var(--faint); font-weight: 500; display: inline-block; }

:is(.lv, .wg) .ppl { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; }

:is(.lv, .wg) .ppl li { display: flex; align-items: center; gap: 9px; font-size: 13.5px; padding: 3px 0; min-width: 0; }

:is(.lv, .wg) .av { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--text); background: #fff; box-shadow: inset 0 0 0 1.5px var(--c, var(--hair-strong)); }

:is(.lv, .wg) .ppl .pn { font-weight: 500; white-space: nowrap; }

:is(.lv, .wg) .ppl small { font-size: 12px; color: var(--faint); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

:is(.lv, .wg) .ppl em { margin-left: auto; font-style: normal; font-size: 10px; font-weight: 600; color: var(--accent); background: rgba(91, 91, 214, .09); border-radius: 999px; padding: 0 7px; line-height: 17px; }

/* place (drawn mini-map, no images) */

:is(.lv, .wg) .map { border-radius: 12px; overflow: hidden; height: 84px; box-shadow: inset 0 0 0 1px var(--hair); }

:is(.lv, .wg) .map svg { width: 100%; height: 100%; display: block; }

:is(.lv, .wg) .m-bg { fill: #eef0f3; }
 
:is(.lv, .wg) .m-st { stroke: #fff; stroke-width: 5; fill: none; }
 
:is(.lv, .wg) .m-main { stroke: #fff; stroke-width: 9; fill: none; }

:is(.lv, .wg) .m-park { fill: rgba(15, 159, 110, .14); }
 
:is(.lv, .wg) .m-lbl { font: 600 8px Inter, system-ui; fill: var(--faint); }

:is(.lv, .wg) .m-halo { fill: rgba(91, 91, 214, .16); }
 
:is(.lv, .wg) .m-pin { fill: var(--accent); stroke: #fff; stroke-width: 2; }

:is(.lv, .wg) .pl-name { font-size: 15px; font-weight: 600; color: var(--ink); margin-top: 10px; letter-spacing: -0.01em; }

:is(.lv, .wg) .pl-addr { font-size: 12.5px; color: var(--muted); }

:is(.lv, .wg) .pl-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 12.5px; color: var(--text); }

:is(.lv, .wg) .pl-meta span { display: inline-flex; align-items: center; gap: 4px; }

:is(.lv, .wg) .pl-meta svg.i { width: 12px; height: 12px; color: var(--faint); }

:is(.lv, .wg) .pl-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }

:is(.lv, .wg) .pl-tags span { font-size: 11px; color: var(--muted); background: rgba(17, 24, 39, .045); border-radius: 999px; padding: 1px 8px; }

/* file */

:is(.lv, .wg) .fl { display: flex; gap: 12px; align-items: center; }

:is(.lv, .wg) .fl-prev { position: relative; flex: none; width: 54px; height: 68px; border-radius: 8px; background: #fff; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--hair-strong); padding: 9px 8px; display: grid; align-content: start; gap: 4px; }

:is(.lv, .wg) .fl-prev i { display: block; height: 3px; border-radius: 2px; background: rgba(17, 24, 39, .12); }

:is(.lv, .wg) .fl-prev i.s { width: 60%; }

:is(.lv, .wg) .fl-prev .fr { height: 13px; border-radius: 3px; background: rgba(91, 91, 214, .12); }

:is(.lv, .wg) .fl-prev .fr.b { width: 55%; }

:is(.lv, .wg) .fl-prev span { position: absolute; bottom: 5px; left: 6px; font-size: 8.5px; font-weight: 700; letter-spacing: .04em; color: var(--warn); }

:is(.lv, .wg) .fl-figma span { color: var(--accent); }

:is(.lv, .wg) .fl-b { min-width: 0; display: grid; gap: 2px; justify-items: start; }

:is(.lv, .wg) .fl-name { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.3; display: inline-block; }

:is(.lv, .wg) .fl-meta { font-size: 12px; color: var(--faint); }

:is(.lv, .wg) .fl .btn { margin-top: 6px; padding: 3px 10px; font-size: 12px; }

/* countdown */

:is(.lv, .wg) .cd { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

:is(.lv, .wg) .cd-u { display: grid; justify-items: center; padding: 8px 0 6px; border-radius: 12px; background: rgba(17, 24, 39, .035); }

:is(.lv, .wg) .cd-u b { font-size: 24px; font-weight: 700; color: var(--ink); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.15; display: inline-block; }

:is(.lv, .wg) .cd-u small { font-size: 10.5px; color: var(--faint); }

:is(.lv, .wg) .cd-at { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; color: var(--text); font-weight: 500; }

:is(.lv, .wg) .cd-at svg.i { width: 13px; height: 13px; color: var(--faint); }

/* quote */

:is(.lv, .wg) .qt { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink); letter-spacing: -0.01em; position: relative; padding-left: 12px; border-left: 2px solid var(--hair-strong); }

:is(.lv, .wg) .qt-who { display: flex; align-items: center; gap: 7px; margin-top: 8px; font-size: 12px; color: var(--muted); }

:is(.lv, .wg) .qt-who .av { width: 20px; height: 20px; font-size: 10px; }


/* ======================================================================
   Provenance badges
   ====================================================================== */

:is(.lv, .wg) .prov { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; font-size: 11px; font-weight: 500; color: var(--muted); background: rgba(17, 24, 39, .04); border-radius: 999px; padding: 1px 8px 1px 6px; line-height: 17px; }

:is(.lv, .wg) .prov > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

:is(.lv, .wg) .prov svg.i { width: 11px; height: 11px; flex: none; }

:is(.lv, .wg) .prov--hear svg.i { color: var(--live); }

:is(.lv, .wg) .prov--browse svg.i { color: var(--accent); }

:is(.lv, .wg) .prov--type svg.i { color: var(--ok); }

:is(.lv, .wg) .prov--web svg.i, :is(.lv, .wg) .prov--data svg.i { color: var(--muted); }

:is(.lv, .wg) .prov.hl { animation: lv-provhl 2.2s cubic-bezier(.2, .8, .2, 1); }

@keyframes lv-provhl { 0%, 30% { background: rgba(91, 91, 214, .16); color: var(--ink); box-shadow: 0 0 0 3px rgba(91, 91, 214, .1); } 100% { background: rgba(17, 24, 39, .04); } }

/* ---------- real-app fixes (the app's global form styles; marker labels at the edges) ---------- */
:is(.lv, .wg) .ck label { flex-direction: row; text-align: left; font-weight: 400; color: var(--text); }
:is(.lv, .wg) .ck input[type="checkbox"], :is(.lv, .wg) .ck input[type="checkbox"]:focus { width: 16px; height: 16px; padding: 0; box-shadow: none; accent-color: initial; }
:is(.lv, .wg) .ck input[type="checkbox"]:checked { background: var(--ok); border-color: var(--ok); }
:is(.lv, .wg) .tl2-marker.end span { transform: translateX(-100%); }
:is(.lv, .wg) .tl2-marker.start span { transform: none; }

/* ---------- table (any columns, sortable) ---------- */

:is(.lv, .wg) .wtb { overflow-x: auto; margin: 0 -4px; }

:is(.lv, .wg) .wtb table { width: 100%; border-collapse: collapse; font-size: 13px; }

:is(.lv, .wg) .wtb th, :is(.lv, .wg) .wtb td { padding: 6px 8px; text-align: left; border-top: 1px solid var(--hair); vertical-align: top; overflow-wrap: anywhere; }

:is(.lv, .wg) .wtb thead th { border-top: 0; padding-top: 2px; white-space: nowrap; }

:is(.lv, .wg) .wtb th button { border: 0; background: none; padding: 0; font-size: 11.5px; font-weight: 600; color: var(--muted); display: inline-flex; gap: 3px; }

:is(.lv, .wg) .wtb th[aria-sort="ascending"] button, :is(.lv, .wg) .wtb th[aria-sort="descending"] button { color: var(--ink); }

:is(.lv, .wg) .wtb td { color: var(--text); font-variant-numeric: tabular-nums; }

:is(.lv, .wg) .wtb tbody tr:hover td { background: rgba(17, 24, 39, .025); }

:is(.lv, .wg) .wtb .al-right { text-align: right; }

:is(.lv, .wg) .wtb .al-center { text-align: center; }

/* ---------- doc (markdown the agent writes; editable on the Board) ---------- */

:is(.lv, .wg) .wdoc { font-size: 13.5px; line-height: 1.55; color: var(--text); }

:is(.lv, .wg) .wdoc .md h3 { font-size: 16px; }

:is(.lv, .wg) .wdoc .md h4 { font-size: 14.5px; }

:is(.lv, .wg) .wdoc .md table { font-size: 13px; }

:is(.lv, .wg) .wdoc-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

:is(.lv, .wg) .wdoc-ed { width: 100%; min-height: 280px; resize: vertical; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }

@container (min-width: 720px) {

:is(.lv, .wg) .w.w--doc, :is(.lv, .wg) .w.w--kanban { grid-column: 1 / -1; }

}

/* ---------- kanban ---------- */

:is(.lv, .wg) .wkb { display: grid; grid-template-columns: repeat(var(--n), minmax(140px, 1fr)); gap: 8px; overflow-x: auto; }

:is(.lv, .wg) .wkb-col { background: rgba(17, 24, 39, .035); border-radius: 12px; padding: 8px; display: grid; gap: 6px; align-content: start; min-width: 0; }

:is(.lv, .wg) .wkb-h { display: flex; justify-content: space-between; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 0 2px; }

:is(.lv, .wg) .wkb-h span { color: var(--faint); font-variant-numeric: tabular-nums; }

:is(.lv, .wg) .wkb-card { background: #fff; border-radius: 9px; padding: 7px 9px; font-size: 13px; line-height: 1.35; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--hair); overflow-wrap: anywhere; }

:is(.lv, .wg) .wkb-card small { display: block; color: var(--faint); font-size: 11.5px; margin-top: 2px; }

/* ---------- a widget host outside Live (the Board's tabs) ---------- */

/* ---------- the card grid: every card page (Board, project pages, Board tabs, Live's table) ----------
   12 columns; a card is s (≈ a third), m (≈ half) or l (the full row) — chosen by Ken, derived from what the card holds, or
   picked by you. Narrow hosts fall back to two columns, then one. Dense flow fills the gaps a mix of sizes leaves. */

:is(.cgrid, .lv .table) { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 14px; align-items: start; container-type: inline-size; }

:is(.cgrid, .lv .table) > * { grid-column: span 12; min-width: 0; }

/* packed (widgets.js packGrid): thin rows, each card spanning its own height — the gap comes from the span */
:is(.cgrid, .lv .table).packed { grid-auto-rows: 2px; row-gap: 0; }

@container (min-width: 480px) {
  :is(.cgrid, .lv .table) > :is(.sz-s, .sz-m) { grid-column: span 6; }
}

@container (min-width: 720px) {
  :is(.cgrid, .lv .table) > .sz-s { grid-column: span 4; }
}

/* the size control (a card's menu): S · M · L · Auto */

.csize { position: relative; display: inline-flex; }

.csize-menu { position: absolute; z-index: 60; top: calc(100% + 4px); right: 0; display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: #fff; box-shadow: var(--shadow), 0 0 0 1px var(--hair-strong); white-space: nowrap; }

.csize-menu[hidden] { display: none; }

.csize-menu button { font: inherit; font-size: 12px; min-width: 30px; height: 26px; padding: 0 8px; border: 0; border-radius: 7px; background: none; color: var(--muted); cursor: pointer; box-shadow: none; }

.csize-menu button:hover { background: rgba(17, 24, 39, .05); color: var(--text); }

.csize-menu button.on { background: rgba(91, 91, 214, .1); color: var(--accent); font-weight: 600; }

.w-size { display: inline-flex; }

.w-size .csize-btn { width: 24px; height: 24px; border-radius: 7px; }

.csize-btn { width: 26px; height: 26px; border-radius: 8px; border: 0; background: none; display: grid; place-items: center; color: var(--faint); cursor: pointer; padding: 0; box-shadow: none; }

.csize-btn:hover { background: rgba(17, 24, 39, .05); color: var(--text); }

.csize-btn svg.i { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.wg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); grid-auto-flow: dense; gap: 12px; align-items: start; container-type: inline-size; }

.wg .w-by { font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.wg .w.mine .w-by { color: var(--accent); }

/* ---------- the Board's tab strip (projects.js): the page's own view, then its extra tabs ---------- */

.btabs-wrap { margin: 0 0 14px; }

.btabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.btabs .chip-btn { display: inline-flex; align-items: center; gap: 5px; }

.btabs .btab-add { border-style: dashed; color: var(--muted); }

.btab-pin svg.i { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }

.btab-ask { margin: 10px 0 0; }

.btab-head { align-items: flex-start; gap: 12px; }

.btab-head h2 { margin: 0; }

/* ---------- tabs first (projects.js): counts, built-in tabs, "organizing", the Overview's tab cards ---------- */

.btabs .btab-n { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }

.btabs .chip-btn.on .btab-n { color: rgba(255, 255, 255, .65); }

.btabs .btab-builtin:not(.on) { background: transparent; color: var(--muted); }

.btab-busy { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; }

.btab-spin { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--hair-strong); border-top-color: var(--accent); animation: btab-spin .9s linear infinite; }

@keyframes btab-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) { .btab-spin { animation: none; } }

.btab-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }

.btab-card { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 11px 14px; text-align: left; font: inherit; color: inherit; cursor: pointer; border-radius: var(--r-lg, 14px); min-width: 0; }

.btab-card:hover { box-shadow: var(--shadow), 0 0 0 1.5px rgba(91, 91, 214, .25); }

.btab-card-title { display: flex; width: 100%; align-items: baseline; gap: 6px; font-weight: 600; font-size: 14px; color: var(--ink); }

.btab-card-go { margin-left: auto; color: var(--faint); }

.btab-card-sub { font-size: 12px; color: var(--muted); }

.btab-card-why { font-size: 12px; color: var(--faint); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.btab-card.builtin { background: rgba(255, 255, 255, .35); }

/* a group of workstreams on a tab: a titled run of the Board's own cards, not a card around cards */
.wg .w.w--workstreams { background: none; border: 0; box-shadow: none; padding: 0; }

.wg .w.w--workstreams > .w-head { padding: 0 2px 8px; }

.wg .w.w--workstreams > .w-foot { display: none; }

.wg .w.w--workstreams > .w-body > .w-note { margin: 0 2px 8px; }

/* Live's "Add to Board" menu (live.js) */
.w-board-menu { position: fixed; z-index: 80; display: flex; flex-direction: column; min-width: 190px; max-height: 60vh; overflow: auto; padding: 4px; border-radius: 12px; background: #fff; box-shadow: var(--shadow), 0 0 0 1px var(--hair-strong); }

.w-board-menu button { font: inherit; font-size: 13px; text-align: left; padding: 7px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); cursor: pointer; box-shadow: none; }

.w-board-menu button:hover { background: rgba(17, 24, 39, .05); }

.w-board-menu .muted { padding: 6px 10px 2px; font-size: 11px; color: var(--faint); }

/* a page Overview's lists stay short: each row keeps "Done"; its other actions, history & edit and the agent's note are in
   the full lists (the tab "Show all" opens) */
.bnow :is(.pm-trail, .pm-agent, .pm-item-actions > .ghost) { display: none; }

/* phones: the tab strip scrolls sideways inside itself, the tab cards go two to a row */
@media (max-width: 640px) {
  .btabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .btabs::-webkit-scrollbar { display: none; }
  .btabs > * { flex: none; }
  .btab-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .btab-card { padding: 9px 11px; }
  .btab-card-why { display: none; }
}

/* ---------- rows that point at things (widgets.js refRowHtml): summary lines, checklist rows with refs, workstream cards ---------- */
.wl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.wl { display: flex; align-items: flex-start; gap: 9px; padding: 4px 6px; margin: 0 -6px; border-radius: 9px; font-size: 13px; line-height: 1.4; min-width: 0; }
.wl:hover { background: rgba(17, 24, 39, .035); }
.wl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; margin-top: 6px; }
.wl > input[type="checkbox"] { flex: none; margin-top: 2px; width: 15px; height: 15px; padding: 0; box-shadow: none; }
.wl-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.wl-text { display: inline; height: auto; line-height: inherit; font: inherit; color: var(--text); text-align: left; padding: 0; border: 0; background: none; box-shadow: none; min-width: 0; overflow-wrap: anywhere; }
button.wl-text { cursor: pointer; }
button.wl-text:hover { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--hair-strong); }
.wl-meta { display: inline-flex; flex-wrap: wrap; gap: 0 6px; font-size: 11.5px; color: var(--faint); }
.wl-meta span + span::before { content: "·"; margin-right: 6px; }
.wl.t-warn .wl-meta span:first-child { color: var(--warn); }
.wl-note { flex-basis: 100%; font-size: 12px; color: var(--muted); }
.wl.done .wl-text { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--hair-strong); }
.wl-tools { display: inline-flex; gap: 2px; flex: none; }
.wl-btn { font: inherit; font-size: 11.5px; height: 22px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--hair-strong); background: #fff; color: var(--text); cursor: pointer; box-shadow: none; }
.wl-btn:hover { border-color: var(--accent); color: var(--accent); }
.wl-more { border-color: transparent; background: none; color: var(--faint); padding: 0 6px; }
.wsum-head { margin: 2px 0 6px; font-size: 14px; line-height: 1.45; color: var(--ink); font-weight: 500; }
.wl-menu { position: fixed; z-index: 80; display: flex; flex-direction: column; min-width: 200px; max-height: 60vh; overflow: auto; padding: 4px; border-radius: 12px; background: #fff; box-shadow: var(--shadow), 0 0 0 1px var(--hair-strong); }
.wl-menu > button { font: inherit; font-size: 13px; text-align: left; padding: 7px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); cursor: pointer; box-shadow: none; }
.wl-menu > button:hover { background: rgba(17, 24, 39, .05); }
.wl-menu > button.danger { color: var(--danger, #c0392b); }
.wl-menu .delegate, .wl-menu .chips { padding: 8px; }

/* a workstream card's own obligations (projects.js itemCard) */
.bobl { padding: 6px 18px 8px; border-top: 1px solid var(--hair); }
.bobl .wl-list { gap: 0; }
.bobl-more { font-size: 12px; }

/* an Overview's tab links: one compact row */
.btab-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.btab-row .btab-n { margin-left: 4px; }

/* the rundown card on top of an Overview */
.wg .w.w--summary { padding-bottom: 8px; }
.wg .w.w--summary > .w-foot { padding-top: 2px; }
/* a wide rundown reads in two columns (wide screens), so the Overview stays about one screen */
@media (min-width: 1200px) { .wg .w.w--summary.sz-l .wsum { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 22px; } }
