/* Sections of a record: the parts and the records that point here (docs/VIEW-DESIGN.md §4, mock 2). Markup: views/sections.js. */
.section-title { font-weight: 550; font-size: var(--fs-body); color: var(--text-2); margin: 24px 0 8px; display: flex; align-items: center; gap: 8px; }
.section-title .spacer { flex: 1; }
.section-title .ico, .section-title .i { margin-right: 6px; }
.sec { margin-top: 6px; }
.sec-empty .btn { padding-left: 4px; }
.sec-head { cursor: pointer; user-select: none; }
.sec-t .fold { display: inline-flex; color: var(--text-4); transition: transform var(--t-fast) var(--ease); transform: rotate(90deg); margin-right: -2px; }
.sec-t .fold svg, .sec-t .fold .i { width: 12px !important; height: 12px !important; }
.sec.folded .fold { transform: rotate(0); }
.sec.folded .sec-body:not(.sliding) { display: none; }
.sec-head .btn { height: 26px; padding: 0 8px; font-size: var(--fs-caption); }
.sec-body > .thread { margin: 6px 0 4px; }
@media (max-width: 860px) {
  .sec-head .btn { padding: 0 8px; }
}
.sec-head .sec-t { display: inline-flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 860px) {
  .sec-head { flex-wrap: nowrap; min-width: 0; }
  .sec-head .sec-t { flex: 0 1 auto; }
  .sec-head > .btn:has(> span) { width: 30px; padding: 0; justify-content: center; }
  .sec-head > .btn:has(> span) > span { display: none; }
  .sec-head > *:not(.sec-t):not(.spacer) { flex: none; } /* the spacer still pushes «?», «+» to the right */
}
.sec-head .sec-tt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subtasks { margin-top: 22px; }
.subtasks-head { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 5px 0 12px; border-radius: var(--r-sm); background: var(--elev2); margin-bottom: 6px; }
.subtasks-head .round-btn { color: var(--icon); }
.sectabs { display: flex; gap: 2px; }
.sectabs button { height: 26px; padding: 0 10px; border: 0; border-radius: var(--r-full); background: transparent; color: var(--text-3); font: inherit; font-size: var(--fs-body); cursor: pointer; }
.sectabs button[aria-pressed="true"] { background: var(--elev); color: var(--text); box-shadow: 0 0 0 1px var(--border-soft); }
@media (hover: hover) { .sectabs button:not([aria-pressed="true"]):hover { background: var(--hover); } }
@media (max-width: 860px) { .sectabs { display: none; } }
.subtasks-fold { display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: var(--fs-body); font-weight: 500; cursor: pointer; min-width: 0; }
.subtasks-fold > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subtasks-fold > .i { flex: none; width: 12px; height: 12px; color: var(--text-4); transform: rotate(90deg); transition: transform var(--t-fast) var(--ease); }
.subtasks.folded .subtasks-fold > .i { transform: none; }
.subtasks-progress { display: inline-flex; align-items: center; gap: 6px; color: var(--text-4); font-size: var(--fs-body); font-variant-numeric: tabular-nums; }
.subtasks-ring { width: 14px; height: 14px; border-radius: 50%; background: conic-gradient(var(--accent) var(--progress), var(--border) 0); -webkit-mask: radial-gradient(transparent 4.5px, #000 5px); mask: radial-gradient(transparent 4.5px, #000 5px); }
.subtasks-progress { flex: none; }
.subtasks-body[hidden] { display: none; }
.subtask-row { display: flex; align-items: center; gap: 9px; min-height: 32px; padding: 4px 8px; border-radius: var(--r-sm); }
@media (hover: hover) { .subtask-row:hover { background: var(--hover); } }
.subtask-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: var(--fs-body); font-weight: 450; text-decoration: none; }
.subtask-row.closed .subtask-title { color: var(--text-3); }
.subtask-expand, .subtask-indent { width: 16px; flex: none; }
.subtask-expand { display: grid; place-items: center; border: 0; background: transparent; color: var(--text-3); padding: 0; height: 28px; cursor: pointer; }
.subtask-expand .i { width: 12px; height: 12px; }
.subtask-expand .i { transition: transform var(--t-fast) var(--ease); }
.subtask-expand[aria-expanded="true"] .i { transform: rotate(90deg); }
.subtask-icon, .subtask-assignee { display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--text-3); }
.subtask-icon .i { display: block; width: 16px; height: 16px; }
.subtask-assignee { width: 24px; }
.subtask-assignee .avatar { width: 22px; height: 22px; }
.subtask-meta { flex: none; display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: var(--fs-caption); }
.subtask-meta .chip { height: 22px; font-size: var(--fs-caption); }
.subtask-id, .subtask-date { flex: none; white-space: nowrap; color: var(--text-4); font-size: var(--fs-caption); font-weight: 500; font-variant-numeric: tabular-nums; }
.subtask-date.overdue, .subtask-date.soon { color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.subtask-children { margin-left: 18px; }
.subtasks-note { padding: 8px 4px; color: var(--text-3); font-size: var(--fs-caption); }
.subtasks-body > .subtasks-note { padding-left: 30px; }
/* a part of a section under its own rows (a case: the open records of its processes), with the process in each row */
.subtasks-part { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding: 6px 4px 4px 30px; color: var(--text-3); font-size: var(--fs-caption); font-weight: 550; }
.subtasks-part .i { width: 13px; height: 13px; }
.subtask-row:has(.part-mark) .subtask-title { flex: 1 1 auto; min-width: 7em; }
.subtask-meta:has(> .part-mark) { flex: 0 1 auto; min-width: 0; }
.part-mark { min-width: 0; max-width: 100%; }
.part-mark .part-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subtasks-more, .subtasks-retry { margin: 6px 0 4px 24px; }
.subtasks-settings { width: min(360px, calc(100vw - 24px)); max-height: calc(100dvh - 96px); overflow-y: auto; padding: 2px 0; }
.subtask-setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); color: var(--text-2); font-size: var(--fs-body); }
.subtask-setting > span { min-width: 0; }
.subtask-setting > .compact-select { width: 154px; max-width: 55%; }
.subtask-properties { padding: 14px 16px; color: var(--text-3); font-size: var(--fs-body); }
.subtask-property-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.subtask-property-buttons .tab { border-color: var(--border-soft); border-radius: var(--r-full); padding: 0 10px; }
.subtask-property-buttons .tab.on { border-color: transparent; }
.subtask-properties .subtasks-note { padding: 10px 0 0; font-size: var(--fs-caption); }
@media (hover: hover) {
  .subtasks-fold:hover { color: var(--text); }
}
@media (max-width: 860px) {
  .subtask-row { min-height: 44px; gap: 6px; padding: 2px 0; }
  .subtask-children { margin-left: 16px; }
}
@media (pointer: coarse) {
  .subtasks-fold, .subtask-expand { min-height: 44px; }
  .subtask-expand, .subtask-indent { width: 24px; }
  .subtask-title { padding: 10px 0; }
}
.sec-head .btn.subtasks-action { height: 32px; padding: 0; }
