/* Operate: shared graphite palette, an actionable kanban board and a
   protected task inspector. On phones the inspector uses the dynamic viewport. */
.team-tasks-page { --task-line: #e2e6ed; --task-muted: #626b7b; padding: 24px; color: #262a30; font-size: 14px; line-height: 1.5; }
.team-tasks-page * { box-sizing: border-box; }
.workspace:has(.team-tasks-page) { animation: none !important; }
.team-tasks-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.team-tasks-heading h1 { margin: 0; font-size: 30px; line-height: 1.25; font-weight: 600; letter-spacing: -.025em; }
.team-tasks-heading p { margin: 8px 0 0; color: var(--task-muted); font-size: 14px; font-weight: 400; }
.team-tasks-heading > div:last-child { display: flex; gap: 8px; }
.team-tasks-page .btn { min-height: 40px; font-size: 14px; font-weight: 500; line-height: 20px; padding: 9px 14px; }
.team-tasks-page .btn svg { width: 18px; height: 18px; }
.team-tasks-summary { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-bottom: 20px; color: var(--task-muted); font-size: 13px; }
.team-tasks-page .is-late { color: #9b3e3e; }
.team-tasks-toolbar { display: flex; flex-direction: column; gap: 16px; padding: 16px; background: #fff; border: 1px solid var(--task-line); border-radius: 12px; }
.team-tasks-toolbar nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; }
.team-tasks-toolbar nav button { display: flex; align-items: center; gap: 8px; flex-shrink: 0; border: 0; border-radius: 8px; background: transparent; padding: 10px 14px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--task-muted); }
.team-tasks-toolbar nav button[aria-pressed="true"] { color: #303740; background: #e9ecf0; }
.team-tasks-toolbar nav button:hover { background: #f0f2f5; }
.team-tasks-toolbar nav button span { font-size: 12px; font-variant-numeric: tabular-nums; }
.team-tasks-filters { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(180px, 260px); gap: 12px; }
.team-tasks-filters select, .team-task-search { min-height: 42px; border: 1px solid var(--task-line); border-radius: 8px; background: #fff; }
.team-tasks-filters select { padding: 8px 12px; color: #454c57; font: inherit; min-width: 0; }
.team-task-search { display: flex; align-items: center; padding: 0 12px; gap: 8px; }
.team-tasks-page .team-task-search { display: flex; }
.team-task-search svg { width: 18px; height: 18px; color: var(--task-muted); flex-shrink: 0; }
.team-task-search input { border: 0; background: transparent; outline-offset: 0; font: inherit; width: 100%; min-width: 0; padding: 10px 0; }
.team-task-group { margin-top: 28px; }
.team-task-group h2 { display: flex; align-items: baseline; gap: 12px; font-size: 18px; line-height: 26px; font-weight: 600; margin: 0 0 12px; }
.team-task-group h2 > span { font-size: 13px; color: var(--task-muted); font-weight: 400; }
.team-task-columns, .team-task-row { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(135px, 190px) 145px 130px; gap: 20px; align-items: center; }
.team-task-columns { padding: 0 16px 10px; font-size: 12px; color: var(--task-muted); }
.team-task-row { padding: 18px 16px; width: 100%; border: 0; border-top: 1px solid var(--task-line); background: #fff; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.team-task-row:last-child { border-bottom: 1px solid var(--task-line); }
.team-task-row:hover { background: #f8f9fb; }
.team-task-title { display: grid; gap: 4px; min-width: 0; }
.team-task-title strong { font-size: 15px; line-height: 22px; font-weight: 600; overflow-wrap: anywhere; }
.team-task-title > small { font-size: 13px; line-height: 20px; color: var(--task-muted); font-weight: 400; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.team-task-progress { color: var(--task-muted); font-size: 12px; }
.team-task-person { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.team-task-person > span { overflow-wrap: anywhere; }
.team-task-person i { width: 28px; height: 28px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: #e9ecf0; color: #59616f; font-size: 12px; font-style: normal; }
.team-task-due { display: grid; gap: 3px; font-size: 13px; font-variant-numeric: tabular-nums; }
.team-task-due small { font-size: 12px; }
.team-task-status { display: inline-flex; justify-self: start; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 6px; background: #edf0f3; color: #505a68; font-size: 12px; line-height: 20px; font-weight: 500; white-space: nowrap; }
.team-task-status.is-blocked { background: #fff2d9; color: #825512; }
.team-task-status.is-review { background: #e8edf6; color: #42567d; }
.team-task-status.is-done { background: #e8f2eb; color: #356442; }
.team-tasks-empty { padding: 56px 24px; text-align: center; background: #fff; margin-top: 20px; border-radius: 12px; border: 1px solid var(--task-line); }
.team-tasks-empty h2 { font-size: 20px; font-weight: 600; margin: 0 0 12px; }
.team-tasks-empty p { color: var(--task-muted); max-width: 52ch; margin: 0 auto 24px; font-weight: 400; font-size: 14px; }
.team-task-suggestions { margin-top: 32px; border-top: 1px solid var(--task-line); padding-top: 20px; }
.team-task-suggestions summary { cursor: pointer; font-weight: 500; }
.team-task-suggestions summary > span { margin-left: 12px; color: var(--task-muted); }
.team-task-suggestions p, .team-task-suggestions small { color: var(--task-muted); font-size: 13px; font-weight: 400; }
.team-task-suggestions article { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 0; border-top: 1px solid var(--task-line); }
.team-task-suggestions article > div { display: grid; gap: 4px; }
.team-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(216px,1fr); gap: 14px; overflow-x: auto; padding: 6px 0 20px; margin-top: 20px; min-height: 430px; align-items: start; scrollbar-width: thin; scroll-snap-type: x proximity; }
.team-board-column { background: rgba(227,232,238,.48); border: 1px solid rgba(255,255,255,.85); border-radius: 24px; padding: 14px 10px; min-height: 360px; scroll-snap-align: start; }
.team-board-column > header { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 0 4px 14px; }
.team-board-column h2 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 14px; font-weight: 600; line-height: 24px; }
.team-board-column h2 i { width: 7px; height: 7px; border-radius: 50%; background: #8b95a3; }
.team-board-column.is-in_progress h2 i { background: #758ba8; }
.team-board-column.is-blocked h2 i { background: #b58a52; }
.team-board-column.is-review h2 i { background: #9382a6; }
.team-board-column.is-done h2 i { background: #6a947e; }
.team-board-column h2 > span { display: grid; place-items: center; min-width: 24px; height: 24px; border-radius: 999px; background: rgba(255,255,255,.68); color: #626b7b; font-weight: 400; font-size: 12px; }
.team-board-column > header > button { background: rgba(255,255,255,.6); border: 0; width: 32px; height: 32px; border-radius: 50%; color: #515b69; font-size: 23px; }
.team-board-cards { display: grid; gap: 10px; }
.team-board-card { min-width: 0; border-radius: 19px; background: rgba(255,255,255,.88); border: 1px solid rgba(207,214,224,.72); box-shadow: 0 2px 4px rgba(32,42,58,.025); }
.team-card-open { display: grid; gap: 12px; text-align: left; border: 0; background: transparent; padding: 16px; width: 100%; border-radius: inherit; font: inherit; color: inherit; cursor: pointer; }
.team-card-open:hover { background: rgba(255,255,255,.68); }
.team-card-top { display: flex; justify-content: space-between; gap: 6px; color: #6c7684; font-size: 11px; }
.team-card-priority { color: #87642b; }
.team-card-open > strong { font-size: 15px; font-weight: 600; line-height: 22px; overflow-wrap: anywhere; }
.team-card-context { color: #626b7b; font-size: 13px; line-height: 20px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.team-card-context:empty { display: none; }
.team-card-bottom { display: grid; gap: 12px; padding-top: 10px; border-top: 1px solid #edf0f4; }
.team-card-bottom .team-task-due { display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.team-column-empty { color: #687383; margin: 16px 8px 32px; font-weight: 400; font-size: 13px; line-height: 21px; }
.team-column-add { width: 100%; border: 1px dashed #bac4d1; border-radius: 999px; background: rgba(255,255,255,.32); padding: 10px; min-height: 44px; color: #556170; font: 500 13px/20px Inter,system-ui,sans-serif; margin-top: 12px; }
.team-board-column.is-drop-target { outline: 2px solid #8d9dad; outline-offset: -2px; background: #e2e8ef; }
.team-board-card.is-dragging { opacity: .5; }
.team-board-jump { display: none; }
.team-tasks-page .team-tasks-toolbar { background: rgba(255,255,255,.6); border-radius: 24px; padding: 12px; gap: 12px; }
.team-tasks-page .team-tasks-toolbar nav button, .team-tasks-page .team-tasks-filters select, .team-tasks-page .team-task-search, .team-tasks-page .team-task-status, .team-tasks-page .btn, .team-tasks-page .team-close { border-radius: 999px; }
.team-tasks-page .team-tasks-filters select, .team-tasks-page .team-task-search { background: rgba(255,255,255,.7); }
.team-task-panel { border-radius: 28px 0 0 28px; }
.team-tasks-page .team-task-form :is(input:not([type="checkbox"]), select), .team-tasks-page .team-task-detail textarea, .team-tasks-page .team-task-form textarea { border-radius: 16px; }
.team-tasks-page .team-task-status { padding-inline: 12px; }
.team-tasks-page .team-tasks-summary { padding-bottom: 16px; }
.team-task-suggestions strong { font-size: 14px; font-weight: 500; }
.team-task-overlay { position: fixed; inset: 0; z-index: 180; }
.team-task-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(25, 32, 43, .28); }
.team-task-panel { position: absolute; inset: 0 0 0 auto; width: min(680px, 90vw); height: 100dvh; background: #fff; overflow-y: auto; overscroll-behavior: contain; padding: 28px; box-shadow: -12px 0 40px rgba(25, 32, 43, .12); }
body:has(.team-task-panel) { overflow: hidden; }
.team-task-panel > header { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 28px; position: sticky; top: -28px; z-index: 4; padding-block: 12px; background: rgba(255,255,255,.97); }
.team-task-panel > header > div { min-width: 0; }
.team-task-panel > header h2 { font-size: 22px; font-weight: 600; line-height: 30px; margin: 0; }
.team-task-panel > header p { font-size: 13px; color: var(--task-muted); font-weight: 400; margin: 6px 0 0; }
.team-close { width: 40px; height: 40px; display: grid; place-items: center; flex-shrink: 0; border: 1px solid var(--task-line); border-radius: 8px; background: #fff; color: #454c57; }
.team-close svg { width: 20px; height: 20px; }
.team-task-form { display: grid; gap: 22px; }
.team-tasks-page label { display: grid; gap: 8px; font-size: 13px; font-weight: 500; color: #454c57; text-align: left; }
.team-task-form :is(input:not([type="checkbox"]), select, textarea), .team-task-detail textarea { width: 100%; min-width: 0; min-height: 42px; border: 1px solid #d7dce4; border-radius: 8px; background: #fff; color: #262a30; padding: 10px 12px; font: 400 15px/22px Inter, system-ui, sans-serif; margin: 0; }
.team-tasks-page textarea { resize: vertical; }
.team-tasks-page :is(input, textarea)::placeholder { color: #737b89; opacity: 1; }
.team-task-form small { font-size: 12px; color: var(--task-muted); font-weight: 400; }
.team-task-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.team-task-form .team-check-option { display: flex; align-items: flex-start; gap: 12px; }
.team-check-option input, .team-task-checklist input { width: 20px; height: 20px; flex-shrink: 0; margin: 2px 0 0; accent-color: #454c57; }
.team-check-option small { display: block; margin-top: 4px; }
.team-task-form footer { position: sticky; bottom: -28px; background: #fff; padding: 16px 0 max(16px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--task-line); display: flex; justify-content: flex-end; gap: 12px; }
.team-task-detail-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.team-task-detail-title > button { margin-left: auto; }
.team-task-detail-title h3 { width: 100%; font-size: 24px; line-height: 1.35; font-weight: 600; margin: 8px 0 24px; overflow-wrap: anywhere; }
.team-task-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 0 0 28px; padding-bottom: 24px; border-bottom: 1px solid var(--task-line); }
.team-task-facts dt { font-size: 12px; color: var(--task-muted); margin-bottom: 4px; }
.team-task-facts dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.team-task-detail section { margin: 28px 0; }
.team-task-detail h4 { font-size: 14px; font-weight: 600; margin: 0 0 10px; }
.team-task-detail h4 span { font-weight: 400; margin-left: 8px; color: var(--task-muted); }
.team-task-detail p { font-size: 14px; line-height: 1.6; font-weight: 400; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.team-task-checklist { display: grid; }
.team-task-checklist label { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; min-height: 44px; font-weight: 400; }
.team-task-checklist label:has(input:checked) span { color: var(--task-muted); text-decoration: line-through; }
.team-task-blocker, .team-task-result { padding: 16px; border-radius: 8px; background: #f5f6f8; }
.team-task-blocker { background: #fffaef; }
.team-task-actions { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--task-line); padding-top: 24px; }
.team-task-action-form { margin-top: 20px; display: grid; gap: 12px; }
.team-task-action-form > div { display: flex; gap: 8px; justify-content: flex-end; }
.team-task-history { border-top: 1px solid var(--task-line); padding-top: 24px; }
.team-task-history article { margin-top: 20px; }
.team-task-history article > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.team-task-history strong { font-size: 13px; font-weight: 500; }
.team-task-history time { font-size: 12px; color: var(--task-muted); }
.team-task-history form { margin-top: 24px; display: grid; gap: 12px; justify-items: stretch; }
.team-task-history form button { justify-self: end; }
.team-task-error { margin: 0 0 20px; padding: 12px; background: #fcf0ef; color: #983f3e; font-size: 14px; }
.team-task-error button { font: inherit; text-decoration: underline; background: none; border: 0; padding: 0; color: inherit; }
.teacher-work-tabs { display: flex; gap: 8px; padding: 20px 24px 0; }
.teacher-work-tabs button { min-height: 44px; padding: 8px 14px; border: 1px solid #e2e6ed; border-radius: 8px; color: #454c57; background: #fff; font-size: 14px; }
.teacher-work-tabs button[aria-pressed="true"] { background: #e9ecf0; }
@media (max-width: 1200px) {
  .team-task-columns, .team-task-row { grid-template-columns: minmax(180px, 1fr) 130px 125px 115px; gap: 12px; }
}
@media (max-width: 760px) {
  .team-board { grid-auto-columns: calc(100% - 24px); gap: 12px; margin-top: 12px; min-height: 390px; scroll-snap-type: x mandatory; }
  .team-board-jump { display: flex; gap: 6px; overflow-x: auto; margin-top: 16px; scrollbar-width: none; }
  .team-board-jump button { display: flex; flex-shrink: 0; gap: 6px; align-items: center; border: 1px solid #dce2e9; background: rgba(255,255,255,.7); border-radius: 999px; min-height: 44px; padding: 8px 12px; color: #515c6b; font-size: 13px; }
  .team-board-jump span { color: #7b8491; }
  .team-board-column > header > button { width: 44px; height: 44px; }
  .team-task-panel { border-radius: 0; }
  .team-tasks-page { padding: 16px 0 max(24px, env(safe-area-inset-bottom, 0px)); }
  .team-tasks-heading { flex-direction: column; gap: 16px; margin-bottom: 20px; }
  .team-tasks-heading h1 { font-size: 26px; }
  .team-tasks-heading > div:last-child { width: 100%; }
  .team-tasks-heading > div:last-child .btn-primary { flex: 1; }
  #adminApp .team-tasks-heading > div:last-child .btn { flex: 1 1 0; width: auto; white-space: nowrap; }
  .team-tasks-page .btn { min-height: 44px; }
  .team-tasks-summary { gap: 8px 16px; }
  .team-tasks-toolbar { padding: 12px; gap: 12px; }
  .team-tasks-toolbar nav button { min-height: 44px; padding-inline: 12px; }
  .team-tasks-filters { grid-template-columns: minmax(0, 1fr); }
  .team-task-search input, .team-tasks-filters select { font-size: 16px; min-height: 44px; }
  .team-task-columns { display: none; }
  .team-task-row { grid-template-columns: minmax(0, 1fr) auto; padding: 16px 12px; gap: 12px; }
  .team-task-title { grid-column: 1 / -1; }
  .team-task-title strong { font-size: 16px; }
  .team-task-person { grid-column: 1; }
  .team-task-status { grid-column: 2; grid-row: 2; }
  .team-task-due { grid-column: 1 / -1; display: flex; gap: 12px; flex-wrap: wrap; }
  .team-tasks-empty { padding: 32px 20px; }
  .team-task-panel { width: 100%; padding: max(20px, env(safe-area-inset-top, 0px)) 16px max(20px, env(safe-area-inset-bottom, 0px)); }
  .team-task-panel > header { gap: 12px; margin-bottom: 24px; top: -20px; }
  .team-task-panel > header h2 { font-size: 22px; }
  .team-close { width: 44px; height: 44px; }
  .team-task-fields { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .team-task-form :is(input:not([type="checkbox"]), select, textarea), .team-task-detail textarea { font-size: 16px; min-height: 44px; }
  .team-task-form footer { bottom: -20px; }
  .team-task-form footer button { flex: 1; }
  .team-task-detail-title h3 { font-size: 22px; }
  .team-task-detail p { font-size: 15px; }
  .team-task-suggestions article { align-items: stretch; flex-direction: column; gap: 12px; }
  .teacher-work-tabs { padding: 16px 16px 0; }
  body:has(#localPreviewNotice:not([hidden])) .teacher-work-tabs { padding-top: 72px; }
  .teacher-work-tabs + .team-tasks-page { padding-inline: 16px; }
  body:has(.teacher-work-tabs) .teacher-schedule { padding-top: 20px !important; }
}
