/* Caboodle Timesheet */
#ts-main { flex: 1; min-height: 0; overflow: auto; background: var(--bg); outline: none; }
.ts-page { max-width: 1180px; margin: 0 auto; padding: 20px 24px 48px; display: flex; flex-direction: column; gap: 16px; }
.ts-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ts-head.ts-sub { margin-top: 18px; }
.ts-title { margin: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 22px; font-weight: 650; text-wrap: balance; }
.ts-range { font-size: 14px; font-weight: 450; color: var(--muted); }
.ts-weeknav { display: flex; gap: 4px; align-items: center; }
.ts-weeknav .btn.icon-only { padding: 4px 6px; }
.ts-jump { border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); color: var(--text-2); font: inherit; font-size: 12px; padding: 3px 6px; }
.ts-person { max-width: 220px; }
.ts-weektotal { margin-left: auto; display: flex; align-items: baseline; gap: 6px; }
.ts-weektotal-n { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--prog-strong, var(--accent-strong)); }
.ts-weektotal-u { color: var(--muted); font-size: 13px; }
.ts-h2 { font-size: 15px; font-weight: 650; margin: 0; }

/* the week */
.ts-gridwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); }
.ts-grid { border-collapse: separate; border-spacing: 0; width: 100%; font-variant-numeric: tabular-nums; }
.ts-grid th, .ts-grid td { border-bottom: 1px solid var(--line-soft); padding: 0; text-align: left; vertical-align: middle; }
.ts-grid thead th { font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
.ts-grid thead th.ts-c-day { text-align: center; }
.ts-dow, .ts-dom { display: block; }
.ts-dow { color: var(--text-2); }
.ts-dom { font-weight: 450; font-size: 11px; }
.ts-grid th.today, .ts-grid td.today { background: color-mix(in srgb, var(--prog, var(--accent)) 7%, transparent); }
.ts-grid thead th.today .ts-dow { color: var(--prog-strong, var(--accent-strong)); }
.ts-grid .weekend { background: color-mix(in srgb, var(--text) 3%, transparent); }
.ts-c-proj { padding: 6px 10px !important; min-width: 200px; }
.ts-grid tbody .ts-c-proj { display: flex; align-items: center; gap: 8px; border-bottom: 0; }
.ts-grid tbody tr { border-bottom: 1px solid var(--line-soft); }
.ts-pname { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.ts-pnum { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.ts-pn { font-weight: 550; overflow: hidden; text-overflow: ellipsis; }
.ts-ptask { font-size: 11px; color: var(--muted); }
.ts-grid tr.extra .ts-pn { font-style: italic; }
.ts-dot { display: inline-block; width: 10px; height: 10px; border-radius: var(--radius-xs); flex: none; margin-right: 6px; vertical-align: -1px; }
.ts-grid .ts-dot { margin-right: 0; }
.ts-c-kind { padding: 6px 10px !important; color: var(--text-2); font-size: 13px; white-space: nowrap; }
.ts-c-day { width: 72px; text-align: center; }
.ts-c-total { width: 64px; text-align: right !important; padding: 6px 10px !important; font-weight: 600; }
.ts-c-act { width: 34px; text-align: center !important; }
.ts-cell { width: 100%; box-sizing: border-box; height: 38px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; text-align: center; font-variant-numeric: tabular-nums; outline: none; border-radius: 0; }
.ts-cell:hover { background: var(--hover); }
.ts-cell:focus { background: var(--surface); box-shadow: inset 0 0 0 2px var(--prog, var(--accent)); }
.ts-cell[readonly] { cursor: default; }
td.has-note { position: relative; }
td.has-note::after { content: ''; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 7px 7px 0; border-color: transparent var(--prog, var(--accent)) transparent transparent; pointer-events: none; }
.ts-rowmenu { opacity: .55; }
tr:hover .ts-rowmenu, .ts-rowmenu:focus-visible { opacity: 1; }
.ts-daytotals th, .ts-daytotals td { padding: 8px 10px; font-weight: 600; background: var(--surface-2); text-align: center; }
.ts-daytotals th { text-align: left; }
.ts-notes th { padding: 8px 10px; font-size: 12px; color: var(--muted); font-weight: 600; vertical-align: top; }
.ts-notes td { vertical-align: top; padding: 4px 3px; border-bottom: 0; }
.ts-note { width: 100%; box-sizing: border-box; resize: vertical; min-height: 48px; border: 1px solid transparent; border-radius: var(--radius-s); background: transparent; color: var(--text); font: inherit; font-size: 12px; line-height: 1.35; padding: 4px; }
.ts-note:hover { border-color: var(--line); }
.ts-note:focus { outline: none; border-color: var(--prog, var(--accent)); background: var(--surface); }
.ts-norows td { padding: 18px 12px; color: var(--muted); text-align: center; }
.ts-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ts-actions .btn, .ts-dl, .ts-head .btn { display: inline-flex; align-items: center; gap: 6px; }
.ts-empty { border: 1px dashed var(--line-strong); border-radius: var(--radius-l); background: var(--surface); }

/* custom exports */
.ts-custom { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.ts-xlist { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); }
.ts-xrow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.ts-xrow:last-child { border-bottom: 0; }
.ts-xic { color: var(--prog, var(--accent)); }
.ts-xname { display: flex; flex-direction: column; flex: 1; min-width: 180px; }
.ts-xrow .btn { display: inline-flex; align-items: center; gap: 6px; }

/* report and projects */
.ts-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); }
.ts-ctl { display: flex; flex-direction: column; gap: 4px; }
.ts-ctl-l { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.ts-ctl .inp { min-width: 130px; }
.ts-tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); }
.ts-table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.ts-table th, .ts-table td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.ts-table thead th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); }
.ts-table tfoot th, .ts-table tfoot td { font-weight: 650; border-top: 2px solid var(--line-strong); border-bottom: 0; }
.ts-table .num { text-align: right; white-space: nowrap; }
.ts-table .strong { font-weight: 600; }
.ts-table .sub { color: var(--text-2); }
.ts-table .mono { font-family: var(--mono); font-size: 12px; }
.ts-table tr.archived td { color: var(--muted); }
.ts-kinds .ts-c-act { width: auto; white-space: nowrap; }
.ts-kinds { border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); }
.ts-tag { margin-left: 8px; font-size: var(--fs-xs); padding: 1px 6px; border-radius: var(--radius-pill); background: var(--sunk); color: var(--muted); }
.ts-none { color: var(--muted); padding: 24px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius-l); }
.ts-foot { color: var(--muted); font-size: 12px; margin: 0; }
.ts-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.ts-notelist { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.ts-notelist dt { color: var(--muted); font-size: 12px; }
.ts-notelist dd { margin: 0; white-space: pre-wrap; }
.ts-form { display: flex; flex-direction: column; gap: 10px; }
.ts-form .muted { color: var(--muted); margin: 0; }
.ts-dlopts { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
@media (max-width: 640px) {
  .ts-page { padding: 12px 16px 32px; }
  .ts-weektotal { margin-left: 0; }
  .ts-c-proj { min-width: 140px; }
}

/* the AI assistant's section, the right panel's whole height (time/assist.js) */
.ts-assist { display: flex; flex-direction: column; min-height: 0; flex: 1; }
/* an open remark (time/remarks.js): a corner on the day's hours, a bar on a row's name, a line over a day */
.ts-grid td.ts-rm { position: relative; box-shadow: inset 0 0 0 2px var(--warn); }
.ts-grid th.ts-c-proj.ts-rm { box-shadow: inset 3px 0 0 var(--warn); }
.ts-grid thead th.ts-rm { box-shadow: inset 0 3px 0 var(--warn); }
