/* Task detail: one scrolling body, persistent title/actions, compact properties. */
.wb-task-backdrop { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; }
#task-modal { --task-text: #26303d; --task-muted: #6b7481; --task-edge: rgba(90,105,125,.15); --task-fill: rgba(255,255,255,.46); --task-soft: rgba(106,119,139,.055); color: var(--task-text); width: 860px; max-width: 100%; max-height: min(88dvh, 960px); display: flex; flex-direction: column; padding: 0; border: 1px solid var(--task-edge); border-radius: 20px; overflow: hidden; }
.dark #task-modal { --task-text: #e4e6eb; --task-muted: #a1a5af; --task-edge: rgba(255,255,255,.085); --task-fill: rgba(15,16,20,.28); --task-soft: rgba(255,255,255,.025); }
#task-modal:focus { outline: none; }
#task-modal [hidden] { display: none !important; }
#task-modal details:not([open]) > :not(summary) { display: none !important; }
#task-modal button, #task-modal summary, #task-modal input, #task-modal textarea, #task-modal select { -webkit-tap-highlight-color: transparent; }
#task-modal button:focus-visible, #task-modal summary:focus-visible { outline: 2px solid #8eabc3; outline-offset: 3px; }
#task-modal .wb-task-header { flex: none; display: flex; align-items: flex-start; gap: 12px; padding: 20px 24px 16px; border-bottom: 1px solid var(--task-edge); }
#task-modal .wb-task-heading { flex: 1; min-width: 0; }
#task-modal .wb-task-eyebrow { display: block; color: var(--task-muted); font-size: 11px; margin-bottom: 4px; }
#task-modal .wb-task-created { margin-top: 4px; color: var(--task-muted); font-size: 11px; line-height: 1.5; font-variant-numeric: tabular-nums; }
#task-modal #t-title { width: 100%; min-height: 32px; max-height: 96px; padding: 0 2px; border: 0 !important; border-radius: 3px; background: transparent !important; box-shadow: none !important; font-size: 20px; font-weight: 600; line-height: 1.5; resize: none; color: var(--task-text) !important; }
#task-modal .wb-task-header-actions { display: flex; align-items: center; gap: 4px; }
#task-modal .wb-task-icon-button { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; color: var(--task-muted); flex: none; cursor: pointer; }
#task-modal .wb-task-icon-button:hover, #task-modal .wb-task-quiet:hover { background: var(--task-soft); color: var(--task-text); }
#task-modal .wb-task-more { position: relative; }
#task-modal summary { list-style: none; cursor: pointer; }
#task-modal summary::-webkit-details-marker { display: none; }
#task-modal .wb-task-more-menu { position: absolute; right: 0; top: 38px; z-index: 4; width: 152px; padding: 5px; background: #f5f6f8; border: 1px solid var(--task-edge); border-radius: 12px; box-shadow: 0 12px 28px rgba(0,0,0,.16); }
.dark #task-modal .wb-task-more-menu { background: #292a2f; }
#task-modal .wb-task-more-menu button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px; text-align: left; font-size: 13px; border-radius: 7px; }
#task-modal .wb-task-more-menu button:hover { background: var(--task-soft); }
#task-modal .wb-task-danger { color: #ba5757; }
.dark #task-modal .wb-task-danger { color: #db9696; }
#task-modal .wb-task-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(137,143,154,.32) transparent; }
#task-modal .wb-task-layout { display: grid; grid-template-columns: minmax(0,1fr) 240px; align-items: stretch; }
#task-modal .wb-task-main { grid-column: 1; grid-row: 1; min-width: 0; padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 20px; }
#task-modal .wb-task-properties { grid-column: 2; grid-row: 1; min-width: 0; padding: 18px 18px 24px; background: var(--task-soft); border-left: 1px solid var(--task-edge); }
#task-modal .wb-task-fields, #task-modal .wb-task-dates { display: grid; gap: 9px; }
#task-modal .wb-task-field { display: grid; grid-template-columns: 48px minmax(0,1fr); align-items: center; gap: 8px; font-size: 12px; color: var(--task-muted); min-width: 0; }
#task-modal .wb-task-control { min-width: 0; width: 100%; min-height: 36px; box-sizing: border-box; padding: 7px 9px; border: 1px solid var(--task-edge); border-radius: 8px; background: var(--task-fill); color: var(--task-text); font-size: 13px; line-height: 1.4; }
#task-modal select.wb-task-control { padding-right: 24px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#task-modal .wb-task-date-field { grid-template-columns: 36px minmax(0,1fr); }
#task-modal .wb-task-date-field input { padding-right: 6px; font-variant-numeric: tabular-nums; }
#task-modal .wb-task-date-field input::-webkit-date-and-time-value { text-align: left; }
#task-modal .wb-task-property-group { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--task-edge); }
#task-modal .wb-task-flags { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#task-modal .wb-task-toggle { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 6px; cursor: pointer; font-size: 12px; color: var(--task-muted); min-height: 34px; }
#task-modal .wb-task-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
#task-modal .wb-task-toggle .track { width: 28px; height: 16px; border-radius: 12px; background: rgba(130,138,150,.24); flex: none; transition: background .15s; }
#task-modal .wb-task-toggle .knob { display: block; width: 12px; height: 12px; border-radius: 50%; margin: 2px; background: #aeb4bf; transition: transform .15s; }
#task-modal .wb-task-toggle input:checked + .track { background: rgba(186,102,103,.65); }
#task-modal .wb-task-toggle.important input:checked + .track { background: rgba(178,140,73,.72); }
#task-modal .wb-task-toggle input:checked + .track .knob { transform: translateX(12px); background: #f2e9e7; }
#task-modal .wb-task-toggle input:focus-visible + .track { outline: 2px solid #8eabc3; outline-offset: 3px; }
#task-modal .wb-task-project-label { display: flex; align-items: center; gap: 5px; }
#task-modal #t-project-dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--task-project-color, #9399a3); opacity: .8; }
#task-modal #t-proj { color: color-mix(in srgb, var(--task-project-color, #9399a3) 70%, var(--task-text)) !important; }
#task-modal .wb-task-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; margin-bottom: 6px; }
#task-modal .wb-task-label { color: var(--task-muted); font-size: 12px; font-weight: 500; }
#task-modal .wb-task-section-title { color: var(--task-text); font-size: 13px; font-weight: 500; }
#task-modal .wb-task-count { color: var(--task-muted); font-size: 11px; font-weight: 400; margin-left: 5px; font-variant-numeric: tabular-nums; }
#task-modal .wb-task-remark-wrap { position: relative; }
#task-modal #t-remark { display: block; width: 100%; min-height: 88px; resize: none; overflow: hidden; line-height: 1.7; padding: 10px 12px; }
#task-modal .wb-task-quiet { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 30px; padding: 4px 8px; border-radius: 7px; color: var(--task-muted); font-size: 12px; cursor: pointer; }
#task-modal .wb-task-quiet svg { width: 14px; height: 14px; }
#task-modal .wb-task-empty { color: var(--task-muted); font-size: 12px; padding: 5px 0; }
#task-modal .wb-task-attachments { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
#task-modal .wb-task-attachments > .wb-task-empty { grid-column: 1 / -1; }
#task-modal .wb-task-attachment { position: relative; min-width: 0; border: 1px solid var(--task-edge); border-radius: 10px; overflow: hidden; background: var(--task-soft); }
#task-modal .wb-task-thumbnail { width: 100%; height: 86px; display: flex; align-items: center; justify-content: center; background: var(--task-fill); cursor: pointer; }
#task-modal .wb-task-thumbnail img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
#task-modal .wb-task-attachment-info { padding: 7px 9px; min-width: 0; }
#task-modal .wb-task-attachment-name { display: block; width: 100%; text-align: left; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--task-text); }
#task-modal .wb-task-attachment-size { color: var(--task-muted); font-size: 10px; }
#task-modal .wb-task-attachment-remove { position: absolute; right: 4px; top: 4px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; background: rgba(30,33,40,.76); color: #eceef2; border-radius: 7px; }
#task-modal .wb-task-attachment-remove svg { width: 13px; height: 13px; }
#task-modal .wb-task-file { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 7px 9px; }
#task-modal .wb-task-file .wb-task-attachment-info { flex: 1; padding: 0; }
#task-modal .wb-task-file .wb-task-attachment-remove { position: static; background: transparent; color: var(--task-muted); flex: none; }
#task-modal #t-att-status { display: block; color: var(--task-muted); font-size: 11px; margin-top: 5px; }
#task-modal .wb-task-subs { border-top: 1px solid var(--task-edge); padding-top: 12px; }
#task-modal .wb-task-subs > summary { display: flex; justify-content: space-between; align-items: center; min-height: 30px; gap: 8px; font-size: 13px; }
#task-modal .wb-task-subs > summary::after { content: "+"; color: var(--task-muted); font-size: 16px; }
#task-modal .wb-task-subs[open] > summary::after { content: "−"; }
#task-modal .wb-task-sub-row { display: flex; align-items: center; gap: 8px; min-height: 34px; font-size: 13px; }
#task-modal .wb-task-sub-row input { flex: none; accent-color: #859bac; width: 15px; height: 15px; }
#task-modal .wb-task-sub-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
#task-modal .wb-task-sub-done { color: var(--task-muted); text-decoration: line-through; }
#task-modal .wb-task-completed { padding-top: 4px; }
#task-modal .wb-task-completed > summary { color: var(--task-muted); font-size: 11px; padding: 6px 0; }
#task-modal .wb-task-add-sub { display: flex; gap: 6px; margin-top: 8px; }
#task-modal .wb-task-add-sub input { flex: 1; }
#task-modal .wb-task-tags-selected { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
#task-modal .wb-task-tag { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 7px; border-radius: 6px; color: var(--task-muted); background: var(--task-soft); border: 1px solid var(--task-edge); font-size: 11px; overflow-wrap: anywhere; }
#task-modal .wb-task-tags-editor { margin-top: 5px; }
#task-modal .wb-task-tags-editor > summary { width: fit-content; }
#task-modal #t-tags { margin-top: 5px; }
#task-modal #t-tag-suggest { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
#task-modal .wb-task-tag[aria-pressed="true"] { color: var(--task-text); border-color: rgba(132,155,175,.5); }
#task-modal .wb-task-activity { border-top: 1px solid var(--task-edge); padding-top: 12px; }
#task-modal .wb-task-tabs { display: flex; gap: 16px; margin-bottom: 12px; }
#task-modal .wb-task-tabs button { min-height: 30px; font-size: 12px; color: var(--task-muted); border-bottom: 2px solid transparent; }
#task-modal .wb-task-tabs button[aria-selected="true"] { color: var(--task-text); border-bottom-color: #8c99a8; }
#task-modal #t-comments { display: flex; flex-direction: column; gap: 8px; }
#task-modal .wb-task-comment-compose { position: relative; margin-top: 10px; }
#task-modal #t-comment { min-height: 62px; resize: vertical; }
#task-modal .wb-task-comment-actions { display: flex; justify-content: flex-end; margin-top: 5px; }
#task-modal #t-meta { line-height: 1.8; font-size: 11px; color: var(--task-muted); margin-bottom: 12px; }
#task-modal .wb-task-footer { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 24px; border-top: 1px solid var(--task-edge); background: var(--task-soft); }
#task-modal #t-draft-status { flex: 1; font-size: 11px; color: var(--task-muted); }
#task-modal #t-draft-status[data-dirty="true"] { color: #9f7c45; }
.dark #task-modal #t-draft-status[data-dirty="true"] { color: #cfb789; }
#task-modal .wb-task-button { display: inline-flex; justify-content: center; align-items: center; min-height: 36px; padding: 7px 16px; font-size: 13px; border: 1px solid var(--task-edge); border-radius: 9px; background: var(--task-fill); color: var(--task-text); }
#task-modal .wb-task-primary { background: #53616f; border-color: transparent; color: #fff; font-weight: 500; }
.dark #task-modal .wb-task-primary { background: #60646d; color: #fff; }
#task-modal button:disabled { cursor: wait; opacity: .6; }
@media (max-width: 699px) {
  .wb-task-backdrop { align-items: flex-end; padding: 0; }
  #task-modal { width: 100%; max-height: calc(100dvh - env(safe-area-inset-top) - 12px); border-radius: 18px 18px 0 0; }
  #task-modal .wb-task-header { padding: 14px 16px 10px; gap: 6px; }
  #task-modal #t-title { font-size: 18px; }
  #task-modal .wb-task-layout { display: flex; flex-direction: column; }
  #task-modal .wb-task-properties { order: -1; padding: 12px 16px 14px; border-left: 0; border-bottom: 1px solid var(--task-edge); }
  #task-modal .wb-task-fields { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px 12px; }
  #task-modal .wb-task-fields .wb-task-field { grid-template-columns: 42px minmax(0,1fr); gap: 5px; }
  #task-modal .wb-task-project-field, #task-modal .wb-task-version-field { grid-column: 1 / -1; }
  #task-modal .wb-task-property-group { margin-top: 10px; padding-top: 10px; }
  #task-modal .wb-task-dates { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  #task-modal .wb-task-date-field { grid-template-columns: minmax(0,1fr); gap: 3px; }
  #task-modal .wb-task-main { padding: 16px; gap: 16px; }
  #task-modal .wb-task-control { font-size: 16px; min-height: 44px; }
  #task-modal .wb-task-toggle { min-height: 40px; padding-right: 8px; }
  #task-modal .wb-task-tags-group { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 6px; }
  #task-modal .wb-task-tags-group .wb-task-tags-selected, #task-modal .wb-task-tags-group .wb-task-tags-editor { margin-top: 0; }
  #task-modal .wb-task-tags-editor:not([open]) .wb-task-tag-editor-text { display: none; }
  #task-modal .wb-task-tags-editor[open] { grid-column: 2 / -1; }
  #task-modal .wb-task-icon-button, #task-modal .wb-task-button { min-width: 44px; min-height: 44px; }
  #task-modal .wb-task-quiet, #task-modal .wb-task-tabs button, #task-modal .wb-task-tag, #task-modal .wb-task-subs > summary { min-height: 36px; }
  #task-modal .wb-task-attachments { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #task-modal .wb-task-attachment-remove { width: 32px; height: 32px; }
  #task-modal .wb-task-footer { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  #task-modal, #task-modal * { animation: none !important; transition: none !important; }
}
