/* Project Tasks tab as a Monday-style board (js/taskboard.js). Each group sets --g to its colour. */
.tb-card .card-head { flex-wrap: wrap; gap: 8px; }
.tb-board { display: grid; gap: 22px; margin-top: 6px; }
.tb-group { --g: #579bfc; min-width: 0; }
.tb-ghead { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 2px; cursor: pointer; color: var(--g); font: 700 16px/1.2 var(--font-head, inherit); text-align: left; }
.tb-ghead .svg-ic { width: 16px; height: 16px; transition: transform .15s; }
.tb-group.shut .tb-ghead .svg-ic { transform: rotate(-90deg); }
.tb-gnote { font: 500 12.5px/1 var(--font-body, inherit); color: var(--ink-3); }
.tb-ghead:focus-visible { outline: 2px solid var(--g); outline-offset: 2px; border-radius: 6px; }

.tb-wrap { overflow-x: auto; margin-top: 6px; -webkit-overflow-scrolling: touch; }
.tb-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; border-left: 6px solid var(--g); border-radius: 6px 0 0 6px; font-size: 13.5px; }
.tb-table th, .tb-table td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); height: 40px; padding: 0; vertical-align: middle; background: var(--surface); }
.tb-table thead th { border-top: 1px solid var(--line); font-weight: 500; font-size: 12.5px; color: var(--ink-2); text-align: center; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-table thead th.tb-item { text-align: left; padding-left: 10px; }
.tb-table tbody tr:hover td { background: var(--surface-2); }
.tb-table tr.tb-sel td { background: color-mix(in srgb, var(--g) 10%, var(--surface)); }
.tb-table td.tb-ck, .tb-table th.tb-ck { text-align: center; }

.tb-box { width: 18px; height: 18px; border: 1.5px solid var(--line-2, var(--ink-3)); border-radius: 4px; background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; padding: 0; color: transparent; }
.tb-box .svg-ic { width: 12px; height: 12px; }
.tb-box[aria-pressed="true"] { background: var(--g); border-color: var(--g); color: #fff; }

.tb-item-in { display: flex; align-items: center; gap: 4px; padding: 0 6px 0 10px; min-width: 0; height: 40px; }
.tb-title { flex: 1 1 auto; min-width: 0; border: 0; background: none; padding: 4px 2px; text-align: left; color: var(--ink); font: inherit; cursor: text; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 4px; }
.tb-title:hover { box-shadow: inset 0 0 0 1px var(--line-2, var(--line)); }
.tb-title-in { flex: 1 1 auto; min-width: 0; height: 30px; padding: 3px 6px; font-size: 13.5px; }
.tb-bubble { flex: none; width: 30px; height: 30px; border: 0; background: none; color: var(--ink-3); border-radius: 6px; display: grid; place-items: center; cursor: pointer; }
.tb-bubble svg { width: 20px; height: 20px; }
.tb-bubble:hover, .tb-bubble:focus-visible { color: var(--accent); background: var(--surface-2); }
.tb-done .tb-title { text-decoration: line-through; color: var(--ink-3); }

.tb-cell { width: 100%; height: 40px; border: 0; background: none; padding: 0 6px; display: flex; align-items: center; justify-content: center; gap: 4px; font: inherit; color: var(--ink); cursor: pointer; overflow: hidden; white-space: nowrap; }
.tb-cell:hover { box-shadow: inset 0 0 0 1px var(--line-2, var(--ink-3)); }
.tb-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tb-late { color: var(--bad-ink, #b3261e); font-weight: 600; }
.tb-late .svg-ic { width: 14px; height: 14px; }
.tb-comment { justify-content: flex-start; color: var(--ink-2); text-overflow: ellipsis; display: block; text-align: left; line-height: 40px; }

.tb-av { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 11.5px; font-weight: 700; flex: none; letter-spacing: .02em; }
.tb-av.none { background: none; color: var(--ink-3); box-shadow: inset 0 0 0 1.5px var(--line-2, var(--line)); }
.tb-av.none svg { width: 18px; height: 18px; }

.tb-st .tb-status { color: #fff; font-weight: 500; transition: filter .1s; }
.tb-st .tb-status[style]:hover { filter: brightness(.94); box-shadow: none; }
.tb-pill { display: inline-block; max-width: 100%; padding: 3px 10px; border-radius: 999px; background: var(--g); color: #fff; font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.tb-pill.empty { background: none; color: var(--ink-3); }

.tb-add td { background: var(--surface); }
.tb-add-in { width: 100%; height: 38px; border: 0; background: transparent; padding: 0 10px; font: inherit; color: var(--ink); }
.tb-add-in::placeholder { color: var(--ink-3); }
.tb-add-in:focus { outline: 2px solid var(--g); outline-offset: -2px; background: var(--surface); }

.tb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 10px; padding: 8px 12px; border-radius: var(--r-sm, 8px); background: var(--accent-soft, var(--surface-2)); }
.tb-bar[hidden] { display: none; }
.tb-bar b { margin-right: 4px; }
.tb-help { margin: 14px 0 0; }

/* search and filters */
.tb-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 0 12px; }
.tb-search { position: relative; display: block; flex: 1 1 180px; max-width: 280px; }
.tb-search .svg-ic { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ink-3); pointer-events: none; }
.tb-search input { width: 100%; height: 34px; padding-left: 30px; }
.tb-f { width: auto; max-width: 190px; height: 34px; padding-top: 0; padding-bottom: 0; }
.tb-tools .btn.on { background: var(--accent-soft, var(--surface-2)); border-color: var(--accent); color: var(--ink); }
.tb-none { padding: 18px 4px; margin: 0; }

/* drag a row by its dots */
.tb-ck-in { display: flex; align-items: center; justify-content: center; gap: 3px; }
.tb-grip { width: 10px; height: 20px; display: grid; place-items: center; color: var(--ink-3); cursor: grab; opacity: 0; flex: none; }
.tb-grip svg { width: 8px; height: 14px; }
.tb-table tbody tr:hover .tb-grip { opacity: 1; }
@media (hover: none) { .tb-grip { display: none; } }
.tb-table tr.tb-dragging td { opacity: .45; }
.tb-table tr.tb-drop-before td { box-shadow: inset 0 3px 0 var(--g); }
.tb-table tr.tb-drop-after td { box-shadow: inset 0 -3px 0 var(--g); }
.tb-ghead.tb-drop-into { background: color-mix(in srgb, var(--g) 16%, transparent); border-radius: 6px; }
.tb-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }

/* the summary row under each group */
.tb-table tfoot td { background: none; border-right: 0; border-bottom: 0; height: 38px; padding: 0 6px; text-align: center; }
.tb-table tfoot td.tb-sumc { background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tb-table tfoot td.tb-sumc { border-left: 1px solid var(--line); }
.tb-battery { display: flex; gap: 1px; height: 22px; border-radius: 3px; overflow: hidden; }
.tb-battery span { min-width: 4px; }
.tb-battery .none { background: var(--line-2, var(--line)); }
.tb-sum-due { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the small panel under a cell */
.tb-pop { position: fixed; z-index: 60; min-width: 220px; max-width: min(560px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow: auto; padding: 12px; border-radius: var(--r, 12px); background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-pop, 0 8px 30px rgba(0,0,0,.18)); }
.tb-pop-h { font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.tb-pop-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.tb-labels { display: grid; grid-template-columns: repeat(4, minmax(110px, 1fr)); gap: 6px; }
.tb-lab { border: 0; border-radius: 4px; height: 32px; padding: 0 8px; font: 500 12.5px/1 var(--font-body, inherit); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-lab:hover, .tb-lab:focus-visible { filter: brightness(.92); outline: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink-3); }
.tb-people { display: grid; gap: 2px; }
.tb-people button { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 5px 8px; border-radius: 6px; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.tb-people button:hover, .tb-people button[aria-pressed="true"] { background: var(--surface-2); }
.tb-people button[aria-pressed="true"] span:last-child { font-weight: 700; }
.tb-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tb-dates label { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.tb-ta { width: min(420px, calc(100vw - 50px)); resize: vertical; }

/* Edit labels window */
.tb-lrow { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.tb-lcol { width: 38px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; flex: none; }
.tb-lname { flex: 1 1 auto; min-width: 0; }
.tb-ldone { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--ink-2); flex: none; white-space: nowrap; }
#tb-lrows { max-height: 52vh; overflow: auto; margin-bottom: 10px; }

@media (max-width: 600px) {
  .tb-search { flex-basis: 100%; max-width: none; }
  .tb-f { flex: 1 1 120px; max-width: none; }
  .tb-labels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tb-dates { grid-template-columns: 1fr; }
  .tb-pop { min-width: 0; }
}

/* ---------- groups: heading row, the ⋯ menu, add group (25 Nov) ---------- */
.tb-ghead-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-radius: 6px; }
.tb-ghead-row[draggable="true"] { cursor: grabbing; }
.tb-ghead-row.tb-drop-into { background: color-mix(in srgb, var(--g) 16%, transparent); }
.tb-group.tb-drop-before { box-shadow: 0 -3px 0 var(--g); }
.tb-group.tb-drop-after { box-shadow: 0 3px 0 var(--g); }
.tb-group.tb-dragging { opacity: .45; }
.tb-gmenu { width: 30px; height: 28px; border: 0; background: none; border-radius: 6px; color: var(--ink-3); display: grid; place-items: center; cursor: pointer; opacity: .6; }
.tb-gmenu svg { width: 18px; height: 18px; }
.tb-ghead-row:hover .tb-gmenu, .tb-gmenu:focus-visible { opacity: 1; }
.tb-gmenu:hover { background: var(--surface-2); color: var(--ink); }
.tb-addgroup { margin-top: 16px; }
.tb-rename { display: flex; gap: 6px; }
.tb-rename .input { flex: 1 1 auto; min-width: 180px; }
.tb-swatches { display: grid; grid-template-columns: repeat(7, 26px); gap: 6px; }
.tb-sw { width: 26px; height: 26px; border-radius: 50%; border: 0; cursor: pointer; padding: 0; }
.tb-sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.tb-pop-foot > span { display: flex; gap: 4px; }
.tb-danger { color: var(--bad-ink, #b3261e); }
@media (hover: none) { .tb-gmenu { opacity: 1; } }

/* ---------- subtasks ---------- */
.tb-subbtn { flex: none; display: inline-flex; align-items: center; gap: 2px; height: 24px; min-width: 24px; padding: 0 4px; border: 0; border-radius: 5px; background: none; color: var(--ink-3); font: 500 11.5px/1 var(--font-body, inherit); cursor: pointer; }
.tb-subbtn svg { width: 14px; height: 14px; transition: transform .15s; }
.tb-subbtn[aria-expanded="true"] svg { transform: rotate(90deg); }
.tb-subbtn:hover, .tb-subbtn:focus-visible { background: var(--surface-2); color: var(--ink); }
.tb-subbtn.add { opacity: 0; }
.tb-table tbody tr:hover .tb-subbtn.add, .tb-subbtn.add:focus-visible, .tb-subbtn.add[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .tb-subbtn.add { opacity: .7; } }
.tb-subrow .tb-item-in { padding-left: 34px; }
.tb-subrow td, .tb-subadd td { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.tb-subarrow { color: var(--ink-3); flex: none; font-size: 13px; }
.tb-sub-in { width: 100%; height: 34px; border: 0; background: transparent; padding: 0 10px 0 50px; font: inherit; font-size: 13px; color: var(--ink); }
.tb-sub-in::placeholder { color: var(--ink-3); }
.tb-sub-in:focus { outline: 2px solid var(--g); outline-offset: -2px; background: var(--surface); }
.tb-bubble { position: relative; }
.tb-bubble.has { color: var(--accent); }
.tb-badge { position: absolute; top: 0; right: -1px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 10px; line-height: 15px; font-weight: 700; }

/* ---------- her own columns ---------- */
.tb-tick { width: 20px; height: 20px; border-radius: 5px; border: 1.5px solid var(--line-2, var(--ink-3)); display: grid; place-items: center; color: #fff; }
.tb-tick.on { background: #00c875; border-color: #00c875; }
.tb-tick .svg-ic { width: 13px; height: 13px; }
.tb-num { justify-content: flex-end; font-variant-numeric: tabular-nums; }
.tb-text { justify-content: flex-start; display: block; text-align: left; line-height: 40px; text-overflow: ellipsis; color: var(--ink-2); }
.tb-linktext { color: var(--accent); text-decoration: underline; }
.tb-crow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.tb-cmove { display: flex; gap: 2px; flex: none; }
.tb-cname { flex: 1 1 160px; min-width: 0; }
.tb-ctype { width: 74px; flex: none; }
.tb-crm-gap { width: 32px; flex: none; }
.tb-copts { flex: 1 1 100%; margin-left: 64px; }
.tb-cadd { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tb-cadd .input:first-child { flex: 1 1 200px; }
.tb-cadd select { width: auto; }
#tb-crows { max-height: 52vh; overflow: auto; }

/* ---------- view switcher ---------- */
.tb-views { margin: 0 0 10px; }

/* ---------- Kanban ---------- */
.kb-opts, .gt-opts, .cal-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 10px; }
.kb-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; -webkit-overflow-scrolling: touch; }
.kb-col { flex: 0 0 252px; background: var(--surface-2); border-radius: 8px; display: flex; flex-direction: column; max-height: 75vh; }
.kb-col.kb-over { box-shadow: 0 0 0 2px var(--accent); }
.kb-col header { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px 8px 0 0; font-weight: 600; font-size: 13px; }
.kb-col header span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-cards { display: grid; gap: 8px; padding: 8px; overflow-y: auto; min-height: 30px; }
.kb-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--g); border-radius: 6px; padding: 8px 10px; cursor: grab; display: grid; gap: 6px; }
.kb-card.tb-dragging { opacity: .45; }
.kb-title { border: 0; background: none; padding: 0; text-align: left; font: 500 13.5px/1.3 var(--font-body, inherit); color: var(--ink); cursor: pointer; }
.kb-title:hover { color: var(--accent); }
.kb-card.tb-done .kb-title { text-decoration: line-through; color: var(--ink-3); }
.kb-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--ink-3); }
.kb-group { display: inline-flex; align-items: center; gap: 5px; }
.kb-group .tb-dot { width: 9px; height: 9px; }
.kb-subs { display: inline-flex; align-items: center; gap: 2px; }
.kb-subs svg { width: 13px; height: 13px; }
.kb-foot { display: flex; align-items: center; gap: 8px; }
.kb-due { font-size: 12px; color: var(--ink-2); margin-right: auto; }
.kb-foot > span:empty { margin-right: auto; }
.tb-av.sm { width: 22px; height: 22px; font-size: 9.5px; }
.kb-st { width: 26px; height: 24px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink-3); display: grid; place-items: center; cursor: pointer; }
.kb-st .svg-ic { width: 13px; height: 13px; }
.kb-add-in { margin: 0 8px 8px; height: 34px; border: 1px dashed var(--line-2, var(--line)); border-radius: 6px; background: transparent; padding: 0 10px; font: inherit; font-size: 13px; color: var(--ink); }
.kb-add-in:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--surface); border-style: solid; }

/* ---------- Gantt ---------- */
.gt-wrap { overflow: auto; max-height: 75vh; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); -webkit-overflow-scrolling: touch; }
.gt { position: relative; font-size: 13px; }
.gt-head { display: flex; position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line); }
.gt-name { position: sticky; left: 0; z-index: 2; flex: 0 0 var(--name); width: var(--name); display: flex; align-items: center; gap: 6px; padding: 0 8px; background: var(--surface); border-right: 1px solid var(--line); min-width: 0; }
.gt-corner { font-weight: 600; color: var(--ink-2); font-size: 12.5px; }
.gt-scale { position: relative; height: 44px; flex: none; }
.gt-months, .gt-ticks { position: relative; height: 22px; }
.gt-months span, .gt-ticks span { position: absolute; top: 0; height: 22px; line-height: 22px; padding-left: 4px; white-space: nowrap; overflow: hidden; border-left: 1px solid var(--line); font-size: 11.5px; color: var(--ink-2); }
.gt-months span { font-weight: 600; color: var(--ink); }
.gt-ticks span { color: var(--ink-3); }
.gt-ticks span.today { background: var(--accent); color: #fff; border-radius: 4px; }
.gt-body { position: relative; }
.gt-bg { position: absolute; top: 0; bottom: 0; left: var(--name); pointer-events: none; }
.gt-bg i { position: absolute; top: 0; bottom: 0; background: var(--surface-2); opacity: .7; }
.gt-bg b { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); }
.gt-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); z-index: 1; }
.gt-row { display: flex; height: 36px; border-bottom: 1px solid var(--line); position: relative; }
.gt-row.sub .gt-name { padding-left: 22px; font-size: 12.5px; }
.gt-grow { height: 34px; }
.gt-grow .gt-name { color: var(--g); font-weight: 700; border-left: 5px solid var(--g); }
.gt-title { border: 0; background: none; padding: 0; text-align: left; font: inherit; color: var(--ink); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.gt-title:hover { color: var(--accent); }
.gt-title.tb-done { text-decoration: line-through; color: var(--ink-3); }
.gt-lane { position: relative; flex: 1 1 auto; }
.gt-bar { position: absolute; top: 7px; height: 22px; border: 0; border-radius: 11px; background: var(--c); color: #fff; padding: 0 10px; font: 500 12px/22px var(--font-body, inherit); text-align: left; cursor: grab; overflow: hidden; white-space: nowrap; touch-action: none; z-index: 1; }
.gt-bar span { display: block; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.gt-bar.done { opacity: .55; }
.gt-bar.dragging { cursor: grabbing; box-shadow: 0 3px 10px rgba(0,0,0,.25); }
.gt-end { position: absolute; top: 0; right: 0; width: 10px; height: 100%; cursor: ew-resize; }
.gt-bar:hover .gt-end { background: rgba(255,255,255,.35); }
.gt-diamond { width: 18px; height: 18px; top: 9px; padding: 0; border-radius: 3px; transform: rotate(45deg); }
.gt-diamond.late { background: var(--bad-ink, #b3261e); }
.gt-due { position: absolute; top: 14px; width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); background: var(--ink-3); pointer-events: none; }
.gt-nodate { position: absolute; top: 7px; height: 22px; border: 1px dashed var(--line-2, var(--line)); border-radius: 11px; background: var(--surface); color: var(--ink-3); font-size: 11.5px; padding: 0 8px; cursor: pointer; white-space: nowrap; z-index: 1; }
.gt-nodate:hover { color: var(--ink); border-color: var(--ink-3); }

/* ---------- Calendar ---------- */
.cal-opts h3 { margin: 0; min-width: 150px; text-align: center; font-size: 16px; }
.cal { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cal-wd, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-wd span { padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cal-day { min-height: 104px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; background: var(--surface); }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.wkend { background: color-mix(in srgb, var(--surface-2) 50%, var(--surface)); }
.cal-day.out { opacity: .5; }
.cal-day.kb-over { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-dh { display: flex; justify-content: space-between; align-items: center; }
.cal-n { font-size: 12px; font-weight: 600; color: var(--ink-2); width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cal-n { background: var(--accent); color: #fff; }
.cal-plus { width: 22px; height: 22px; border: 0; border-radius: 5px; background: none; color: var(--ink-3); display: grid; place-items: center; cursor: pointer; opacity: 0; }
.cal-plus .svg-ic { width: 14px; height: 14px; }
.cal-day:hover .cal-plus, .cal-plus:focus-visible { opacity: 1; }
.cal-plus:hover { background: var(--surface-2); color: var(--ink); }
@media (hover: none) { .cal-plus { opacity: .7; } }
.cal-chip { display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; border: 0; border-left: 3px solid var(--g); border-radius: 4px; background: var(--surface-2); padding: 3px 6px; font: 500 12px/1.25 var(--font-body, inherit); color: var(--ink); text-align: left; cursor: pointer; }
.cal-chip:hover { filter: brightness(.96); }
.cal-chip.tb-dragging { opacity: .45; }
.cal-s { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--s, var(--line-2, #ccc)); }
.cal-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip.tb-done .cal-t { text-decoration: line-through; color: var(--ink-3); }
.cal-chip.late .cal-t { color: var(--bad-ink, #b3261e); font-weight: 600; }
.cal-list { display: none; }
.cal-li { display: grid; grid-template-columns: 64px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cal-li > div { display: grid; gap: 4px; }
.cal-li.today b { color: var(--accent); }

/* ---------- Updates ---------- */
.up-new { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 14px; display: grid; gap: 8px; }
.up-new textarea { width: 100%; resize: vertical; }
.up-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.up-row label.btn { cursor: pointer; }
#up-list { display: grid; gap: 10px; max-height: 50vh; overflow: auto; }
.up-item { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.up-item header { display: flex; align-items: center; gap: 10px; }
.up-item header div { display: grid; flex: 1 1 auto; min-width: 0; }
.up-item p { margin: 8px 0 0; overflow-wrap: anywhere; }
.up-img img { display: block; margin-top: 8px; max-width: 100%; max-height: 260px; border-radius: 6px; }
.up-none { margin: 4px 0; }

/* ---------- Automations ---------- */
.ru-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ru-row .input { width: auto; max-width: 100%; height: 34px; padding-top: 0; padding-bottom: 0; }
.ru-row.off { opacity: .55; }
.ru-then { font-size: 13px; color: var(--ink-2); }
.ru-ex { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 14px; }
#ru-rows { margin-bottom: 10px; }

/* ---------- Tasks screen: Workload and Dashboard ---------- */
.tk-modes { margin-bottom: 12px; }
.wl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 760px; }
.wl th, .wl td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: center; vertical-align: top; }
.wl thead th { font-weight: 500; color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.wl tbody th { text-align: left; font-weight: 600; white-space: nowrap; }
.wl tbody th > * { vertical-align: middle; margin-right: 6px; }
.wl-c.l1 { background: color-mix(in srgb, #00c875 16%, transparent); }
.wl-c.l2 { background: color-mix(in srgb, #fdab3d 26%, transparent); }
.wl-c.l3 { background: color-mix(in srgb, #ff642e 32%, transparent); }
.wl-c.l4 { background: color-mix(in srgb, #e2445c 40%, transparent); }
.wl-c summary { cursor: pointer; list-style: none; }
.wl-c summary::-webkit-details-marker { display: none; }
.wl-list { display: grid; gap: 6px; text-align: left; margin-top: 6px; min-width: 150px; }
.wl-list > div { display: grid; }
.tk-t { text-align: left; }
.db-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.db-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r, 12px); padding: 14px 16px; display: grid; gap: 2px; }
.db-tile b { font-size: 28px; line-height: 1.1; }
.db-tile span { color: var(--ink-2); font-size: 13px; }
.db-tile.bad b { color: var(--bad-ink, #b3261e); }
.db-tile.good b { color: #1f8a5b; }
.db-keys { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12.5px; }
.db-key { display: inline-flex; align-items: center; gap: 5px; }
.db-key i { width: 10px; height: 10px; border-radius: 3px; }
.db-t { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 620px; }
.db-t th, .db-t td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.db-t th { font-weight: 500; color: var(--ink-2); font-size: 12.5px; }
.db-bat { width: 32%; }
.db-person { display: inline-flex; align-items: center; gap: 8px; }

@media (max-width: 600px) {
  .cal-day { min-height: 54px; padding: 2px; }
  .cal-chip { padding: 2px 3px; font-size: 10.5px; border-left-width: 2px; }
  .cal-chip .cal-s, .cal-plus { display: none; }
  .cal-list { display: block; margin-top: 12px; }
  .cal-list .cal-chip { font-size: 13px; padding: 6px 8px; }
  .cal-list .cal-chip .cal-s { display: block; }
  .kb-col { flex-basis: 78vw; }
  .db-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tb-copts { margin-left: 0; }
}
