/* Tasks module styles (setup screens now; task screens in later increments) */
.ta-card { padding: 18px 20px; margin-bottom: 16px; }
.ta-card h3 { font-size: calc(15px * var(--fs, 1)); font-weight: 600; margin: 0 0 6px; color: var(--ink); }
.ta-help { font-size: calc(12px * var(--fs, 1)); color: var(--ink-soft); line-height: 1.5; margin: 0 0 10px; }
.ta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ta-row > select, .ta-row > input:not([type=checkbox]):not([type=number]) { flex: 1 1 200px; max-width: 340px; }
.ta-check { display: inline-flex; align-items: center; gap: 6px; font-size: calc(13px * var(--fs, 1)); margin-right: 10px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink); }
.ta-check input { width: auto; }
.ta-muted { color: var(--ink-mute); font-size: calc(12px * var(--fs, 1)); }
.ta-subtabs { margin-bottom: 16px; }
.ta-type-teams { padding: 12px; background: var(--surface-2); border-radius: var(--radius-lg); }
.ta-type-teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 12px; }
/* "Selected now" chips above tick lists; editors opened under their table row (Org teams) */
.ta-selected { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0 0 10px; font-size: calc(12.5px * var(--fs, 1)); }
.ta-sel-chip { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 999px; padding: 1px 9px; font-weight: 500; }
.ta-mem-in td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.ta-inline-row > td { padding: 6px 10px 14px !important; background: var(--surface-2); white-space: normal; }
.ta-inline-row .ta-card { margin: 0; box-shadow: none; }
.th-keep .ppl-table th { position: sticky; top: 0; z-index: 2; }
.ta-type-teams-grid .ta-check { display: flex; align-items: center; gap: 8px; margin: 0; min-height: 32px; }
.ppl-table td .ta-type-teams input[type=checkbox] { min-width: 0; width: 16px; height: 16px; flex-shrink: 0; }
.ta-esc { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: calc(13px * var(--fs, 1)); }
.ppl-table td input, .ppl-table td select { min-width: 120px; }

@media (max-width: 600px) {
  .ta-card { padding: 14px; }
  .ta-row > select, .ta-row > input:not([type=checkbox]):not([type=number]) { max-width: none; }
  .ta-esc { flex-direction: column; align-items: stretch; }
}

/* ---------- Task screens ---------- */
.tk-tabs { flex-wrap: wrap; }
.tk-badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: calc(11px * var(--fs, 1)); line-height: 18px; text-align: center; font-weight: 600; }
.tk-badge-soft { background: var(--surface-alt); color: var(--ink-soft); } /* a count to know, not something to act on */
.tk-filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.tk-filters input { flex: 1 1 240px; }
.tk-filters select { flex: 0 1 220px; }
.tk-list { overflow: hidden; }
.tk-row { display: flex; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.tk-row:last-child { border-bottom: none; }
.tk-row:hover { background: var(--surface-2); }
/* "My tasks": rows where it is my turn come first and stand out */
.tk-row-turn { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); }
.tk-row-turn:hover { background: #dbeafe; }
.tk-turn { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 10px; background: var(--accent); color: #fff; font-size: calc(11px * var(--fs, 1)); font-weight: 600; vertical-align: 1px; }
.tk-row-main { flex: 1; min-width: 0; }
.tk-row-title { font-size: calc(14px * var(--fs, 1)); }
.tk-form input:not([type=file]):not([type=radio]):not([type=checkbox]), .tk-form select { width: 100%; box-sizing: border-box; }
.tk-row-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 6px; font-size: calc(12px * var(--fs, 1)); color: var(--ink-soft); }
.tk-row-due { text-align: right; font-size: calc(13px * var(--fs, 1)); white-space: nowrap; }
.tk-num { font-family: var(--mono, ui-monospace), Consolas, monospace; font-size: calc(13px * var(--fs, 1)); font-weight: 600; color: var(--ink-mute); margin-right: 6px; }
.tk-overdue { color: var(--danger) !important; font-weight: 600; }

.tk-pill { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: calc(11px * var(--fs, 1)); font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.tk-s-new { background: #eef2ff; color: #3730a3; }
.tk-s-in_progress { background: #e0f2fe; color: #075985; }
.tk-s-awaiting_clarification { background: #fef3c7; color: #92400e; }
.tk-s-awaiting_further_clarification { background: #fde68a; color: #78350f; border-color: #f59e0b; }
.tk-s-resolved { background: #dcfce7; color: #166534; }
.tk-s-rejected { background: var(--danger-soft); color: var(--danger); }
.tk-s-closed { background: var(--surface-2); color: var(--ink-mute); border-color: var(--line); }
.tk-type { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: calc(11px * var(--fs, 1)); font-weight: 700; margin-right: 6px; vertical-align: 1px;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  font-family: var(--sans, inherit); letter-spacing: .02em; white-space: nowrap; }
.tk-zip { font-size: calc(12px * var(--fs, 1)); padding: 3px 10px; }
/* Summary by task type above the list: chips (every tab) and the All tasks table */
.tk-types { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.tk-type-chip { font: inherit; font-size: calc(13px * var(--fs, 1)); padding: 5px 12px; border-radius: 999px; cursor: pointer;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); }
.tk-type-chip b { margin-left: 4px; color: var(--accent); }
.tk-type-chip:hover { border-color: var(--accent); }
.tk-type-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tk-type-chip.active b { color: #fff; }
.tk-type-table { margin-bottom: 14px; overflow-x: auto; }
.tk-type-table table { width: 100%; border-collapse: collapse; font-size: calc(14px * var(--fs, 1)); }
.tk-type-table th, .tk-type-table td { padding: 8px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.tk-type-table thead th { font-size: calc(12px * var(--fs, 1)); text-transform: uppercase; letter-spacing: .04em; color: var(--ink-mute); font-weight: 600; }
.tk-type-table tfoot th, .tk-type-table tfoot td { border-bottom: none; border-top: 2px solid var(--line); }
.tk-type-table .tk-num-cell { text-align: right; width: 1%; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tk-type-table tr.tk-type-on { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.tk-cnt, .tk-cnt-type { font: inherit; background: none; border: none; cursor: pointer; padding: 2px 8px; border-radius: 6px; color: var(--accent); font-weight: 600; }
.tk-cnt-type { color: var(--ink); padding-left: 0; text-align: left; }
.tk-cnt:hover, .tk-cnt-type:hover { text-decoration: underline; }
.tk-cnt.active { background: var(--accent); color: #fff; }
/* The list like Redmine: saved queries bar, toolbar, filter / column panels, table */
.tk-queries { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; font-size: calc(13px * var(--fs, 1)); }
.tk-q-label { color: var(--ink-mute); font-weight: 600; margin-right: 2px; }
.tk-q { font: inherit; font-size: calc(13px * var(--fs, 1)); padding: 3px 10px; border-radius: 6px; cursor: pointer; color: var(--accent); background: none; border: 1px solid transparent; }
.tk-q:hover { border-color: var(--line); background: var(--surface); }
.tk-q.active { background: var(--accent); color: #fff; }
.tk-q-actions, .tk-q-save { margin-left: auto; }
.tk-q-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.tk-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: -4px 0 12px; font-size: calc(13px * var(--fs, 1)); }
.tk-toolbar .btn.tk-on { border-color: var(--accent); color: var(--accent); }
.tk-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.tk-seg button { font: inherit; font-size: calc(13px * var(--fs, 1)); padding: 5px 12px; border: none; background: var(--surface); color: var(--ink-soft); cursor: pointer; }
.tk-seg button + button { border-left: 1px solid var(--line); }
.tk-seg button.active { background: var(--accent); color: #fff; }
.tk-groupby { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); white-space: nowrap; }
.tk-groupby select { font-size: calc(13px * var(--fs, 1)); padding: 4px 8px; width: auto; }
.tk-toolbar .btn { white-space: nowrap; }
.tk-count { margin-left: auto; color: var(--ink-mute); }
.tk-link { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; }
.tk-panel { padding: 12px 16px; margin-bottom: 12px; font-size: calc(13px * var(--fs, 1)); }
.tk-panel-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 8px; }
.tk-panel-foot { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.tk-panel select, .tk-panel input { font-size: calc(13px * var(--fs, 1)); padding: 4px 8px; width: auto; max-width: 280px; flex: 0 0 auto; }
.tk-panel .tk-save-row #tkQName { max-width: none; flex: 1 1 240px; }
.tk-panel-foot .btn { white-space: nowrap; }
.tk-f-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.tk-f-label { flex: 0 0 110px; font-weight: 600; color: var(--ink-soft); }
.tk-f-vals { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tk-f-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--ink); }
.tk-f-chip button, .tk-f-x { background: none; border: none; cursor: pointer; color: var(--ink-mute); font-size: calc(14px * var(--fs, 1)); line-height: 1; padding: 2px 5px; border-radius: 50%; }
.tk-f-chip button:hover, .tk-f-x:hover { color: var(--danger, #dc2626); }
.tk-cols { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tk-cols label { display: flex; flex-direction: column; gap: 4px; color: var(--ink-soft); }
.tk-cols select { min-width: 180px; padding: 4px; }
.tk-cols-btns { display: flex; flex-direction: column; gap: 4px; }
.tk-cols-btns .btn { min-width: 36px; }
.tk-save-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 6px; }
.tk-save-row input[type=text], .tk-save-row #tkQName { flex: 1 1 240px; }
.tk-check { display: inline-flex; align-items: center; gap: 6px; }
.tk-grp-head { padding: 8px 18px; font-weight: 700; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: calc(13px * var(--fs, 1)); }
.tk-grp-n { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: calc(11px * var(--fs, 1)); font-weight: 600; text-align: center; color: var(--ink-soft); }
.tk-list-table { overflow: visible; }
.tk-table-wrap { overflow-x: auto; }
/* Frozen headers (public/stickyhead.js sets max-height): rows scroll inside the box, column headers stay */
.th-frozen { overflow: auto; }
.th-frozen .ppl-table th { position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 var(--line); }
.th-frozen .tk-table th { box-shadow: inset 0 -1px 0 var(--line); z-index: 2; }
.th-frozen .rp-table th:first-child { z-index: 3; }
/* Task list: tabs + search/toolbar stay at the top of the window while the page scrolls (laptops) */
@media (min-width: 901px) {
  #tasksRoot .tk-tabs { position: sticky; top: 0; z-index: 15; background: var(--bg); }
  #tasksRoot .tk-sticky-bar { position: sticky; top: var(--tk-tabs-h, 46px); z-index: 14; background: var(--bg); padding-bottom: 2px; }
}
@media print { .tk-tabs, .tk-sticky-bar { position: static !important; } .th-frozen { max-height: none !important; overflow: visible !important; } }
.tk-table { width: 100%; border-collapse: collapse; font-size: calc(13px * var(--fs, 1)); }
.tk-table th { position: sticky; top: 0; background: var(--surface-2); text-align: left; border-bottom: 1px solid var(--line); padding: 0; white-space: nowrap; z-index: 1; }
.tk-table th button { font: inherit; font-weight: 700; color: var(--ink-soft); background: none; border: none; cursor: pointer; padding: 8px; width: 100%; text-align: inherit; }
.tk-table th button:hover { color: var(--accent); }
.tk-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.tk-table td.tk-c-subject { white-space: normal; min-width: 240px; }
.tk-table td.tk-c-subject .tk-t-subject { color: var(--accent); }
.tk-table td.tk-c-assignee, .tk-table td.tk-c-customer { white-space: normal; min-width: 120px; }
.tk-table tbody tr:not(.tk-grp) { cursor: pointer; }
.tk-table tbody tr:not(.tk-grp):nth-child(even) { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.tk-table tbody tr:not(.tk-grp):hover, .tk-table tbody tr:not(.tk-grp):focus { background: color-mix(in srgb, var(--accent) 8%, transparent); outline: none; }
.tk-table tr.tk-tr-turn td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.tk-table tr.tk-grp td { background: var(--surface-2); font-weight: 700; padding: 8px 10px; }
.tk-table .tk-turn { color: var(--accent); margin-right: 4px; padding: 0; background: none; }
.tk-table .tk-pill, .tk-table .tk-prio { font-size: calc(11px * var(--fs, 1)); }
.tk-type-table .tk-zero { color: var(--ink-mute); opacity: .55; padding: 2px 8px; }
.tk-reject-note { width: 100%; font-size: calc(12px * var(--fs, 1)); }
.tk-prio { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: calc(10px * var(--fs, 1)); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-right: 4px; }
.tk-p-low { background: var(--surface-2); color: var(--ink-mute); }
.tk-p-high { background: #ffedd5; color: #9a3412; }
.tk-p-urgent { background: var(--danger); color: #fff; }

.tk-stat { cursor: pointer; }
.tk-stat:hover { border-color: var(--accent); }
/* Dashboard Tasks zone */
.tk-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
/* The counts follow the width of the Tasks panel itself (it narrows when the reminders column is shown): 5 in a row, 3 + 2, or 2 per row */
.dash-zone-tasks { container-type: inline-size; }
@container (max-width: 820px) { .tk-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@container (max-width: 520px) { .tk-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tk-kpis .stat-value { font-size: calc(36px * var(--fs, 1)); }
/* Label, number and note share rows across each line of cards (subgrid), so a label or note that wraps
   (e.g. "Resolved — to close") moves the whole row, and every number stays level */
.tk-kpis .stat { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
.tk-kpis .stat-label { align-self: end; }
.tk-kpi-hot { background: var(--accent-soft); border-color: #bfdbfe; }
.tk-kpi-hot .stat-value, .tk-kpi-hot .stat-label { color: var(--accent); }
.tk-kpi-late { background: var(--danger-soft); border-color: #fecaca; }
.tk-kpi-late .stat-label { color: var(--danger); }
/* Two side by side when there is room, otherwise stacked (adapts to the reminders column) */
.tk-dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
@media (max-width: 700px) { .tk-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Reminders (dashboard right column) ---------- */
.rm-panel { display: flex; flex-direction: column; min-height: 0; max-height: 100%; }
.rm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.rm-title { font-family: var(--serif); font-size: calc(16px * var(--fs, 1)); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.rm-badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: #db2777; color: #fff; font-size: calc(12px * var(--fs, 1)); line-height: 20px; text-align: center; animation: rm-pulse 1.4s ease-in-out infinite; }
.rm-form { padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; }
.rm-form label { margin: 6px 0 2px; }
.rm-form textarea { min-height: 56px; }
.rm-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rm-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.rm-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; min-height: 0; }
.rm-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 8px; border-radius: var(--radius-lg); border: 1px solid transparent; }
.rm-item + .rm-item { margin-top: 4px; }
.rm-check { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; border-radius: 6px; border: 2px solid var(--line-strong); background: var(--surface); cursor: pointer; color: #fff; font-size: calc(12px * var(--fs, 1)); line-height: 1; padding: 0; }
.rm-check:hover { border-color: var(--accent); }
.rm-lock { flex-shrink: 0; width: 20px; text-align: center; font-size: calc(12px * var(--fs, 1)); opacity: .6; margin-top: 1px; cursor: help; }
.rm-body { flex: 1; min-width: 0; }
.rm-text { font-size: calc(14px * var(--fs, 1)); color: var(--ink); overflow-wrap: anywhere; }
.rm-meta { font-size: calc(12px * var(--fs, 1)); color: var(--ink-mute); margin-top: 2px; }
.rm-del { flex-shrink: 0; background: none; border: none; color: var(--ink-mute); cursor: pointer; width: 24px; height: 24px; border-radius: 50%; font-size: calc(12px * var(--fs, 1)); opacity: 0; transition: opacity .12s; }
.rm-item:hover .rm-del, .rm-del:focus-visible { opacity: 1; }
.rm-del:hover { background: var(--danger-soft); color: var(--danger); }
/* Snooze: 💤 on a due reminder opens the choices under its text */
.rm-snooze { flex-shrink: 0; background: none; border: 1px solid var(--line); color: var(--ink-soft); cursor: pointer; height: 24px; padding: 0 6px; border-radius: 12px; font-size: calc(12px * var(--fs, 1)); }
.rm-snooze:hover, .rm-snooze.on { background: var(--accent-soft); border-color: var(--accent); }
.rm-snooze-opts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.rm-chip { background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-radius: 12px; padding: 2px 9px; font-size: calc(12px * var(--fs, 1)); cursor: pointer; }
.rm-chip:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.rm-repeat { font-size: calc(11px * var(--fs, 1)); }

/* ---------- Recurring tasks (public/recurring.js) ---------- */
.rc-row { cursor: default; }
.rc-paused { opacity: .7; }
.rc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.rc-actions { display: flex; gap: 6px; align-items: center; }
.rc-rule { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rc-rule select { width: auto; }
.rc-rule .ta-check { display: inline-flex; margin-right: 6px; }
@media (max-width: 700px) { .rc-row { flex-direction: column; align-items: stretch; } .rc-side { align-items: flex-start; } }
/* Due: flashes until the owner strikes it off */
.rm-due { background: #fdf2f8; border-color: #f9a8d4; animation: rm-flash 1.6s ease-in-out infinite; }
.rm-due .rm-when { color: #be185d; font-weight: 600; }
.rm-overdue { background: var(--danger-soft); border-color: #fca5a5; }
.rm-overdue .rm-when { color: var(--danger); }
.rm-done .rm-text { text-decoration: line-through; color: var(--ink-mute); }
.rm-done .rm-check { background: var(--ok); border-color: var(--ok); }
.rm-empty { padding: 16px 8px; font-size: calc(13px * var(--fs, 1)); color: var(--ink-mute); text-align: center; }
@keyframes rm-flash { 0%, 100% { box-shadow: 0 0 0 0 rgba(236,72,153,0); } 50% { box-shadow: 0 0 0 4px rgba(236,72,153,.25); border-color: #ec4899; } }
@keyframes rm-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
@media (max-width: 999px) { .rm-list { max-height: 260px; } }
@media (hover: none) { .rm-del { opacity: 1; } }
.tk-mini { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; cursor: pointer; font-size: calc(13px * var(--fs, 1)); }
.tk-mini:hover { border-color: var(--accent); background: var(--surface-2); }
.tk-mini .ta-muted { margin-top: 3px; }
.tk-sub { font-family: var(--mono); font-size: calc(12px * var(--fs, 1)); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-mute); margin: 14px 0 8px; }
.tk-note { padding: 8px 4px 8px 18px; border-bottom: 1px solid var(--line); font-size: calc(13px * var(--fs, 1)); cursor: pointer; position: relative; }
.tk-note:hover { background: var(--surface-2); }
.tk-dot { position: absolute; left: 4px; top: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.tk-form .tk-field { margin-bottom: 14px; }
.tk-form textarea, .tk-comment textarea, .tk-actform textarea { width: 100%; resize: vertical; font-family: var(--sans); }
.tk-toggle { margin-bottom: 8px; }
.tk-assignee select { width: 100%; max-width: 480px; }
.tk-fixed { padding: 9px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; font-size: calc(13px * var(--fs, 1)); }

.tk-back { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tk-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tk-actform { width: 100%; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.tk-actform label { display: block; margin: 8px 0 4px; }
.tk-detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.tk-body { white-space: pre-wrap; font-size: calc(14px * var(--fs, 1)); line-height: 1.6; }
.tk-body-img { display: block; max-width: 100%; max-height: 480px; margin: 6px 0; border: 1px solid var(--line); border-radius: 6px; cursor: zoom-in; background: var(--surface-2); min-height: 40px; min-width: 60px; }
.tk-ev-text .tk-body-img { max-height: 240px; }
.tk-pasted { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tk-pasted:empty { display: none; }
.tk-pasted-item { display: flex; align-items: center; gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); font-size: calc(12px * var(--fs, 1)); }
.tk-pasted-item img { height: 56px; max-width: 120px; object-fit: contain; border-radius: 4px; }
.tk-infos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; font-size: calc(13px * var(--fs, 1)); }
.tk-info .ta-muted { font-size: calc(11px * var(--fs, 1)); text-transform: uppercase; letter-spacing: .06em; }

.tk-timeline { border-left: 2px solid var(--line); margin: 10px 0 16px 6px; padding-left: 16px; }
.tk-ev { position: relative; padding: 0 0 14px; font-size: calc(13px * var(--fs, 1)); }
.tk-ev::before { content: ''; position: absolute; left: -22px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.tk-ev-action::before { border-color: var(--accent); }
.tk-ev-time { float: right; font-size: calc(11px * var(--fs, 1)); }
.tk-ev-text { white-space: pre-wrap; margin-top: 3px; color: var(--ink); }
.tk-ev-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tk-file { font-size: calc(12px * var(--fs, 1)); padding: 3px 9px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; color: var(--ink); background: var(--surface-2); }
.tk-file:hover { border-color: var(--accent); }
.tk-comment { border-top: 1px solid var(--line); padding-top: 12px; }
/* Activity entries open a read-only popup */
.tk-ev-click { cursor: pointer; border-radius: var(--radius-lg); margin-left: -8px; padding: 6px 8px 14px; transition: background-color .12s; }
.tk-ev-click:hover { background: var(--surface-2); }
.tk-ev-click::before { left: -14px; top: 10px; }
.tk-ev-edit { margin-top: 8px; }
.tk-edited { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; background: var(--surface-2); color: var(--ink-mute); font-size: calc(11px * var(--fs, 1)); font-weight: 500; }
.tk-pop-row { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 6px 0; font-size: calc(14px * var(--fs, 1)); border-bottom: 1px solid var(--line); }
.tk-pop-text { margin-top: 16px; padding: 12px 16px; background: var(--surface-2); border-radius: var(--radius-lg); white-space: pre-wrap; font-size: calc(14px * var(--fs, 1)); line-height: 1.6; }
.tk-warn { margin: 4px 0 8px; padding: 8px 12px; border-radius: var(--radius); background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: calc(13px * var(--fs, 1)); }
.tk-comment .ta-row { margin-top: 8px; }

/* ---------- Redmine-style task page (also used by the Task history report) ---------- */
.tk-back { align-items: center; }
.tk-rm-nav { margin-left: auto; display: flex; gap: 10px; align-items: center; font-size: calc(13px * var(--fs, 1)); }
.tk-rm-nav a { color: var(--accent); text-decoration: none; }
.tk-rm-nav a:hover { text-decoration: underline; }
.tk-rm-title { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin-bottom: 12px; }
.tk-rm-title h1 { font-size: calc(22px * var(--fs, 1)); margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1 1 auto; }
.tk-rm-title .tk-rm-tools { align-items: center; }
.tk-rm-title .tk-rm-nav { margin: 0 6px 0 0; }
/* Frozen header: stays at the top while the task scrolls */
.tk-rm-sticky { position: sticky; top: var(--tk-sticky-top, 0px); z-index: 20; background: var(--bg); margin: -8px -12px 12px; padding: 8px 12px; border-bottom: 1px solid transparent; transition: box-shadow .15s, border-color .15s; }
.tk-rm-sticky.tk-stuck { border-bottom-color: var(--line); box-shadow: 0 6px 12px -10px rgba(17, 24, 39, .35); }
.tk-rm-sticky.tk-stuck h1 { font-size: calc(18px * var(--fs, 1)); }
.tk-rm-type { color: var(--ink-soft); font-weight: 600; }
.tk-rm-no { font-family: var(--mono); }
.tk-rm-state { font-size: calc(11px * var(--fs, 1)); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 1px 6px; border: 1px solid currentColor; border-radius: 3px; font-family: var(--sans); }
.tk-rm-state-open { color: var(--accent); }
.tk-rm-state-closed { color: var(--ink-mute); }
.tk-rm-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.tk-rm-readonly { margin-bottom: 12px; padding: 8px 12px; border-radius: var(--radius); background: var(--accent-soft); color: var(--ink); font-size: calc(13px * var(--fs, 1)); }
.tk-rm-grid { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 16px; align-items: start; }
.tk-rm-issue { padding: 14px 18px; margin-bottom: 16px; border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--line)); border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--warning) 7%, var(--surface)); font-size: calc(13px * var(--fs, 1)); }
.tk-rm-chain { font-size: calc(12px * var(--fs, 1)); color: var(--ink-soft); line-height: 1.7; }
.tk-rm-chain a, .tk-rm-file a, .tk-rm-sub a, .tk-j-props a { color: var(--accent); text-decoration: none; }
.tk-rm-chain a:hover, .tk-rm-file a:hover, .tk-j-props a:hover { text-decoration: underline; }
.tk-rm-subject { font-size: calc(17px * var(--fs, 1)); margin: 4px 0 2px; font-family: var(--sans); font-weight: 700; }
.tk-rm-byline { color: var(--ink-soft); margin-bottom: 12px; }
.tk-rm-attrs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; padding: 10px 0; border-top: 1px solid var(--line); }
.tk-rm-attr { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px; padding: 3px 0; }
.tk-rm-k { font-weight: 700; color: var(--ink-soft); }
.tk-rm-sec { border-top: 1px solid var(--line); padding: 10px 0 4px; }
.tk-rm-sec h3 { font-size: calc(13px * var(--fs, 1)); margin: 0 0 8px; font-family: var(--sans); }
.tk-rm-file { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 3px 0; }
.tk-rm-sec .tk-zip { margin-top: 6px; }
.tk-rm-sub { width: 100%; border-collapse: collapse; }
.tk-rm-sub td { padding: 4px 8px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); white-space: nowrap; vertical-align: top; }
.tk-rm-sub td.tk-rm-sub-subj { white-space: normal; width: 60%; }
.tk-rm-sub tr { cursor: pointer; }
.tk-rm-sub tr:hover, .tk-rm-sub tr:focus { background: color-mix(in srgb, var(--accent) 7%, transparent); outline: none; }
.tk-rm-sub tr.tk-rm-here { background: color-mix(in srgb, var(--accent) 10%, transparent); font-weight: 600; }
.tk-rm-sub .tk-pill { font-size: calc(11px * var(--fs, 1)); }
.tk-rm-watchers { margin: 0; padding-left: 18px; font-size: calc(13px * var(--fs, 1)); line-height: 1.7; }
.tk-rm-side .panel h3 { font-size: calc(14px * var(--fs, 1)); }
/* History: numbered entries with History / Notes / Property changes tabs */
.tk-j-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
/* History / Notes as tables (2026-11-20) */
.tk-jt { width: 100%; border-collapse: collapse; font-size: calc(13.5px * var(--fs, 1)); margin-top: 6px; }
.tk-jt th { text-align: left; font-size: calc(11.5px * var(--fs, 1)); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-mute); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tk-jt td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tk-jt tbody tr:last-child td { border-bottom: none; }
.tk-jt .tk-jt-dt { white-space: nowrap; font-variant-numeric: tabular-nums; width: 1%; }
.tk-jt-click { cursor: pointer; }
.tk-jt-click:hover td, .tk-jt-click:focus-visible td { background: var(--accent-soft, rgba(37,99,235,.06)); }
.tk-jt-click:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: -2px; }
.tk-jt-st { font-weight: 600; font-size: calc(12.5px * var(--fs, 1)); white-space: nowrap; background: none !important; padding: 0 !important; }
.tk-jt-notes .tk-jt-task { white-space: nowrap; width: 1%; }
.tk-jt-notes .tk-jt-task .ta-muted { font-size: calc(11.5px * var(--fs, 1)); }
.tk-jt-notes td:nth-child(3) { white-space: nowrap; width: 1%; }
.tk-jt-note .tk-j-text { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tk-jt-subj { font-weight: 600; margin-top: 4px; }
.tk-jt-desc td { background: color-mix(in srgb, var(--accent, #2563eb) 4%, transparent); }
.tk-jt-self .tk-jt-task b { color: var(--accent, #2563eb); }
.tk-jt-files { margin-top: 4px; font-size: calc(12.5px * var(--fs, 1)); }
@media (max-width: 700px) { .tk-jt .tk-jt-dt, .tk-jt-notes .tk-jt-task { white-space: normal; } }
.tk-j-count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--accent-soft, rgba(37,99,235,.12));
  color: var(--accent, #2563eb); font-size: calc(12px * var(--fs, 1)); font-weight: 600; line-height: 19px; text-align: center; vertical-align: 1px; }
.tk-j-tab { font: inherit; font-size: calc(13px * var(--fs, 1)); font-weight: 600; padding: 6px 12px; border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; background: none; color: var(--ink-soft); cursor: pointer; margin-bottom: -1px; }
.tk-j-tab.active { background: var(--surface); border-color: var(--line); color: var(--ink); }
.tk-j-tab:hover { color: var(--accent); }
.tk-j { padding: 8px 6px 10px; border-bottom: 1px solid var(--line); font-size: calc(13px * var(--fs, 1)); }
.tk-j-click { cursor: pointer; }
.tk-j-click:hover { background: var(--surface-2); }
.tk-j-head { display: flex; justify-content: space-between; gap: 8px; color: var(--ink-soft); }
.tk-j-n { color: var(--accent); font-weight: 600; font-size: calc(12px * var(--fs, 1)); white-space: nowrap; }
.tk-j-label { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 4px; background: var(--surface-2); font-size: calc(11px * var(--fs, 1)); font-weight: 600; color: var(--ink-soft); }
.tk-j-action { background: var(--accent-soft); color: var(--accent); }
.tk-j-props { margin: 6px 0 0; padding-left: 20px; color: var(--ink-soft); }
.tk-j-props li { margin: 1px 0; }
.tk-j-props i { color: var(--ink); }
.tk-j-text { white-space: pre-wrap; margin-top: 6px; color: var(--ink); line-height: 1.55; }
.tk-j-text .tk-body-img { max-height: 320px; }
.tk-rm-history .tk-comment { margin-top: 12px; }

@media (max-width: 900px) {
  .tk-dash-grid, .tk-detail-grid, .tk-rm-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  /* Phones: once frozen, keep only Back, the task number and Previous / Next */
  .tk-rm-sticky.tk-stuck .tk-rm-tools .btn { display: none; }
  .tk-rm-sticky.tk-stuck { gap: 4px 10px; }
  .tk-rm-sticky.tk-stuck h1 { font-size: calc(15px * var(--fs, 1)); flex-basis: auto; }
  .tk-rm-sticky.tk-stuck .tk-rm-state { display: none; }
  .tk-rm-attrs { grid-template-columns: 1fr; }
  .tk-rm-attr { grid-template-columns: 120px minmax(0, 1fr); }
  .tk-rm-nav { margin-left: 0; }
}
@media (max-width: 600px) {
  .tk-row { flex-direction: column; gap: 6px; padding: 12px 14px; }
  .tk-row-due { text-align: left; display: flex; gap: 6px; }
  .tk-infos { grid-template-columns: 1fr 1fr; }
  .tk-ev-time { float: none; display: block; }
  .tk-actions .btn { flex: 1 1 45%; }
  .tk-filters select { flex: 1 1 100%; }
}

/* Inputs without a type attribute (and search boxes) get the page's normal field style */
#tasksRoot input:not([type]), #adminTabTasks input:not([type]), #tasksRoot input[type=search], #adminTabTasks input[type=search] {
  font-family: var(--sans); font-size: calc(14px * var(--fs, 1)); padding: 8px 12px; min-height: 40px; border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--ink); outline: none; width: 100%; box-sizing: border-box; transition: border-color 0.12s, box-shadow 0.12s;
}
#tasksRoot input:not([type]):focus, #adminTabTasks input:not([type]):focus, #tasksRoot input[type=search]:focus { border-color: var(--primary); box-shadow: var(--focus); }
/* Subject: up to 200 characters, wraps over two lines instead of scrolling sideways */
#tkSubject { min-height: 0; resize: none; font-size: calc(15px * var(--fs, 1)); font-weight: 500; line-height: 1.4; field-sizing: content; } /* grows with its text, also on rotate */

/* Resolved tasks waiting for the assigner to close */
.tk-close-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); margin-bottom: 10px; background: var(--surface); }
.tk-close-card > input[type=checkbox] { margin-top: 4px; width: auto; }
.tk-close-main { flex: 1; min-width: 0; cursor: pointer; font-size: calc(14px * var(--fs, 1)); }
.tk-close-note { margin: 6px 0; padding: 7px 10px; background: #f0fdf4; border-left: 3px solid var(--ok); border-radius: 4px; font-size: calc(13px * var(--fs, 1)); white-space: pre-wrap; }
.tk-close-btns { display: flex; flex-direction: column; gap: 6px; }
.tk-close-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
.tk-list .tk-close-card { margin: 10px 14px; }
.tk-ontime { color: var(--ok); }
/* Proposed completion date (propose form, approve/reject box, waiting note) */
.tk-due-box { width: 100%; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: var(--radius); background: var(--accent-soft); border-left: 3px solid var(--accent); font-size: calc(13px * var(--fs, 1)); }
.tk-due-box input[type="text"] { width: 100%; }
.tk-due-wait { background: var(--surface-alt); border-left-color: var(--line); color: var(--ink-soft); }
.tk-due-why { white-space: pre-wrap; }
.tk-due-chip { color: var(--accent); font-weight: 500; }
/* Suggested assignee (owner form, task page panel, New task pop-up) */
.tk-suggest { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.tk-suggest-wrap { width: 100%; margin-top: 8px; }
.tk-sg-head { padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: calc(13px * var(--fs, 1)); }
.tk-sg-row { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.tk-sg-row.top { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.tk-sg-main { flex: 1; min-width: 0; font-size: calc(13.5px * var(--fs, 1)); }
.tk-sg-score { display: inline-block; min-width: 30px; text-align: center; font-weight: 700; font-size: calc(12px * var(--fs, 1)); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 999px; padding: 0 7px; }
.tk-sg-away { font-size: calc(11.5px * var(--fs, 1)); color: var(--ink-mute); }
.tk-sg-why { color: var(--ink-soft); font-size: calc(12px * var(--fs, 1)); margin-top: 2px; }
.tk-sg-parts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 5px; }
.tk-sg-part { display: inline-flex; align-items: center; gap: 6px; font-size: calc(11px * var(--fs, 1)); color: var(--ink-mute); }
.tk-sg-bar { width: 64px; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; display: inline-block; }
.tk-sg-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.tk-sg-foot { padding: 7px 12px; font-size: calc(11.5px * var(--fs, 1)); }
.tk-sg-link { background: none; border: none; color: var(--accent); font: inherit; font-size: calc(12px * var(--fs, 1)); cursor: pointer; padding: 0 0 0 6px; }
.tk-sg-link:hover { text-decoration: underline; }
/* All tasks table: "Showing only In progress · Pricing  ✕ Show all" after a number was clicked */
.tk-col-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 14px; border-top: 1px solid var(--line); font-size: calc(13px * var(--fs, 1)); color: var(--ink-soft); }
/* Task page: the assigner's team lead changes task type / category / customer in place */
.tk-cls-sel { max-width: 100%; min-width: 160px; padding: 4px 8px; font-size: calc(13px * var(--fs, 1)); }
/* Multi-type task: summary on the form + the type picker pop-up */
.tk-multi-sum { display: grid; gap: 3px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); margin-bottom: 6px; font-size: calc(13px * var(--fs, 1)); max-height: 150px; overflow-y: auto; }
#tkMultiBox .btn { margin-top: 6px; }
.tk-multi-pop { max-width: 760px; width: calc(100vw - 32px); }
.tk-multi-scroll { max-height: min(56vh, 480px); overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.tk-multi-table { width: 100%; border-collapse: collapse; font-size: calc(13px * var(--fs, 1)); }
.tk-multi-table th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.tk-multi-table td { padding: 5px 10px; border-bottom: 1px solid var(--line); }
.tk-multi-table tr.on td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.tk-multi-table select, .tk-multi-table input[type=date] { width: 100%; min-width: 150px; }
@media (max-width: 700px) { .tk-multi-table thead { display: none; } .tk-multi-table tr { display: grid; padding: 6px 0; border-bottom: 1px solid var(--line); } .tk-multi-table td { border: 0; } }
.tk-match-in { font-size: calc(11px * var(--fs, 1)); color: var(--ink-mute); background: var(--surface-2); border-radius: 999px; padding: 1px 8px; margin-left: 6px; white-space: nowrap; font-weight: 400; }
.tk-due-proposed { margin-top: 2px; font-size: calc(12px * var(--fs, 1)); color: var(--accent); }
.tk-resolved-note { width: 100%; margin-top: 4px; padding: 8px 12px; background: #f0fdf4; border-left: 3px solid var(--ok); border-radius: 4px; font-size: calc(13px * var(--fs, 1)); white-space: pre-wrap; }
@media (max-width: 600px) {
  .tk-close-card { flex-wrap: wrap; }
  .tk-close-btns { flex-direction: row; width: 100%; }
  .tk-close-btns .btn { flex: 1; }
}

/* ---------- Reports ---------- */
.rp-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 4px 0 6px; }
.rp-f { display: flex; flex-direction: column; min-width: 150px; }
.rp-f label { margin-bottom: 4px; }
.rp-f select, .rp-f input { min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
.rp-check { margin-bottom: 8px; }
.rp-export { margin-left: auto; display: flex; gap: 8px; padding-bottom: 2px; }
.rp-period-note { font-size: calc(12px * var(--fs, 1)); color: var(--ink-mute); margin-bottom: 14px; }
.rp-table th.num, .rp-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rp-table th { white-space: nowrap; }
.rp-table td { padding-top: 10px; padding-bottom: 10px; }
.rp-table tfoot td { background: var(--surface-2); font-weight: 600; border-top: 1px solid var(--line-strong); padding: 10px 16px; }
.rp-drill { background: none; border: none; padding: 2px 6px; margin: -2px -6px; border-radius: 4px; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; }
.rp-drill:hover { background: var(--accent-soft); text-decoration: underline; }
.rp-pct { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.rp-pct-bar { width: 44px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.rp-pct-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.rp-help { font-size: calc(12px * var(--fs, 1)); color: var(--ink-mute); margin: 8px 2px 0; }
.rp-click { cursor: pointer; }
.rp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.rp-age-late .stat-value { color: var(--danger); }
.rp-section { margin-top: 16px; }
.rp-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.rp-svg { width: 100%; height: auto; display: block; }
.rp-legend { display: flex; gap: 16px; font-size: calc(12px * var(--fs, 1)); color: var(--ink-soft); margin-bottom: 6px; }
.rp-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.rp-tooltip { position: fixed; z-index: 400; display: none; pointer-events: none; background: var(--ink); color: #fff; font-size: calc(12px * var(--fs, 1)); line-height: 1.5; padding: 8px 10px; border-radius: 6px; box-shadow: 0 6px 16px rgba(0,0,0,.2); white-space: nowrap; }
.rp-custom-grid { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.rp-custom-grid > div:last-child > .panel:first-child { margin-top: 0; }
.rp-builder h3, .rp-saved h3 { margin-bottom: 10px; }
.rp-b-row { margin-bottom: 12px; }
.rp-seg { display: flex; flex-direction: column; gap: 4px; }
.rp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; max-height: 210px; overflow-y: auto; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.rp-cols .ta-check, .rp-seg .ta-check { margin: 0; font-size: calc(13px * var(--fs, 1)); }
.rp-b-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-bottom: 10px; }
.rp-b-grid label { margin-bottom: 2px; }
.rp-b-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.rp-b-actions input[type=text] { flex: 1 1 140px; width: auto; }
.rp-saved { margin-top: 16px; }
.rp-saved-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: calc(12px * var(--fs, 1)); }
.rp-saved-row:first-of-type { border-top: none; }
.rp-saved-row .icon-btn { margin-left: auto; }
@media (max-width: 1100px) { .rp-custom-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .rp-export { margin-left: 0; } .rp-f { min-width: 0; flex: 1 1 140px; } .rp-b-grid, .rp-cols { grid-template-columns: 1fr; } }
/* Report tables: keep names, numbers and dates on one line; only subjects / text wrap */
.rp-table td { white-space: nowrap; }
.rp-table td.rp-wrap { white-space: normal; min-width: 200px; max-width: 360px; }
/* Wide report tables scroll sideways on smaller laptops: keep the first column (person / team) in view */
.rp-table th:first-child, .rp-table td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
.rp-table th:first-child { background: var(--surface-2); }
.rp-table tfoot td:first-child { background: var(--surface-2); }
.rp-table tr.row:hover td:first-child { background: var(--surface-2); }

/* ---------- Task history report (Reports → Task history) ---------- */
.rp-hist-search label { display: block; margin-bottom: 6px; font-size: calc(13px * var(--fs, 1)); color: var(--ink-soft); }
.rp-hist-search input { flex: 1; min-width: 220px; max-width: 520px; }
.rp-hist-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.rp-hist-outline h3 { font-size: calc(14px * var(--fs, 1)); margin: 0 0 8px; }
.rp-hist-task { margin-top: 22px; scroll-margin-top: 12px; }
.rp-hist-task-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.rp-hist-task-head h2 { font-size: calc(17px * var(--fs, 1)); margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-family: var(--sans); }
.rp-hist-journal { padding: 4px 18px 10px; }
.rp-hist-journal h3 { font-size: calc(13px * var(--fs, 1)); margin: 0 0 6px; }
.rp-hist-watch { padding: 0 18px; font-size: calc(12px * var(--fs, 1)); }
.rp-print-only { display: none; }

/* Print / Save as PDF: only the task family, laid out for paper */
@media print {
  body.printing-history .sidebar, body.printing-history .asst-fab, body.printing-history .asst-panel, body.printing-history .toast,
  body.printing-history .install-banner, body.printing-history .rp-no-print, body.printing-history .page-head,
  body.printing-history .lms-tabs, body.printing-history .rp-period-note, body.printing-history .rp-hist-search,
  body.printing-history .tk-j-tabs, body.printing-history .mobile-top { display: none !important; }
  body.printing-history .app { display: block !important; }
  body.printing-history .view:not(#view-reports) { display: none !important; }
  body.printing-history .rp-print-only { display: block; }
  body.printing-history .rp-print-title { font-size: calc(16px * var(--fs, 1)); font-weight: 700; margin-bottom: 10px; }
  body.printing-history .rp-print-title span { font-weight: 400; font-size: calc(12px * var(--fs, 1)); color: #555; }
  body.printing-history .rp-hist-task { break-before: auto; }
  body.printing-history .tk-rm-issue { break-inside: avoid-page; background: #fffdf3 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.printing-history .tk-j { break-inside: avoid; }
  body.printing-history .panel { box-shadow: none; }
  body.printing-history .table-scroll { overflow: visible; }
}

/* ---------- My notes (dashboard; public/notes.js) ---------- */
.nt-zone { margin-bottom: 20px; }
.nt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.nt-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.nt-search { width: 180px; padding: 5px 10px; font-size: calc(13px * var(--fs, 1)); }
.nt-count { font-size: calc(13px * var(--fs, 1)); font-weight: 400; }
.nt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.nt-card { text-align: left; font: inherit; color: var(--ink); background: color-mix(in srgb, var(--warning) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warning) 30%, var(--line));
  border-radius: var(--radius-lg); padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-height: 96px; }
.nt-card:hover, .nt-card:focus-visible { border-color: var(--accent); outline: none; }
.nt-card.nt-shared { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); }
.nt-card-subj { font-weight: 700; font-size: calc(14px * var(--fs, 1)); }
.nt-card-text { font-size: calc(12px * var(--fs, 1)); color: var(--ink-soft); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.nt-card-meta { font-size: calc(11px * var(--fs, 1)); color: var(--ink-mute); }
.nt-empty { grid-column: 1 / -1; padding: 14px; color: var(--ink-mute); font-size: calc(13px * var(--fs, 1)); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }
/* Editor: a large window */
.nt-pop .nt-modal { max-width: 1000px; width: 100%; height: min(88vh, 900px); max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; }
.nt-pop .modal-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.nt-edit label { margin-top: 8px; }
.nt-edit #ntSubject { font-size: calc(16px * var(--fs, 1)); font-weight: 600; }
.nt-toolbar { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 4px; border: 1px solid var(--line); border-bottom: none; border-radius: 8px 8px 0 0; background: var(--surface-2); }
.nt-tool, .nt-color { font: inherit; font-size: calc(13px * var(--fs, 1)); min-width: 32px; height: 30px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 2px; margin: 0; }
.nt-tool:hover, .nt-color:hover { background: var(--surface); border-color: var(--line); }
.nt-color { position: relative; font-weight: 700; color: #dc2626; }
.nt-hl { color: #d97706; }
.nt-color input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; padding: 0; border: none; }
.nt-sep { width: 1px; height: 20px; background: var(--line-strong); margin: 0 4px; }
.nt-body { flex: 1; min-height: 220px; overflow-y: auto; padding: 12px 14px; border: 1px solid var(--line); border-radius: 0 0 8px 8px; background: var(--surface); font-size: calc(14px * var(--fs, 1)); line-height: 1.6; outline: none; }
.nt-body:focus { border-color: var(--accent); box-shadow: var(--focus); }
.nt-body:empty::before { content: attr(data-placeholder); color: var(--placeholder); }
.nt-body img, .nt-view img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; margin: 4px 0; }
.nt-body ul, .nt-body ol, .nt-view ul, .nt-view ol { padding-left: 26px; margin: 6px 0; }
.nt-body p, .nt-view p { margin: 0 0 6px; }
.nt-body h3, .nt-view h3 { font-size: calc(17px * var(--fs, 1)); margin: 8px 0 4px; }
.nt-view { font-size: calc(15px * var(--fs, 1)); line-height: 1.65; }
.nt-share { margin-top: 10px; }
.nt-share .ta-row { gap: 6px; align-items: center; flex-wrap: wrap; }
.nt-share select { max-width: 240px; }

/* ---------- Dashboard panels opened big (double-click or ⤢): My notes, Reminders ---------- */
.rm-head-btns { display: flex; gap: 6px; }
.dash-big { position: fixed !important; inset: 4vh max(16px, 6vw) !important; z-index: 45 !important; max-height: none !important; overflow: auto;
  background: var(--surface); border-radius: 12px; box-shadow: 0 0 0 100vmax rgba(17, 24, 39, .45), 0 20px 48px rgba(17, 24, 39, .3); }
#dashNotes.dash-big { padding: 18px 22px; }
#dashNotes.dash-big .nt-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
#dashNotes.dash-big .nt-card { min-height: 150px; }
#dashNotes.dash-big .nt-card-text { -webkit-line-clamp: 7; font-size: calc(13px * var(--fs, 1)); }
#dashReminders.dash-big .rm-panel { max-height: none; height: 100%; border: none; box-shadow: none; }
#dashReminders.dash-big .rm-text { font-size: calc(16px * var(--fs, 1)); }
#dashReminders.dash-big .rm-form textarea { min-height: 120px; font-size: calc(15px * var(--fs, 1)); }
#dashReminders.dash-big .rm-form { padding: 16px 24px; }
#dashReminders.dash-big .rm-head { padding: 16px 24px; }
#dashReminders.dash-big .rm-title { font-size: calc(20px * var(--fs, 1)); }
body.dash-big-open { overflow: hidden; }

/* ---------- New / edit task form on one screen (13"–16" laptops; tkFitForm sets the height) ---------- */
.tk-form-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.tk-form-head h1 { font-size: calc(24px * var(--fs, 1)); margin: 0; }
.tk-form-head .subtitle { font-size: calc(13px * var(--fs, 1)); }
.tk-form-btns { display: flex; gap: 8px; }
.tk-form2 { display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 34%, 460px); gap: 0 22px; min-height: 0; padding: 16px 20px; }
.tk-form2 .tk-field { margin-bottom: 10px; }
.tk-form2 label { font-size: calc(13px * var(--fs, 1)); margin-bottom: 4px; display: block; }
.tk-form-main { display: flex; flex-direction: column; min-height: 0; }
.tk-form2 .tk-body-field { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
/* Subject | Reference ID | Count on one row (phones: stacked) */
.tk-subject-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 72px; gap: 0 10px; align-items: start; }
@media (max-width: 1279px) { .tk-subject-row { grid-template-columns: minmax(0, 1fr) 124px 60px; gap: 0 8px; } }
.tk-subject-row .tk-field label { white-space: nowrap; }
.tk-ref-field input, .tk-count-field input { width: 100%; }
.tk-count-field input { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .tk-subject-row { grid-template-columns: minmax(0, 1fr) 84px; } .tk-subject-row > .tk-field:first-child { grid-column: 1 / -1; } }
.tk-ref { font-family: var(--mono, ui-monospace, monospace); font-size: 0.95em; letter-spacing: .01em; }
.tk-ref-input { width: 190px; max-width: 100%; }
.tk-count-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; max-width: 100%; }
.tk-count-edit #tkCountInput { width: 64px; text-align: right; }
.tk-count-edit #tkCountNote { flex: 1 1 140px; min-width: 0; width: auto; }
.tk-count-edit .btn { flex: none; }
.tk-count-btn { border: none; background: none; cursor: pointer; color: var(--accent, #2563eb); padding: 0 4px; font-size: calc(14px * var(--fs, 1)); border-radius: 4px; }
.tk-count-btn:hover, .tk-count-btn:focus-visible { background: var(--accent-soft, rgba(37,99,235,.1)); }
.tk-watch-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.tk-watch-row select { width: 220px; max-width: 100%; }
.tk-form2 .tk-watch-field { margin-bottom: 0; }
.tk-watch-row .tk-picked { margin: 0; }
.tk-watch-row .tk-picked:empty { display: none; }
.tk-form2 #tkBody { flex: 1 1 auto; min-height: 90px; resize: none; }
.tk-form2 #tkSubject { min-height: 0; }
.tk-form2 .tk-pasted { max-height: 80px; overflow-y: auto; }
.tk-form2 .tk-draft-files { max-height: 96px; overflow-y: auto; }
.tk-form-side { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; align-content: start; overflow-y: auto; min-height: 0; padding: 2px; }
.tk-form-side .tk-span { grid-column: 1 / -1; }
.tk-form2 select, .tk-form2 input[type=date], .tk-form2 input[type=number] { padding-top: 7px; padding-bottom: 7px; }
.tk-form2 .tk-toggle { margin-bottom: 4px; display: flex; gap: 14px; flex-wrap: wrap; }
.tk-form2 .tk-toggle .ta-check { font-size: calc(13px * var(--fs, 1)); margin: 0; }
.tk-hint { font-size: calc(12px * var(--fs, 1)); color: var(--ink-mute); margin-top: 4px; }
@media (max-width: 900px) {
  .tk-form2 { display: block; height: auto !important; }
  .tk-form2 #tkBody { min-height: 160px; resize: vertical; }
  .tk-form-side { overflow: visible; margin-top: 4px; }
}
@media (max-width: 480px) { .tk-form-side { grid-template-columns: 1fr; } }
.tk-form-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 260px); gap: 0 16px; align-items: start; }
.tk-form-row2:empty { display: none; }
.tk-form-row2 .tk-field:only-child { grid-column: 1 / -1; }
.tk-form-side > div > label, .tk-form-side .tk-span > label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.tk-form-open main { padding-bottom: 16px; }
@media (max-width: 900px) { .tk-form-row2 { grid-template-columns: 1fr; } body.tk-form-open main { padding-bottom: 24px; } }

/* Chosen files: one chip per file with ✕ to take it out before saving */
.tk-filebox { display: inline-flex; }
.tk-picked { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tk-picked:empty { display: none; }
.tk-picked-item { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 4px 3px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); font-size: calc(12px * var(--fs, 1)); }
.tk-picked-item > span.ta-muted { white-space: nowrap; }
.tk-picked-item button { border: none; background: none; cursor: pointer; color: var(--ink-mute); font-size: calc(13px * var(--fs, 1)); line-height: 1; padding: 3px 5px; border-radius: 4px; }
.tk-picked-item button:hover { color: var(--danger); background: var(--danger-soft); }
.tk-picked-bad { border-color: var(--danger); color: var(--danger); }
.tk-form2 .tk-picked { max-height: 64px; overflow-y: auto; }
.tk-locked { display: inline-flex; align-items: center; font-size: calc(12px * var(--fs, 1)); color: var(--ink-mute); padding: 4px 8px; border: 1px dashed var(--line-strong); border-radius: 6px; cursor: help; white-space: nowrap; }
@media (max-width: 700px) { .tk-rm-sticky.tk-stuck .tk-locked { display: none; } }

/* Type-to-search dropdown (Customer on the task form) */
.tk-combo { position: relative; }
.tk-combo-input { width: 100%; padding-right: 30px; }
.tk-combo-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: none; background: none; color: var(--ink-mute); cursor: pointer; font-size: calc(13px * var(--fs, 1)); padding: 2px 5px; border-radius: 4px; display: none; }
.tk-combo.has-value .tk-combo-clear { display: block; }
.tk-combo-clear:hover { background: var(--surface-2); color: var(--ink); }
.tk-combo-list { position: fixed; z-index: 70; margin: 0; padding: 4px; list-style: none; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg); box-shadow: 0 10px 28px rgba(17,24,39,.16); font-size: calc(13.5px * var(--fs, 1)); }
.tk-combo-list[hidden] { display: none; }
.tk-combo-list li { padding: 7px 10px; border-radius: 6px; cursor: pointer; line-height: 1.35; }
.tk-combo-list li.active { background: var(--accent-soft); color: var(--accent); }
.tk-combo-list li[aria-selected="true"]::after { content: ' ✓'; color: var(--accent); font-weight: 700; }
.tk-combo-list .tk-combo-none { color: var(--ink-mute); font-style: italic; border-bottom: 1px solid var(--line); border-radius: 6px 6px 0 0; margin-bottom: 2px; }
.tk-combo-list .tk-combo-empty { color: var(--ink-mute); cursor: default; font-size: calc(12.5px * var(--fs, 1)); }
.tk-combo-list mark { background: color-mix(in srgb, var(--warning, #d97706) 28%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }

/* Admin → Task types: order arrows */
.ta-order { white-space: nowrap; width: 1%; }
.ta-order-n { display: inline-block; min-width: 20px; color: var(--ink-mute); font-variant-numeric: tabular-nums; font-size: calc(12.5px * var(--fs, 1)); }
.ta-move { width: 28px; height: 28px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink-soft); cursor: pointer; font-size: calc(10px * var(--fs, 1)); margin-left: 2px; }
.ta-move:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.ta-move:focus-visible { outline: none; box-shadow: var(--focus); }
.ta-move:disabled { opacity: .35; cursor: default; }

/* ---------- Formatted text: editor (public/rte.js) and display (.tk-rich) — 2026-11-20 ---------- */
.rte { display: flex; flex-direction: column; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); min-height: 0; }
.rte:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px 6px; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.rte-tool { position: relative; min-width: 28px; height: 28px; padding: 0 6px; border: 1px solid transparent; border-radius: 5px; background: none; color: var(--ink-soft); cursor: pointer;
  font-size: calc(13px * var(--fs, 1)); line-height: 26px; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
.rte-tool:hover { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.rte-tool:focus-visible { outline: none; box-shadow: var(--focus); }
.rte-sep { width: 1px; height: 18px; background: var(--line-strong); margin: 0 3px; }
.rte-color { font-weight: 700; }
.rte-color input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }
.rte-hl { color: #d4a514; }
.rte-tblops[hidden] { display: none; }
.rte-tblops { display: inline-flex; gap: 2px; padding-left: 4px; margin-left: 2px; border-left: 1px solid var(--line-strong); }
.rte-body { flex: 1 1 auto; min-height: 90px; overflow: auto; padding: 10px 12px; outline: none; line-height: 1.5; font-size: calc(14px * var(--fs, 1)); color: var(--ink); overflow-wrap: anywhere; }
.rte-compact .rte-body { min-height: 72px; max-height: 340px; }
.rte-compact .rte-tool { min-width: 26px; height: 26px; line-height: 24px; }
.rte-body.rte-empty::before, .rte-body:empty::before { content: attr(data-placeholder); color: var(--ink-mute); pointer-events: none; }
.rte-body p, .tk-rich p { margin: 0 0 6px; }
.rte-body img, .tk-rich img { max-width: 100%; height: auto; border-radius: 4px; }
.rte-body ul, .rte-body ol, .tk-rich ul, .tk-rich ol { margin: 4px 0 6px; padding-left: 22px; }
.rte-body h3, .tk-rich h3 { font-size: calc(16px * var(--fs, 1)); margin: 8px 0 4px; }
.rte-body table, .tk-rich table { border-collapse: collapse; margin: 6px 0; max-width: 100%; display: block; overflow-x: auto; }
.rte-body td, .rte-body th, .tk-rich td, .tk-rich th { border: 1px solid var(--line-strong); padding: 4px 8px; vertical-align: top; min-width: 40px; font-size: calc(13.5px * var(--fs, 1)); }
.rte-body th, .tk-rich th { background: var(--surface-2); font-weight: 600; }
.rte-body td p, .tk-rich td p { margin: 0; }
.tk-rich { white-space: normal; overflow-wrap: anywhere; }
.tk-rich > :last-child { margin-bottom: 0; }
/* the task form: the Body editor fills the height like the old box did */
.tk-form2 .tk-body-field .rte { flex: 1 1 auto; }
.tk-form2 .tk-body-field .rte-body { min-height: 60px; }
.tk-comment .rte { margin-bottom: 8px; }
.tk-actform .rte { margin-bottom: 4px; }
/* one toolbar row (slides sideways when narrow) so the text area keeps its height; nothing spills out of the box */
.rte { overflow: hidden; }
.rte-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
.rte-bar > * { flex: none; }
.tk-form2 .tk-body-field .rte { flex: 1 1 0; min-height: 120px; }
.tk-form2 .tk-body-field .rte-body { flex: 1 1 0; min-height: 0; }

/* Task page (2026-11-23): Watchers and Parent task in one slim bar; the task and its history use the full width */
.tk-rm-full { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tk-peoplebar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; padding: 10px 16px; margin-bottom: 16px; }
.tk-pb-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.tk-pb-label { font-weight: 600; font-size: calc(13px * var(--fs, 1)); white-space: nowrap; }
.tk-pb-chip { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: calc(12.5px * var(--fs, 1)); }
.tk-peoplebar select { width: auto; min-width: 180px; max-width: 280px; padding-top: 5px; padding-bottom: 5px; }
.tk-comment-hint { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-lg); background: var(--surface-2); color: var(--ink-soft); font-size: calc(13px * var(--fs, 1)); }
.tk-comment-top { margin: 10px 0 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }

/* ---------- Team load (My team tab, 2026-11-23) ---------- */
.tk-load { padding: 14px 16px; margin-bottom: 16px; }
.tk-load-none { font-size: calc(13px * var(--fs, 1)); }
.tk-load-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 8px; }
.tk-load-head h3 { margin: 0; font-size: calc(16px * var(--fs, 1)); }
.tk-load-head .ta-muted { font-size: calc(12.5px * var(--fs, 1)); }
.tk-load-row { display: grid; grid-template-columns: minmax(150px, 220px) minmax(120px, 1fr) 76px minmax(0, 260px) 70px; align-items: center; gap: 12px;
  width: 100%; padding: 8px 10px; border: none; border-top: 1px solid var(--line); background: none; cursor: pointer; text-align: left; font: inherit; color: var(--ink); border-radius: 6px; }
.tk-load-row:hover, .tk-load-row.open { background: var(--accent-soft); }
.tk-load-row:focus-visible { outline: none; box-shadow: var(--focus); }
.tk-load-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-load-tag { font-size: calc(11px * var(--fs, 1)); font-weight: 600; color: var(--ink-mute); border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 6px; margin-left: 4px; }
.tk-load-me { color: var(--accent); border-color: var(--accent); }
.tk-load-bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.tk-load-fill { display: block; height: 100%; border-radius: 999px; }
.tk-load-open { white-space: nowrap; font-size: calc(13px * var(--fs, 1)); }
.tk-load-nums { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: calc(12.5px * var(--fs, 1)); color: var(--ink-soft); }
.tk-load-lv { font-size: calc(11.5px * var(--fs, 1)); font-weight: 600; text-align: center; border-radius: 999px; padding: 2px 8px; }
/* the grading: free / light = green, normal = amber, heavy = red, unassigned = blue */
.tk-lv-free { background: #e5e7eb; color: #4b5563; }
.tk-load-fill.tk-lv-free { background: #d1d5db; }
.tk-lv-light { background: #dcfce7; color: #166534; } .tk-load-fill.tk-lv-light { background: #22c55e; }
.tk-lv-normal { background: #fef3c7; color: #92400e; } .tk-load-fill.tk-lv-normal { background: #f59e0b; }
.tk-lv-heavy { background: #fee2e2; color: #991b1b; } .tk-load-fill.tk-lv-heavy { background: #ef4444; }
.tk-load-fill.tk-lv-unassigned { background: var(--accent); }
:root[data-theme="dark"] .tk-lv-light { background: #14532d; color: #bbf7d0; } :root[data-theme="dark"] .tk-lv-normal { background: #78350f; color: #fde68a; }
:root[data-theme="dark"] .tk-lv-heavy { background: #7f1d1d; color: #fecaca; } :root[data-theme="dark"] .tk-lv-free { background: #374151; color: #d1d5db; }
.tk-load-drill { margin: 4px 0 10px 24px; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; }
.tk-load-types { display: flex; flex-wrap: wrap; gap: 6px; }
.tk-load-type { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 4px 12px; cursor: pointer; font: inherit; font-size: calc(13px * var(--fs, 1)); color: var(--ink); }
.tk-load-type b { color: var(--accent); margin-left: 4px; }
.tk-load-type.on, .tk-load-type:hover { border-color: var(--accent); background: var(--accent-soft); }
.tk-load-hint { margin-top: 8px; font-size: calc(12.5px * var(--fs, 1)); }
.tk-load-tasks { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.tk-load-task { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 7px 10px; cursor: pointer; font: inherit; color: var(--ink); }
.tk-load-task:hover { border-color: var(--accent); }
.tk-load-subj { font-weight: 500; }
.tk-load-meta { margin-left: auto; font-size: calc(12.5px * var(--fs, 1)); color: var(--ink-soft); }
@media (max-width: 800px) {
  .tk-load-row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 10px; }
  .tk-load-name { order: 1; } .tk-load-open { order: 2; } .tk-load-lv { order: 3; }
  .tk-load-bar { grid-column: 1 / -1; order: 4; } .tk-load-nums { grid-column: 1 / -1; order: 5; } .tk-load-nums:empty { display: none; }
}

/* ---------- Circulars (public/circulars.js) — 2026-11-25 ---------- */
.ci-nav-badge { margin-left: auto; background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; font-size: calc(11px * var(--fs, 1)); font-weight: 600; line-height: 18px; }
.ci-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.ci-bar .lms-tabs { border-bottom: none; margin: 0; }
.ci-filters { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 8px; }
.ci-filters select, .ci-filters input { width: auto; min-width: 170px; }
.ci-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.ci-card { display: flex; flex-direction: column; gap: 6px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; cursor: pointer; font: inherit; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.ci-card:hover, .ci-card:focus-visible { border-color: var(--accent); box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 14%, transparent); }
.ci-card.ci-unread { border-left: 4px solid var(--accent); }
.ci-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ci-country { font-size: calc(12px * var(--fs, 1)); font-weight: 600; padding: 1px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.ci-world { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.ci-new { font-size: calc(10.5px * var(--fs, 1)); font-weight: 700; letter-spacing: .04em; color: #fff; background: var(--accent); border-radius: 4px; padding: 1px 6px; }
.ci-files { font-size: calc(12px * var(--fs, 1)); color: var(--ink-mute); margin-left: auto; }
.ci-title { font-weight: 600; font-size: calc(15px * var(--fs, 1)); line-height: 1.35; }
.ci-prev { font-size: calc(13px * var(--fs, 1)); color: var(--ink-soft); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ci-meta { font-size: calc(12px * var(--fs, 1)); color: var(--ink-mute); margin-top: auto; }
.ci-soon { color: var(--warn, #b45309); font-weight: 600; }
.ci-exp { color: var(--danger); font-weight: 600; font-size: calc(12px * var(--fs, 1)); }
.ci-detail { padding: 20px 24px; max-width: 980px; }
.ci-dtitle { font-size: calc(20px * var(--fs, 1)); margin: 8px 0 10px; }
.ci-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.ci-facts dt { font-size: calc(11.5px * var(--fs, 1)); color: var(--ink-mute); text-transform: uppercase; letter-spacing: .04em; }
.ci-facts dd { margin: 2px 0 0; font-size: calc(13.5px * var(--fs, 1)); }
.ci-body { font-size: calc(14px * var(--fs, 1)); line-height: 1.55; }
.ci-filelist { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.ci-filelist h3 { font-size: calc(14px * var(--fs, 1)); margin: 0 0 6px; }
.ci-filelist ul { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 4px; }
.ci-form { padding: 18px 20px; max-width: 1100px; display: grid; gap: 14px; }
.ci-form label, .ci-aud legend { display: block; font-size: calc(12.5px * var(--fs, 1)); font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; }
.ci-grid { display: grid; grid-template-columns: 2fr 1fr 1.3fr; gap: 12px; }
.ci-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ci-periods { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ci-aud { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 10px 14px 12px; margin: 0; }
.ci-aud legend { padding: 0 4px; }
.ci-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ci-chips .ta-sel-chip button { background: none; border: none; color: inherit; cursor: pointer; padding: 0 0 0 2px; }
.ci-audnote { font-size: calc(12.5px * var(--fs, 1)); color: var(--ink-soft); margin-top: 8px; }
.ci-oldfiles { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ci-off { opacity: .55; text-decoration: line-through; }
.ci-posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; margin-top: 10px; max-height: 55vh; overflow: auto; }
.ci-posters label { display: flex; align-items: center; gap: 6px; font-weight: 400; color: var(--ink); font-size: calc(13px * var(--fs, 1)); }
.ci-posters input { width: auto; }
@media (max-width: 900px) { .ci-grid, .ci-grid2 { grid-template-columns: 1fr; } .ci-list { grid-template-columns: 1fr; } .ci-detail { padding: 16px; } }

/* ---------- Admin → Tasks setup → Delete tasks / Deleted bin (public/taskbin.js) — 2026-11-26 ---------- */
.tb-search { margin-bottom: 12px; }
.tb-search .ta-check input { width: auto; }
.tb-actions { margin: 8px 0; }
.tb-table { max-height: 50vh; overflow: auto; }
.tb-table td:first-child, .tb-table th:first-child { width: 1%; padding-left: 10px; padding-right: 6px; }
.tb-subs { font-size: calc(11.5px * var(--fs, 1)); color: var(--danger); font-weight: 600; white-space: nowrap; }
