/* Task editor «Дело» (task-editor.js, owned window task-editor-2). Tokens only: spacing --dj-space-*, radii --dj-radius-*,
   text roles --dj-text-*, colours of the theme (--panel, --ink, --muted, --line, --accent, --bg). No !important.
   The host is shared with the Workspace (it sets data-ws-* on it and may put the Overview into it); the window is ours. */
.r21-entity-backdrop:has(.entity-menu-v2){display:flex;align-items:flex-start;justify-content:center;padding:0;background:var(--bg)}
.entity-menu-v2{--dj-editor-form-overflow:hidden;display:flex;flex-direction:column;inline-size:min(100%,640px);max-inline-size:640px;block-size:var(--dolijane-viewport-height,100dvh);max-block-size:none;margin:0;padding:0;overflow:hidden;background:var(--panel);color:var(--ink);font-size:var(--dj-text-body-size);line-height:var(--dj-text-body-line-height)}
.entity-menu-v2 .entity-menu-head{display:grid;grid-template-columns:44px minmax(0,1fr) auto;align-items:start;gap:var(--dj-space-2);flex:0 0 auto;margin:0;padding:var(--dj-space-3);border-block-end:1px solid var(--line);background:var(--panel)}
.entity-menu-v2 .entity-menu-head>textarea{min-inline-size:0;inline-size:100%;min-block-size:44px;border:0;background:none;color:var(--ink);font-family:var(--font-display,inherit);font-size:var(--dj-text-title-size);line-height:var(--dj-text-title-line-height);font-weight:var(--dj-text-title-weight);resize:none;overflow:hidden}
.entity-menu-v2 .entity-menu-head>.v22-icon,.entity-menu-v2 .entity-menu-head>.r21-project-mark{justify-self:center;color:var(--artifact-color,var(--accent))}
.entity-menu-v2 .entity-menu-head>.dj-local-status{grid-column:1/-1;justify-self:stretch}
.entity-menu-v2 .r21-editor-actions{display:flex;gap:var(--dj-space-1)}
.entity-menu-v2 .r21-editor-actions>button,.entity-menu-v2 [data-r21-status]{display:grid;place-items:center;inline-size:44px;block-size:44px;min-inline-size:44px;padding:0;border:0;border-radius:var(--dj-radius-button);background:none;color:var(--muted)}
.entity-menu-v2 .r21-editor-actions>[type=submit]{background:var(--accent);color:var(--panel)}
/* The project and Idea editors use the same compact right action slots as Deal:
   More 44px, Cancel/OK 32px, and 4px between slots. */
.entity-menu-v2 .r21-editor-actions{gap:var(--dj-space-1)}
.entity-menu-v2 .r21-editor-actions>[data-r21-status]{flex:0 0 44px}
.entity-menu-v2 .r21-editor-actions>:is([data-r21-cancel],[type=submit]){box-sizing:border-box;flex:0 0 32px;width:32px;min-width:32px;max-width:32px;inline-size:32px;min-inline-size:32px;max-inline-size:32px;height:44px;min-height:44px;max-height:44px;block-size:44px;min-block-size:44px;max-block-size:44px;padding:0}
.entity-menu-v2 .entity-menu-scroll{flex:1 1 auto;min-block-size:0;overflow:auto;padding:var(--dj-space-2) var(--dj-space-4) var(--dj-space-8);scrollbar-width:thin;scrollbar-color:transparent transparent}
.entity-menu-v2 .entity-menu-scroll:hover,.entity-menu-v2 .entity-menu-scroll[data-entity-scrolling="true"]{scrollbar-color:var(--muted) transparent}
.entity-menu-v2 .r23-project-fields{inline-size:100%;min-inline-size:0}
.entity-menu-v2 .r23-description{margin-block:0 var(--dj-space-3)}
.entity-menu-v2 .r23-description>.r23-project-row{border:0;background:none;color:var(--muted)}
.entity-menu-v2 .r23-description [data-r23-description-body]{margin:0;padding:0;border:0;border-radius:0;background:none}
.entity-menu-v2 .r23-description textarea{display:block;box-sizing:border-box;inline-size:calc(100% - 2*var(--dj-space-4));min-block-size:44px;margin:0 var(--dj-space-4);padding:var(--dj-space-2) 0;border:0;background:none;color:var(--ink);font-size:var(--dj-text-reading-size);line-height:var(--dj-text-reading-line-height);resize:none;overflow:hidden}
.entity-menu-v2 .r23-description textarea::placeholder{color:var(--muted)}
.entity-menu-v2 .r23-project-stack{border:1px solid var(--line);border-radius:var(--dj-radius-card);overflow:hidden}
.entity-menu-v2 .r23-project-stack[hidden],.entity-menu-v2 .r23-project-stack>.r23-project-row[hidden]{display:none}
.entity-menu-v2 .entity-menu-add-list{display:flex;flex-direction:column;gap:var(--dj-space-1);margin-block-end:var(--dj-space-2);padding:var(--dj-space-2);border:1px solid var(--line);border-radius:var(--dj-radius-popup);background:var(--panel)}
.entity-menu-v2 .entity-menu-add-list[hidden],body>.entity-menu-add-list[hidden]{display:none}
body>.entity-menu-add-list{display:flex;flex-direction:column;gap:var(--dj-space-1)}
body>.entity-menu-add-list>button{min-block-size:44px;border:0;background:none;color:var(--ink);font:inherit;text-align:start}
.entity-menu-v2 .entity-menu-details{margin-block-start:var(--dj-space-4)}
.entity-menu-v2 .entity-menu-details-head{display:flex;align-items:center;justify-content:space-between;min-block-size:44px}
.entity-menu-v2 .entity-menu-details-title{padding:0;border:0;background:none;color:var(--muted);font:inherit;font-weight:var(--dj-text-heading-weight);cursor:pointer}
.entity-menu-v2 .entity-menu-add{min-block-size:44px;padding:0 var(--dj-space-2);border:0;background:none;color:var(--accent);font:inherit;cursor:pointer}
.entity-menu-v2 .entity-menu-add-list>button{min-block-size:44px;border:0;background:none;color:var(--ink);font:inherit;text-align:start}
.entity-menu-v2 .r23-project-row{box-sizing:border-box;display:flex;align-items:center;gap:var(--dj-space-2);inline-size:100%;min-block-size:56px;padding:0 var(--dj-space-2);border:0;border-block-end:1px solid var(--line);background:none;color:var(--ink);font:inherit;text-align:left}
.entity-menu-v2 .r23-project-stack>.r23-project-row:last-child{border-block-end:0}
.entity-menu-v2 .r23-project-row>.v22-icon{inline-size:var(--dj-icon-standard,20px);block-size:var(--dj-icon-standard,20px);flex:0 0 var(--dj-icon-standard,20px);margin-inline:var(--dj-space-3);color:var(--muted)}
.entity-menu-v2 .r23-project-row>.dj-utility-symbol{inline-size:var(--dj-icon-standard,20px);flex:0 0 var(--dj-icon-standard,20px);margin-inline:var(--dj-space-3);text-align:center}
.entity-menu-v2 .r23-project-row>button{min-block-size:44px;min-inline-size:0;padding:0;border:0;background:none;color:inherit;font:inherit;text-align:left}
.entity-menu-v2 .r23-project-comments{margin-block-start:var(--dj-space-4)}
.entity-menu-v2 .r23-comment-head{min-block-size:44px;padding:0}
.entity-menu-v2 .r23-comment-head [data-r23-comments-toggle]{flex:0 1 auto;color:var(--muted);font-weight:var(--dj-text-heading-weight)}
.entity-menu-v2 .r23-comment-head .v19-count{order:1;margin:0;color:var(--muted);font-weight:var(--dj-text-heading-weight)}
.entity-menu-v2 .r23-comment-head [data-r23-comment-add]{order:2;display:grid;place-items:center;inline-size:44px;min-block-size:44px;margin-inline-start:auto;padding:0}
.entity-menu-v2 .r23-comment-head{justify-content:flex-start;gap:var(--dj-space-2)}
.entity-menu-v2 .r23-comment-head [data-r23-comments-toggle]{flex:0 0 auto;min-block-size:44px;padding:0;color:var(--muted);font-weight:var(--dj-text-heading-weight)}
.entity-menu-v2 .r23-comment-head [data-r23-comments-toggle],.entity-menu-v2 .r23-comment-head [data-r23-comments-toggle] span{color:var(--muted)}
.entity-menu-v2 .r23-comment-head .v19-count{color:var(--muted);font-variant-numeric:tabular-nums}
/* Project and Idea use the same Details typography and grouped Add sheet as Delo. */
.entity-menu-v2 :is(.entity-menu-details-head,.r23-comment-head){font-family:var(--dj-font-ui,var(--font,inherit));font-size:var(--dj-text-secondary-size);font-weight:var(--dj-text-heading-weight);line-height:var(--dj-text-heading-line-height)}
.entity-menu-v2 :is(.entity-menu-details-title,.r23-comment-head [data-r23-comments-toggle],.r23-comment-head [data-r23-comments-toggle] span,.r23-comment-head .v19-count){font:inherit;color:var(--muted)}
.entity-menu-v2 .entity-menu-add{font:inherit;color:var(--accent);border:0;background:transparent;box-shadow:none}
.entity-menu-v2 .r23-project-row>:is(.v22-icon,.dj-utility-symbol,.dj-project-entity-mark){display:inline-grid;place-items:center;align-self:center;line-height:1;flex:0 0 var(--dj-icon-standard,20px);inline-size:var(--dj-icon-standard,20px);block-size:var(--dj-icon-standard,20px)}
.entity-menu-v2 .r23-project-row>:is(span:not(.v22-icon):not(.dj-utility-symbol):not(.dj-project-entity-mark),button){align-self:center;line-height:var(--dj-text-body-line-height)}
body>.entity-menu-add-list>.entity-menu-add-group{display:flex;flex-direction:column}
body>.entity-menu-add-list>.entity-menu-add-group>h3{margin:var(--dj-space-2) var(--dj-space-2) var(--dj-space-1);color:var(--muted);font-size:var(--dj-text-secondary-size);font-weight:var(--dj-text-heading-weight)}
body>.entity-menu-add-list>.entity-menu-add-group>button{min-block-size:48px;padding:0 var(--dj-space-2);border:0;background:transparent;color:var(--ink);font:var(--dj-text-body-size)/var(--dj-text-body-line-height) var(--dj-font-ui,var(--font,inherit));text-align:start}
.entity-menu-v2 .entity-comment-add{display:inline-flex;align-items:center;min-block-size:44px;padding:0;border:0;background:none;color:var(--accent);font:inherit;cursor:pointer}
.entity-menu-v2 .r23-comment-card{display:flex;flex-direction:column;gap:var(--dj-space-1);position:relative;background:var(--panel);padding-inline-end:calc(var(--dj-space-8) + var(--dj-space-3));border-radius:0}
.entity-menu-v2 .r23-comment-card small{color:var(--muted);font-size:var(--dj-text-caption-size)}
.entity-menu-v2 .r23-comment-edit{position:absolute;inset-inline-end:var(--dj-space-2);top:var(--dj-space-2)}
@media(min-width:600px){.r21-entity-backdrop:has(.entity-menu-v2){padding:var(--dj-space-4)}.entity-menu-v2{block-size:calc(var(--dolijane-viewport-height,100dvh) - 2*var(--dj-space-4));border:1px solid var(--line);border-radius:var(--dj-radius-window)}}
@media(max-width:599px){
 html body .r21-entity-backdrop>.dj-editor-shell:has(>.entity-menu-v2){inline-size:100vw;min-inline-size:100vw;max-inline-size:100vw;block-size:var(--dolijane-viewport-height,100dvh);max-block-size:none;border:0;border-radius:0}
 html body .r21-entity-backdrop>.dj-editor-shell>form.modal.entity-menu-v2{padding:0;overflow:hidden}
 .entity-menu-v2 .entity-menu-head{grid-template-columns:32px minmax(0,1fr) auto;gap:var(--dj-space-1);padding:var(--dj-space-3) var(--dj-space-3) var(--dj-space-2)}
}
.te-host{position:fixed;inset:0;z-index:100100;display:grid;place-items:start center;background:var(--bg);overflow:hidden;}
.te-host[data-ws-column="true"]{grid-template-columns:minmax(0,var(--dj-editor-column,640px)) auto;place-items:stretch;justify-content:start;}
.te-window{position:relative;display:flex;flex-direction:column;inline-size:100%;max-inline-size:640px;block-size:var(--dolijane-viewport-height,100dvh);background:var(--panel);color:var(--ink);font-size:var(--dj-text-body-size);line-height:var(--dj-text-body-line-height);}
@media (min-width:600px){
 .te-host{background:var(--bg);padding:var(--dj-space-4);}
 .te-window{block-size:calc(var(--dolijane-viewport-height,100dvh) - 2*var(--dj-space-4));border:1px solid var(--line);border-radius:var(--dj-radius-window);box-shadow:var(--shadow);overflow:hidden;}
}
@media (min-width:1025px){
 .te-host{padding:0}
 .te-window{block-size:var(--dolijane-viewport-height,100dvh);border-block:0;border-radius:0}
}
.te-visually-hidden{position:absolute;inline-size:1px;block-size:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;}

/* Device-local fallback uses visible buttons because Android WebView did not open the native select. */
.settings-task-menu-choice{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));inline-size:min(100%,320px);border:1px solid var(--line);border-radius:var(--dj-radius-chip);overflow:hidden;}
.settings-task-menu-choice>button{min-block-size:44px;padding:var(--dj-space-2) var(--dj-space-3);border:0;background:var(--panel);color:var(--ink);font:inherit;cursor:pointer;}
.settings-task-menu-choice>button+button{border-inline-start:1px solid var(--line);}
.settings-task-menu-choice>button[aria-pressed="true"]{background:var(--accent-soft);font-weight:var(--dj-text-heading-weight);}
.settings-task-menu-choice>button:focus-visible{outline:2px solid var(--accent);outline-offset:-2px;}
@media(max-width:599px){.settings-task-menu-choice{inline-size:100%;}}

/* Header: fixed at the top, the pair Cancel / OK always visible (DS-ACT-03). */
.te-head{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:var(--dj-space-2);padding:var(--dj-space-3) var(--dj-space-3) var(--dj-space-2);border-block-end:1px solid var(--line);background:var(--panel);}
.te-state{display:inline-flex;align-items:center;border:1px solid var(--line);border-radius:var(--dj-radius-pill);min-block-size:44px;}
.te-circle,.te-state-more,.te-cancel,.te-ok,.te-digit,.te-row-plus,.te-child-circle{display:inline-grid;place-items:center;min-inline-size:44px;min-block-size:44px;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer;}
.te-circle::before,.te-child-circle::before{content:"";inline-size:22px;block-size:22px;border:2px solid var(--muted);border-radius:var(--dj-radius-circle);}
.te-circle[data-te-glyph]:not([data-te-glyph=""])::before{content:none;}
.te-circle[data-te-glyph]:not([data-te-glyph=""])>.v22-icon{inline-size:var(--dj-icon-standard);block-size:var(--dj-icon-standard);color:currentColor;}
.te-window[data-te-status="done"] .te-circle::before,.te-child-circle[aria-pressed="true"]::before{background:var(--accent);border-color:var(--accent);}
.te-state-more{min-inline-size:32px;color:var(--muted);}
.te-title-wrap{display:block;min-inline-size:0;}
.te-title{display:block;inline-size:100%;min-block-size:44px;padding:var(--dj-space-2) 0;border:0;background:none;color:var(--ink);resize:none;overflow:hidden;font-size:var(--dj-text-title-size);line-height:var(--dj-text-title-line-height);font-weight:var(--dj-text-title-weight);}
.te-title:focus{outline:none;}
.te-title.te-invalid::placeholder{color:var(--accent);}
.te-actions{display:inline-flex;gap:var(--dj-space-1);}
.te-cancel{color:var(--muted);border-radius:var(--dj-radius-button);}
.te-ok{color:var(--panel);background:var(--accent);border-radius:var(--dj-radius-button);}
.te-window .te-ok .v22-icon,.te-window .te-ok .v22-icon .v22-main>*{color:white;stroke:white}
.te-chips{display:flex;flex-wrap:wrap;gap:var(--dj-space-1);padding:0 var(--dj-space-4);}
.te-chips[hidden]{display:none;}
.te-parse{padding:0 var(--dj-space-2);border-radius:var(--dj-radius-chip);background:var(--bg);color:var(--muted);font-size:var(--dj-text-caption-size);line-height:var(--dj-text-caption-line-height);}

/* Description: a quiet line under the title, no icon and no frame; grows while typing (DS-SCR-08). */
.te-description{display:block;min-block-size:44px;margin:0 var(--dj-space-4);padding:var(--dj-space-2) 0;border:0;background:none;color:var(--ink);resize:none;overflow:hidden;font-size:var(--dj-text-reading-size);line-height:var(--dj-text-reading-line-height);}
.te-description::placeholder{color:var(--muted);}
.te-description:focus{outline:none;}

.te-kinds{display:grid;grid-template-columns:repeat(3,1fr);flex:0 0 auto;min-block-size:44px;margin:var(--dj-space-2) var(--dj-space-4);border:1px solid var(--line);border-radius:var(--dj-radius-pill);overflow:hidden;}
.te-kind{display:grid;place-items:center;min-block-size:44px;border:0;background:none;color:var(--muted);font:inherit;cursor:pointer;}
.te-kind[aria-checked="true"]{background:var(--bg);color:var(--ink);font-weight:var(--dj-text-heading-weight);}

.te-scroll{flex:1 1 auto;min-block-size:0;overflow:auto;padding:var(--dj-space-2) var(--dj-space-4) var(--dj-space-8);scrollbar-width:thin;scrollbar-color:transparent transparent;}
.te-scroll:hover,.te-scroll[data-te-scrolling="true"]{scrollbar-color:var(--muted) transparent;}
.te-scroll::-webkit-scrollbar{inline-size:8px;}
.te-scroll::-webkit-scrollbar-thumb{background:transparent;border-radius:var(--dj-radius-pill);}
.te-scroll:hover::-webkit-scrollbar-thumb,.te-scroll[data-te-scrolling="true"]::-webkit-scrollbar-thumb{background:var(--muted);}
/* Grouped cards: one frame, thin dividers, rounded only at the edges. */
.te-card{border:1px solid var(--line);border-radius:var(--dj-radius-card);overflow:hidden;}
.te-card[hidden]{display:none;}
.te-card+.te-section,.te-section+.te-section{margin-block-start:var(--dj-space-4);}
.te-row{display:grid;grid-template-columns:44px minmax(0,1fr) auto;align-items:center;inline-size:100%;min-block-size:56px;padding:0 var(--dj-space-2) 0 0;border:0;border-block-end:1px solid var(--line);background:none;color:inherit;font:inherit;text-align:start;}
.te-row:last-child{border-block-end:0;}
button.te-row{cursor:pointer;}
.te-icon{display:inline-grid;place-items:center;inline-size:44px;color:var(--muted);}
.te-label{min-inline-size:0;}
.te-value{justify-self:end;}
.te-muted{color:var(--muted);}
.te-digits{display:inline-flex;justify-self:end;}
.te-digit{color:var(--muted);font-size:var(--dj-text-secondary-size);}
.te-digit[aria-pressed="true"]{color:var(--ink);font-size:var(--dj-text-body-size);font-weight:var(--dj-text-heading-weight);}
.te-tags .te-chip-list{display:flex;flex-wrap:wrap;gap:var(--dj-space-1);}
.te-chip{min-block-size:32px;padding:0 var(--dj-space-2);border:1px solid var(--line);border-radius:var(--dj-radius-chip);background:none;color:inherit;font:inherit;cursor:pointer;}

/* Sections: a heading without a frame, the count after it, «+ Добавить» on the right. */
.te-section-head{display:flex;align-items:center;justify-content:space-between;min-block-size:44px;}
.te-section-title{padding:0;border:0;background:none;color:var(--muted);font:inherit;font-weight:var(--dj-text-heading-weight);}
button.te-section-title{cursor:pointer;}
.te-section[data-te-expanded="false"]>:not(.te-section-head){display:none;}
.te-add{min-block-size:44px;padding:0 var(--dj-space-2);border:0;background:none;color:var(--accent);font:inherit;cursor:pointer;}
.te-list{margin:0;padding:0;list-style:none;}
.te-item{display:grid;grid-template-columns:44px minmax(0,1fr) auto;align-items:center;min-block-size:44px;}
.te-comment{grid-template-columns:minmax(0,1fr);padding:var(--dj-space-2) 0;border-block-end:1px solid var(--line);}
.te-quiet{display:block;inline-size:100%;min-block-size:44px;padding:0;border:0;border-block-end:1px solid transparent;background:none;color:var(--ink);font:inherit;}
.te-quiet::placeholder{color:var(--muted);}
.te-quiet:focus{outline:none;border-block-end-color:var(--line);}

/* The window's own sheet: from the bottom on a phone, a popover under the trigger otherwise. */
.te-layer{position:absolute;inset:0;z-index:2;background:color-mix(in srgb,var(--ink) 24%,transparent);}
.te-layer[hidden]{display:none;}
/* While a sheet is open the window stands above the Dock the Workspace puts beside it (z-index 6 in the host). */
.te-window[data-te-layer="open"]{z-index:7;}
.te-sheet{position:absolute;inset-inline:0;inset-block-end:var(--te-keyboard-inset,0px);display:flex;flex-direction:column;max-block-size:min(70%,calc(100% - var(--te-keyboard-inset,0px)));overflow:auto;padding:var(--dj-space-2) var(--dj-space-4) var(--dj-space-4);background:var(--panel);border-radius:var(--dj-radius-popup) var(--dj-radius-popup) 0 0;box-shadow:var(--shadow);}
.te-layer[data-te-layout="popover"]{background:none;}
.te-layer[data-te-layout="popover"] .te-sheet{inset-block:var(--te-layer-top,0px) auto;inset-inline:auto var(--dj-space-4);inline-size:320px;border:1px solid var(--line);border-radius:var(--dj-radius-popup);}
.te-sheet-group{margin:var(--dj-space-2) 0 0;color:var(--muted);font-size:var(--dj-text-caption-size);}
.te-sheet-row{display:flex;align-items:center;gap:var(--dj-space-2);min-block-size:var(--dj-minheight-popup-row,48px);padding:0 var(--dj-space-2);border:0;border-radius:var(--dj-radius-popup-row);background:none;color:inherit;font:inherit;text-align:start;cursor:pointer;}
.te-sheet-row small{margin-inline-start:auto;color:var(--muted);}
.te-sheet-row[aria-pressed="true"]{background:var(--bg);font-weight:var(--dj-text-heading-weight);}
.te-search{min-block-size:44px;margin-block-end:var(--dj-space-2);padding:0 var(--dj-space-2);border:1px solid var(--line);border-radius:var(--dj-radius-field);background:var(--panel);color:var(--ink);font:inherit;}
.te-tag-choices{display:flex;flex-direction:column;}
.te-sheet-done{align-self:end;min-block-size:44px;padding:0 var(--dj-space-3);border:0;background:none;color:var(--accent);font:inherit;cursor:pointer;}

/* Fields of «Детали» (phase 2): a link row is its value across the whole row; the name is cut only when it is longer. */
.te-value-line{grid-column:2 / 4;min-inline-size:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.te-sheet-line{display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:center;}
.te-sheet-line[hidden]{display:none;}
.te-pin{min-inline-size:44px;min-block-size:44px;border:0;background:none;color:var(--muted);cursor:pointer;}
.te-pin[aria-pressed="true"]{color:var(--accent);}
.te-choices{display:flex;flex-direction:column;}
/* Tree depth: one step of the spacing scale per level (8б-2). */
.te-choice{padding-inline-start:calc(var(--dj-space-2) + var(--te-depth,0px));}
.te-choice .te-icon{inline-size:auto;}
.te-dot{display:inline-block;inline-size:12px;block-size:12px;border-radius:var(--dj-radius-circle);background:currentColor;}

/* Key block of the kind (phase 3, DS-SCR-08): framed, above the card «Срок · Приоритет»; empty for a Задача. */
.te-key{display:flex;flex-direction:column;gap:var(--dj-space-2);margin-block-end:var(--dj-space-4);padding:var(--dj-space-2) var(--dj-space-3);border:1px solid var(--line);border-radius:var(--dj-radius-card);}
.te-key[hidden]{display:none;}
.te-key-line{display:flex;flex-wrap:wrap;align-items:center;gap:var(--dj-space-2);min-block-size:44px;}
.te-key-choice{display:inline-flex;align-items:center;gap:var(--dj-space-1);min-block-size:44px;padding:0 var(--dj-space-2);border:1px solid var(--line);border-radius:var(--dj-radius-field);background:none;color:var(--ink);font:inherit;cursor:pointer;}
.te-key-word{color:var(--muted);}
.te-caret{display:inline-grid;place-items:center;color:var(--muted);}
.te-target{inline-size:6em;min-block-size:44px;padding:0 var(--dj-space-2);border:1px solid var(--line);border-radius:var(--dj-radius-field);background:var(--panel);color:var(--ink);font:inherit;text-align:end;}
.te-key .te-kinds{grid-template-columns:repeat(2,1fr);margin:0;}
.te-toggle{justify-self:start;min-block-size:44px;padding:0 var(--dj-space-3);border:1px solid var(--line);border-radius:var(--dj-radius-pill);background:none;color:var(--muted);font:inherit;cursor:pointer;}
.te-toggle[aria-pressed="true"]{background:var(--bg);color:var(--ink);font-weight:var(--dj-text-heading-weight);}
.te-key>.te-toggle{align-self:start;}
.te-source{grid-template-columns:minmax(0,1fr) auto auto;gap:var(--dj-space-1);}
.te-source .te-row{border-block-end:0;min-block-size:44px;}
.te-more{display:inline-grid;place-items:center;min-inline-size:44px;min-block-size:44px;padding:0;border:0;background:none;color:var(--muted);font:inherit;cursor:pointer;}
.te-section[hidden]{display:none;}

/* The reason a save was refused, under the head; the window shakes a little at the same time. */
.te-error{margin:0 var(--dj-space-4);padding:var(--dj-space-1) 0;color:var(--accent);font-size:var(--dj-text-secondary-size);}
.te-error[hidden]{display:none;}

/* Motion: the window rises from the bottom of the screen and leaves the same way (the motion of the current menu). */
@keyframes te-rise{from{translate:0 100vh;opacity:.15;}to{translate:0 0;opacity:1;}}
@keyframes te-shake{0%,100%{translate:0 0;}20%{translate:-6px 0;}40%{translate:5px 0;}60%{translate:-4px 0;}80%{translate:2px 0;}}
.te-host[data-te-motion="wait"]>.te-window{translate:0 100vh;opacity:.15;}
.te-host[data-te-motion="in"]>.te-window{animation:te-rise .45s cubic-bezier(.22,.68,.24,1);}
.te-host[data-te-motion="out"]{pointer-events:none;}
.te-host[data-te-motion="out"]>.te-window{translate:0 100vh;opacity:.1;transition:translate .42s cubic-bezier(.5,0,.75,.4),opacity .42s ease;}
.te-window[data-te-shake]{animation:te-shake .32s ease-out;}
@media (prefers-reduced-motion:reduce){
 .te-host[data-te-motion]>.te-window,.te-window[data-te-shake]{animation:none;transition:none;translate:none;opacity:1;}
}

/* «Отслеживать» under «Срок» (phase 4): a three-way segment, then the condition for a period. */
.te-track{grid-template-columns:44px minmax(0,1fr);row-gap:var(--dj-space-1);padding-block:var(--dj-space-2);}
.te-track .te-track-kinds{grid-column:2 / 3;grid-template-columns:repeat(3,1fr);margin:0 var(--dj-space-2) 0 0;}
.te-track-line{grid-template-columns:minmax(0,1fr);padding:var(--dj-space-1) var(--dj-space-3);}
.te-track-line>.te-icon{display:none;}
.te-track-line .te-key-line{flex-wrap:nowrap;}
.te-track-line .te-target{inline-size:4em;}

/* Fixes after the phase 5 review (owner 2026-10-27). */
/* Phone: the Workspace puts the Dock (DS-NAV-04) into the host after the window; the window takes the rest of the height. */
@media (max-width:599px){
 .te-host{grid-template-rows:minmax(0,1fr) auto;align-items:stretch;}
 .te-window{block-size:auto;min-block-size:0;}
 .te-host>.dj-system-dock{justify-self:stretch;}
}
/* Priority: the flag and the status circle take the colour of the priority (tokens --dj-priority-N; the shared .priority-flag is rewritten by v58.js). */
.te-flag{display:inline-grid;place-items:center;min-inline-size:44px;min-block-size:44px;padding:0;border:0;background:none;cursor:pointer;}
.te-digit.te-flag[aria-pressed="true"]{background:var(--bg);border-radius:var(--dj-radius-pill);}
.te-p1{color:var(--dj-priority-1);}.te-p2{color:var(--dj-priority-2);}.te-p3{color:var(--dj-priority-3);}.te-p4{color:var(--dj-priority-4);}
.te-circle[class*="te-p"]::before{border-color:currentColor;}
/* The icon of a flag takes the colour of its button (v22.css paints every .v22-icon with the accent). */
.te-flag .v22-icon{color:inherit;}
/* A chosen flag keeps its colour (the chosen digit rule above paints it with the ink). */
.te-flag.te-p1{color:var(--dj-priority-1);}.te-flag.te-p2{color:var(--dj-priority-2);}.te-flag.te-p3{color:var(--dj-priority-3);}.te-flag.te-p4{color:var(--dj-priority-4);}
.te-window[data-te-status="done"] .te-circle[class*="te-p"]::before{background:currentColor;}
.te-danger{color:var(--accent);}
/* Comments: text, attachments, decision; edit and delete at the end of the row. */
.te-comment{grid-template-columns:minmax(0,1fr) auto auto;align-items:start;}
.te-comment-body{display:flex;flex-direction:column;gap:var(--dj-space-1);min-inline-size:0;}
.te-comment-text{margin:0;overflow-wrap:anywhere;}
.te-attachments{display:flex;flex-wrap:wrap;gap:var(--dj-space-2);}
.te-attachment{display:inline-flex;align-items:center;gap:var(--dj-space-1);color:var(--accent);}
.te-link{align-self:start;padding:0;border:0;background:none;color:var(--accent);font:inherit;font-size:var(--dj-text-secondary-size);cursor:pointer;}
.te-comment-compose{display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:center;}
.te-host :is(button,[role="button"],[role="tab"],[role="menuitem"],summary,a,input,textarea,[contenteditable="true"]){-webkit-tap-highlight-color:transparent;}
