.team-work-tools{display:grid;gap:.55rem;margin:.9rem 0;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}.team-work-tools>details{border:1px solid #cbd7df;border-radius:14px;background:#fff;color:#1c3340;padding:.7rem .85rem}.team-work-tools summary{font-weight:750;cursor:pointer}.team-work-tools summary span{margin-inline-start:.55rem;background:#0c5e68;color:white;border-radius:12px;padding:0 .45rem}.team-work-tools details>div{margin-top:.55rem;max-height:19rem;overflow:auto}.team-work-tools form{display:flex;gap:.3rem}.team-work-tools input{flex:1;min-width:0}.team-index-row{display:flex;align-items:center;justify-content:space-between;gap:.45rem;padding:.3rem 0;border-block-end:1px solid #dce5ea}.team-index-row button,.team-case-roots button{font:inherit;color:#174c65;background:transparent;border:0;text-align:start;text-decoration:underline;text-underline-offset:3px;min-height:2.4rem}.team-index-row small,.team-case-roots small{color:#49606c}.team-case-roots:empty{display:none}.team-case-roots,.team-card-facts{display:flex;gap:.35rem;align-items:center;flex-wrap:wrap}.team-card-facts span{background:#e6f2ee;color:#19433e;border-radius:9px;padding:.12rem .48rem}@media(max-width:550px){.team-work-tools{grid-template-columns:1fr}.team-index-row{align-items:flex-start}.team-index-row small{min-width:4.5rem}}
.work-dialog.card-notes-dialog[open] {
  display:flex; flex-direction:column; padding:0; overflow:hidden; box-sizing:border-box;
  inline-size:min(94vw,38rem); block-size:min(80dvh,42rem); max-block-size:95dvh;
}
.card-notes-dialog .follow-case-top {flex:none; position:static; padding:.65rem 1rem}
.card-notes-dialog .follow-case-top small {display:block; color:#43535f; overflow-wrap:anywhere}
.card-notes-dialog .follow-case-top+div {
  display:flex; flex-direction:column; flex:1; min-block-size:0; padding:0; background:#f4f6f8;
}
.card-notes-thread {
  flex:1; min-block-size:0; overflow:auto; overscroll-behavior:contain;
  display:flex; flex-direction:column; align-items:flex-start; gap:.55rem;
  list-style:none; margin:0; padding:1rem;
}
.card-notes-thread>li {flex:none; color:#334955}
.card-notes-message {
  max-inline-size:min(92%,31rem); min-inline-size:min(15rem,85%); box-sizing:border-box;
  border:1px solid #cdd9df; border-radius:.8rem; padding:.5rem .75rem; background:#fff;
  overflow-wrap:anywhere;
}
.card-notes-message>div:first-child {display:flex; align-items:baseline; flex-wrap:wrap; gap:.3rem .8rem; justify-content:space-between}
.card-notes-message time,.card-notes-message small {font-size:.82rem; color:#4d626c}
.card-notes-message p {margin:.25rem 0 0; white-space:pre-wrap}
.card-notes-ai {align-self:flex-end; background:#e8f3ef; border-color:#bfd6ce}
.card-note-summary {margin-block-start:.4rem; border-block-start:1px solid #d1ded9; padding-block-start:.4rem; color:#23534a}
.card-notes-compose {
  flex:none; display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:.3rem .5rem;
  padding:.65rem 1rem max(.65rem,env(safe-area-inset-bottom)); border-block-start:1px solid #cdd9df; background:white;
}
.card-notes-compose textarea {margin:0; min-block-size:2.75rem; max-block-size:7rem; resize:vertical}
.card-notes-compose button {margin:0; min-height:2.75rem}
.card-notes-compose [type=submit] {background:var(--ai-accent,#315d66);color:white}
.card-notes-compose [role=status] {grid-column:1/-1; color:#39515b}
.card-notes-compose [role=status]:empty {display:none}
@media(max-width:550px){
  .work-dialog.card-notes-dialog[open] {inline-size:100%; max-inline-size:100%; block-size:100dvh; max-block-size:100dvh; margin:0; border:0; border-radius:0}
  .card-notes-thread,.card-notes-compose {padding-inline:.7rem}
}
.card-notes-compose {align-items:center}
.card-notes-compose textarea {font:inherit;font-size:max(16px,1rem);width:100%}
.note-compose-actions {display:flex;gap:.35rem;align-items:center;flex-wrap:wrap}
.note-people-toggle[aria-expanded=true] {border-color:#28706a;background:#e7f4ef}
.note-people {grid-column:1/-1;min-inline-size:0;min-block-size:0;margin:0;padding:.35rem .65rem;border:1px solid #cdd9df;border-radius:.65rem}
.note-people[hidden],.note-inbox[hidden] {display:none}
.note-people legend {font-size:.85rem;color:#374e58}
.note-people input[type=search] {width:100%;margin:0;padding:.35rem .5rem;font-size:16px}
.note-people>div {overflow:auto;max-block-size:min(10rem,22dvh);overscroll-behavior:contain}
.note-people label {display:flex;align-items:center;gap:.4rem;padding:.35rem 0;margin:0;cursor:pointer}
.note-people input[type=checkbox] {width:1.1rem;height:1.1rem;margin:0;accent-color:#286660}
.note-receipts {display:flex;flex-wrap:wrap;gap:.3rem .5rem;padding:0;margin:.4rem 0 0;list-style:none;color:#4c606b;font-size:.8rem}
.note-receipts .seen {color:#17624b}
.note-inbox {padding:.7rem 1rem;color:#233d47;background:#f0f6f5}
.note-inbox h3 {margin:0 0 .35rem;font-size:1rem}
.note-inbox>div {max-block-size:26rem;overflow:auto}
.note-inbox article {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.25rem .75rem;align-items:center;padding:.6rem 0;border-block-start:1px solid #d4e1df}
.note-inbox article>button:first-child {justify-self:start;min-inline-size:0;text-align:start;background:transparent;color:#145953;border:0;text-decoration:underline}
.note-inbox article p {margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.note-inbox small {color:#48616a}
.note-inbox button {min-height:2.55rem;margin:0}
.note-inbox [role=status]:empty {display:none}
@media(max-width:650px),(pointer:coarse) and (max-height:650px){
  .work-dialog.card-notes-dialog[open] {
    position:fixed;inset:auto;top:var(--notes-top,0px);left:var(--notes-left,0px);margin:0;border:0;border-radius:0;
    width:var(--notes-width,100vw);max-width:var(--notes-width,100vw);min-height:0;
    height:var(--notes-height,100dvh);max-height:var(--notes-height,100dvh);
  }
  .card-notes-dialog .follow-case-top {padding:.35rem .65rem;min-height:0}
  .card-notes-dialog .follow-case-top small {white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:70vw}
  .card-notes-thread {padding-block:.35rem}
  .card-notes-compose {position:relative;grid-template-columns:minmax(0,1fr);gap:.25rem;padding:.3rem .6rem max(.3rem,env(safe-area-inset-bottom))}
  .card-notes-compose textarea {resize:none;min-height:2.3rem;height:2.8rem}
  .note-compose-actions {justify-content:space-between}
  .card-notes-compose button {min-height:2.4rem;padding-block:.2rem}
  .note-people {position:absolute;z-index:1;inset-inline:.6rem;bottom:100%;background:white;overflow:auto;max-height:max(4rem,calc(var(--notes-height,100dvh) - 11rem));overscroll-behavior:contain}
  .note-people>div {max-height:min(10rem,calc(var(--notes-height,100dvh) * .23))}
  .note-inbox article {grid-template-columns:minmax(0,1fr)}
  .note-inbox article>button:last-child {justify-self:start}
}

.card-identity,.card-urgency-question>div{display:flex;flex-wrap:wrap;align-items:center;gap:.45rem}
.card-identity{margin:.4rem 0 .75rem}
.card-identity-chip{display:inline-flex;align-items:center;gap:.35em;padding:.32em .7em;border:1px solid var(--chip-edge,#c8d7e9);border-radius:999px;background:var(--chip-bg,#e9f1fc);color:var(--chip-ink,#264a74);line-height:1.5}
.card-identity-chip small{font-size:.78em;color:inherit}.card-identity-chip strong{font-size:.94em;color:inherit}
.card-identity-chip[data-color="1"]{--chip-edge:#bad9d0;--chip-bg:#e4f3ed;--chip-ink:#205342}
.card-identity-chip[data-color="2"]{--chip-edge:#e1c8ac;--chip-bg:#fbefdd;--chip-ink:#6a431c}
.card-identity-chip[data-color="3"]{--chip-edge:#d9c4e3;--chip-bg:#f4eaf8;--chip-ink:#603c72}
.card-identity-chip[data-color="4"]{--chip-edge:#c9d4ad;--chip-bg:#eef3e0;--chip-ink:#465624}
.card-identity-chip[data-color="5"]{--chip-edge:#e9c6c6;--chip-bg:#fae9e9;--chip-ink:#773f45}
.card-urgent,.note-urgent-option{display:inline-flex;align-items:center;gap:.35em;border-radius:999px;background:#fff0df;color:#873801;padding:.25rem .65rem;font-weight:650}
.note-urgent-option[hidden]{display:none}.note-urgent-option input{inline-size:1.1rem;block-size:1.1rem;accent-color:#a64e05}
.card-urgency-question{display:grid;gap:.5rem;padding:.8rem;border:1px solid #e1b588;border-radius:.75rem;margin:.6rem 0;background:#fff9f1;color:#482b12}
.card-urgency-question .card-urgent{justify-self:start}.card-urgency-question p{margin:0;overflow-wrap:anywhere}
.card-structure .work-action-notes .card-note-preview{font-size:.82rem;line-height:1.55;margin:.2rem 0;color:#414b53;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.work-action-notes .work-action-buttons{grid-template-columns:1fr}
.progress-note-actions{display:flex;align-items:center;justify-content:space-between;gap:.4rem}
.progress-report .note-people{position:static;max-height:9rem;overflow:auto}
@media(max-width:650px){
 .work-dialog.progress-report[open]{position:fixed;inset:auto;top:var(--notes-top,0px);left:var(--notes-left,0px);width:var(--notes-width,100vw);max-width:100vw;max-height:var(--notes-height,100dvh);margin:0;overflow:auto}
 .progress-report .progress-note-actions{position:sticky;bottom:0;background:white;padding:.2rem 0}
 .progress-report:has(textarea:focus) .card-identity{display:none}
 .progress-report textarea{min-height:2.6rem;max-height:4rem}
 .progress-report .card-flow-fields h3{margin:.25rem 0}
}

/* در گام گزارش، فضای باقی‌مانده بالای صفحه‌کلید به متن اختصاص دارد. */
@media (max-width: 650px), (max-height: 550px) and (pointer: coarse) {
 .work-dialog.progress-report.writing-report[open] {
   position: fixed;
   inset: var(--notes-top, 0px) auto auto var(--notes-left, 0px);
   box-sizing: border-box;
   width: var(--notes-width, 100vw);
   height: var(--notes-height, 100dvh);
   max-width: 100vw;
   max-height: var(--notes-height, 100dvh);
   margin: 0;
   padding: .6rem .75rem max(.5rem, env(safe-area-inset-bottom));
   display: grid;
   grid-template-rows: minmax(0, 1fr);
   overflow: auto;
 }
 .progress-report.writing-report > :is(h2, .card-identity, [hidden], [role=status]:empty) { display: none }
 .progress-report.writing-report .card-flow-fields { min-height: 0; margin: 0; padding: 0 }
 .progress-report.writing-report .progress-writing-fields {
   display: grid;
   grid-template-rows: auto auto minmax(3lh, 1fr) auto auto;
   gap: .25rem;
   margin: 0;
   padding: 0;
   min-height: 0;
 }
 .progress-writing-fields > textarea {
   resize: none;
   font-size: 1rem;
   line-height: 1.5;
 }
 .progress-report.writing-report textarea { height: 100%; min-height: 0; max-height: none; margin: 0 }
 .progress-writing-fields > .note-people { grid-row: 4; max-height: min(9rem, calc(var(--notes-height, 100dvh) * .3)); margin: 0; box-sizing: border-box }
 .progress-writing-fields > .progress-note-actions { grid-row: 5; position: static; margin: 0 }
}
@media (max-width: 650px), (max-height: 550px) and (pointer: coarse) {
 .progress-report.writing-report .progress-note-actions { box-sizing: border-box; padding: 0 }
 .progress-report.writing-report .progress-note-actions button { margin: 0; padding: .35rem .65rem; min-height: 2.5rem }
 .progress-report.writing-report .progress-writing-fields h3 { margin: 0; line-height: 1.35 }
 .progress-report.writing-report .card-flow-fields { grid-template-rows: minmax(0, 1fr) }
}

.note-inbox > summary { cursor:pointer; font-weight:700; padding-block:.25rem }

.note-inbox .notice-bell { margin-inline-end: .4em }
