/* HIG Operation Layer v1 · Task Detail + Update Thread */

.hig-task-workspace {
  min-height: 100%;
}

.hig-task-head {
  padding: 30px 36px 22px;
}

.hig-task-kicker {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.hig-task-head h2 {
  max-width: 760px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.14;
  letter-spacing: -.025em;
}

.hig-task-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.hig-task-context {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 20px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hig-task-context-item {
  appearance: none;
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 0 17px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
}

.hig-task-context-item:first-child {
  padding-left: 0;
  border-left: 0;
}

.hig-task-context-item small {
  color: var(--muted);
  font-size: 9px;
}

.hig-task-context-item b {
  max-width: 250px;
  overflow: hidden;
  color: var(--ink);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hig-task-context-item.is-link {
  cursor: pointer;
}

.hig-task-context-item.is-link:hover b {
  color: var(--blue);
}

.hig-task-description {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.hig-task-identifiers {
  width: fit-content;
  margin-top: 14px;
}

.hig-task-identifiers > summary {
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.hig-task-identifiers > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.hig-task-identifiers button {
  appearance: none;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.hig-task-identifiers button span {
  font-size: 8.5px;
}

.hig-task-identifiers button b {
  color: var(--ink);
  font-size: 9.5px;
}

.hig-task-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}

.hig-task-actions-main,
.hig-task-actions-context {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hig-task-linked-action {
  appearance: none;
  min-height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: 10.5px;
  font-weight: 650;
  cursor: pointer;
}

.hig-task-linked-action:hover {
  background: var(--soft);
}

.hig-task-more {
  position: relative;
}

.hig-task-more > summary {
  width: 36px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.hig-task-more > summary::-webkit-details-marker {
  display: none;
}

.hig-task-more[open] > summary,
.hig-task-more > summary:hover {
  background: var(--soft);
  color: var(--ink);
}

.hig-task-more > div {
  position: absolute;
  top: 40px;
  right: 0;
  z-index: 20;
  min-width: 165px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 16px 44px rgba(15, 23, 42, .16);
}

.hig-task-more button {
  width: 100%;
}

.hig-task-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 3px;
  padding: 0 30px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(
    in srgb,
    var(--panel) 94%,
    transparent
  );
  backdrop-filter: blur(14px);
}

.hig-task-tabs button {
  appearance: none;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 10.5px;
  cursor: pointer;
}

.hig-task-tabs button.active {
  border-bottom-color: var(--blue);
  color: var(--blue);
  font-weight: 700;
}

.hig-task-tabs span {
  min-width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 8.5px;
}

.hig-task-tab-content {
  padding: 22px 36px 34px;
}

.hig-update-thread {
  display: grid;
}

.hig-update-thread-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.hig-update-thread-item:first-child {
  padding-top: 2px;
}

.hig-update-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--soft);
  color: var(--blue);
  font-size: 10.5px;
  font-weight: 800;
}

.hig-update-content {
  min-width: 0;
}

.hig-update-content header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hig-update-content header > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.hig-update-content header b {
  overflow: hidden;
  color: var(--ink);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hig-update-content time {
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
}

.hig-update-content p {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.58;
}

.hig-update-delete {
  appearance: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.hig-update-delete:hover {
  background: var(--soft);
  color: #d04a55;
}

.hig-update-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.hig-update-files button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font: inherit;
  font-size: 9.5px;
  cursor: pointer;
}

.hig-work-composer {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  overflow: hidden;
}

.hig-work-composer textarea {
  width: 100%;
  min-height: 72px;
  padding: 13px 14px;
  border: 0;
  outline: 0;
  resize: vertical;
  box-sizing: border-box;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
}

.hig-work-composer textarea::placeholder {
  color: var(--muted);
}

.hig-work-composer-foot {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px 6px 10px;
  border-top: 1px solid var(--line);
}

.hig-file-pick {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10.5px;
  cursor: pointer;
}

.hig-file-pick input {
  display: none;
}

.hig-send-button {
  appearance: none;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: 10.5px;
  font-weight: 720;
  cursor: pointer;
}

.hig-send-button:hover {
  background: var(--soft);
}

.hig-task-files {
  display: grid;
  gap: 7px;
}

.hig-task-file {
  appearance: none;
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.hig-task-file:hover {
  background: var(--soft);
}

.hig-file-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
}

.hig-task-file b,
.hig-task-file small {
  display: block;
}

.hig-task-file b {
  font-size: 11px;
}

.hig-task-file small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9.5px;
}

.hig-task-file i {
  color: var(--muted);
  font-style: normal;
}

.hig-event-thread {
  display: grid;
}

.hig-event-row {
  position: relative;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 9px;
  padding: 0 0 16px;
}

.hig-event-row::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 12px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.hig-event-row:last-child::after {
  display: none;
}

.hig-event-dot {
  position: relative;
  z-index: 1;
  width: 9px;
  height: 9px;
  margin-top: 3px;
  border: 2px solid var(--panel);
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 1px var(--line);
}

.hig-event-row b,
.hig-event-row small {
  display: block;
}

.hig-event-row b {
  color: var(--ink);
  font-size: 11.5px;
}

.hig-event-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
}

.hig-task-empty {
  padding: 30px 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

html[data-theme="dark"] .hig-task-more > div {
  box-shadow: 0 20px 50px rgba(0, 0, 0, .42);
}

@media (max-width: 760px) {
  .hig-task-head {
    padding: 24px 20px 18px;
  }

  .hig-task-context {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 0;
  }

  .hig-task-context-item {
    padding: 0 12px;
  }

  .hig-task-context-item:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  .hig-task-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hig-task-tabs {
    padding: 0 12px;
    overflow-x: auto;
  }

  .hig-task-tab-content {
    padding: 18px 20px 28px;
  }
}


/* Daily Flow Task UI v2 refinement
   Less chrome, clearer hierarchy, more breathing room. */

.hig-task-head {
  padding: 34px 38px 24px;
}

.hig-task-kicker {
  margin-bottom: 10px;
  font-size: 9px;
  letter-spacing: .08em;
}

.hig-task-head h2 {
  max-width: 800px;
  font-size: clamp(23px, 2.7vw, 32px);
  line-height: 1.16;
}

.hig-task-chips {
  gap: 6px;
  margin-top: 13px;
}

.hig-task-chips .pill,
.hig-task-chips .work-chip {
  min-height: 25px;
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: 9.5px;
}

.hig-task-context {
  margin-top: 24px;
  padding: 13px 0;
  border-top-color: color-mix(
    in srgb,
    var(--line) 72%,
    transparent
  );
  border-bottom-color: color-mix(
    in srgb,
    var(--line) 72%,
    transparent
  );
}

.hig-task-context-item {
  padding: 0 20px;
}

.hig-task-context-item small {
  font-size: 8.5px;
}

.hig-task-context-item b {
  font-size: 11px;
}

.hig-task-identifiers {
  margin-top: 12px;
}

.hig-task-identifiers > summary {
  font-size: 9.5px;
}

.hig-task-actions {
  margin-top: 18px;
  gap: 10px;
}

.hig-task-actions-main,
.hig-task-actions-context {
  gap: 6px;
}

/* Override legacy large button geometry inside the focused task workspace. */
.hig-task-actions .primary,
.hig-task-actions .secondary,
.hig-task-actions .quiet-action {
  min-height: 34px;
  height: 34px;
  padding: 0 13px;
  border-radius: 9px;
  font-size: 10.5px;
  line-height: 1;
}

.hig-task-actions .primary {
  box-shadow: none;
}

.hig-task-linked-action {
  min-height: 32px;
  padding: 0 7px;
  font-size: 10px;
}

.hig-task-more > summary {
  width: 32px;
  height: 32px;
}

.hig-task-more > div {
  top: 37px;
}

.hig-task-tabs {
  padding: 0 34px;
}

.hig-task-tabs button {
  min-height: 44px;
  padding: 0 10px;
  font-size: 10px;
}

.hig-task-tabs span {
  min-width: 16px;
  height: 16px;
  font-size: 8px;
}

.hig-task-tab-content {
  padding: 26px 38px 38px;
}

/* Keep reading surfaces narrower than the workspace shell. */
.hig-task-tab-content > .hig-update-thread,
.hig-task-tab-content > .hig-work-composer,
.hig-task-tab-content > .hig-task-files,
.hig-task-tab-content > .hig-event-thread,
.hig-task-tab-content > .hig-task-empty {
  width: min(100%, 760px);
  margin-left: auto;
  margin-right: auto;
}

.hig-update-thread-item {
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 13px;
  padding: 18px 0;
}

.hig-update-avatar {
  width: 32px;
  height: 32px;
  font-size: 10px;
}

.hig-update-content header b {
  font-size: 11px;
}

.hig-update-content time {
  font-size: 9px;
}

.hig-update-content p {
  margin-top: 7px;
  font-size: 12.5px;
  line-height: 1.62;
}

.hig-work-composer {
  margin-top: 24px;
  border-radius: 12px;
}

.hig-work-composer textarea {
  min-height: 66px;
  padding: 12px 13px;
  font-size: 11.5px;
}

.hig-work-composer-foot {
  min-height: 40px;
  padding: 5px 7px 5px 10px;
}

.hig-file-pick,
.hig-send-button {
  font-size: 10px;
}

.hig-send-button {
  min-height: 30px;
}

@media (max-width: 760px) {
  .hig-task-head {
    padding: 25px 20px 19px;
  }

  .hig-task-context-item {
    padding: 0 12px;
  }

  .hig-task-actions .primary,
  .hig-task-actions .secondary,
  .hig-task-actions .quiet-action {
    width: auto;
  }

  .hig-task-tabs {
    padding: 0 12px;
  }

  .hig-task-tab-content {
    padding: 20px 20px 30px;
  }
}


/* Task Detail v3 hierarchy
   Lighter header, contextual top actions, tabbed identifiers, bottom decision CTA. */

.hig-task-workspace {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.hig-task-head {
  padding: 26px 34px 18px;
}

.hig-task-topline {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.hig-task-meta-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.hig-task-kicker {
  flex: 0 0 auto;
  margin: 0;
  font-size: 9px;
  line-height: 1;
  letter-spacing: .09em;
}

.hig-task-chips {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  flex-wrap: nowrap;
}

.hig-task-chips .pill,
.hig-task-chips .work-chip {
  min-height: 23px;
  padding-top: 3px;
  padding-bottom: 3px;
  font-size: 9px;
  white-space: nowrap;
}

.hig-task-head-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.hig-task-edit-action {
  appearance: none;
  min-height: 31px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 10.5px;
  font-weight: 650;
  cursor: pointer;
}

.hig-task-edit-action:hover,
.hig-task-edit-action:focus-visible {
  background: var(--soft);
  color: var(--ink);
  outline: 0;
}

.hig-task-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
}

.hig-task-head h2,
.hig-task-title-row h2 {
  min-width: 0;
  max-width: 820px;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(22px, 2.1vw, 28px);
  font-weight: 680;
  line-height: 1.18;
  letter-spacing: -.018em;
  text-overflow: ellipsis;
}

.hig-task-title-link {
  appearance: none;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}

.hig-task-title-link:hover,
.hig-task-title-link:focus-visible {
  background: var(--soft);
  outline: 0;
}

.hig-task-context {
  margin-top: 22px;
  padding: 12px 0;
}

.hig-task-description {
  max-width: 800px;
  margin-top: 15px;
  font-size: 11.5px;
  line-height: 1.55;
}

/* Identifiers no longer consume the header. They live in their own tab. */
.hig-task-identifiers {
  display: none;
}

.hig-task-identifiers-tab {
  width: min(100%, 800px);
  margin: 0 auto;
  display: grid;
  border-top: 1px solid var(--line);
}

.hig-task-identifier-row {
  appearance: none;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.hig-task-identifier-row:hover {
  background: var(--soft);
}

.hig-task-identifier-row > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.hig-task-identifier-row small {
  color: var(--muted);
  font-size: 9.5px;
}

.hig-task-identifier-row b {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hig-task-identifier-row i {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

/* Tabs become a stronger navigation layer. */
.hig-task-tabs {
  padding: 0 32px;
}

.hig-task-tabs button {
  min-height: 46px;
  padding: 0 11px;
  font-size: 11.5px;
}

.hig-task-tabs button.active {
  font-weight: 730;
}

.hig-task-tabs span {
  min-width: 18px;
  height: 18px;
  font-size: 9px;
}

.hig-task-tab-content {
  flex: 1 1 auto;
  padding: 26px 34px 30px;
}

.hig-task-tab-content > .hig-update-thread,
.hig-task-tab-content > .hig-work-composer,
.hig-task-tab-content > .hig-task-files,
.hig-task-tab-content > .hig-event-thread,
.hig-task-tab-content > .hig-task-empty {
  width: min(100%, 800px);
}

/* Updates gain a little typographic authority for reading comfort. */
.hig-update-thread-item {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  padding: 19px 0;
}

.hig-update-avatar {
  width: 34px;
  height: 34px;
  font-size: 10.5px;
}

.hig-update-content header b {
  font-size: 12.5px;
}

.hig-update-content time {
  font-size: 10px;
}

.hig-update-content p {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.62;
}

.hig-work-composer {
  margin-top: 26px;
}

.hig-work-composer textarea {
  min-height: 74px;
  font-size: 12.5px;
}

/* Final decisions belong to a dedicated bottom action bar. */
.hig-task-footer {
  position: sticky;
  bottom: 0;
  z-index: 8;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 34px;
  border-top: 1px solid var(--line);
  background: color-mix(
    in srgb,
    var(--panel) 94%,
    transparent
  );
  backdrop-filter: blur(16px);
}

.hig-task-footer-secondary,
.hig-task-footer-primary {
  display: flex;
  align-items: center;
  gap: 7px;
}

.hig-task-footer-primary {
  margin-left: auto;
}

.hig-task-wait-action,
.hig-task-archive-action {
  appearance: none;
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 10.5px;
  font-weight: 620;
  cursor: pointer;
}

.hig-task-wait-action:hover {
  background: var(--soft);
  color: var(--ink);
}

.hig-task-archive-action {
  color: #b4535d;
}

.hig-task-archive-action:hover {
  background: color-mix(
    in srgb,
    #d04a55 9%,
    transparent
  );
  color: #d04a55;
}

.hig-task-complete-action {
  min-height: 38px;
  height: 38px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 730;
}

/* Legacy mid-header action geometry is retired in v3. */
.hig-task-actions,
.hig-task-actions-main,
.hig-task-actions-context,
.hig-task-more,
.hig-task-linked-action {
  display: none !important;
}

html[data-theme="dark"] .hig-task-footer {
  background: color-mix(
    in srgb,
    var(--panel) 94%,
    transparent
  );
}

@media (max-width: 760px) {
  .hig-task-head {
    padding: 22px 20px 16px;
  }

  .hig-task-topline {
    align-items: flex-start;
  }

  .hig-task-meta-line {
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .hig-task-meta-line::-webkit-scrollbar {
    display: none;
  }

  .hig-task-title-row {
    margin-top: 10px;
  }

  .hig-task-head h2,
  .hig-task-title-row h2 {
    font-size: 22px;
  }

  .hig-task-tabs {
    padding: 0 12px;
  }

  .hig-task-tab-content {
    padding: 20px 20px 24px;
  }

  .hig-task-footer {
    padding: 9px 16px;
  }

  .hig-task-archive-action {
    padding-left: 7px;
    padding-right: 7px;
  }
}


/* Task Detail v3 centered workspace grid
   One centered geometry for header, tabs, reading area and footer. */

.work-drawer-panel {
  width: min(1180px, calc(100vw - 64px));
  height: min(90vh, 940px);
  max-height: 90vh;
}

.hig-task-workspace {
  --task-v3-content: 1000px;
}

.hig-task-head {
  padding: 30px 34px 20px;
}

.hig-task-topline,
.hig-task-title-row,
.hig-task-context,
.hig-task-description {
  width: min(100%, var(--task-v3-content));
  margin-left: auto;
  margin-right: auto;
}

.hig-task-title-row {
  margin-top: 14px;
}

.hig-task-context {
  margin-top: 24px;
}

.hig-task-description {
  max-width: var(--task-v3-content);
}

/* Segmented, equal-width tabs with stronger hierarchy. */
.hig-task-tabs {
  position: sticky;
  top: 0;
  z-index: 6;
  width: min(calc(100% - 68px), var(--task-v3-content));
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: none;
}

.hig-task-tabs button {
  min-height: 58px;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border-right: 1px solid var(--line);
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -.005em;
}

.hig-task-tabs button:last-child {
  border-right: 0;
}

.hig-task-tabs button:hover {
  background: var(--soft);
  color: var(--ink);
}

.hig-task-tabs button.active {
  border-bottom-color: var(--blue);
  background: color-mix(
    in srgb,
    var(--blue) 6%,
    var(--panel)
  );
  color: var(--ink);
  font-weight: 760;
}

.hig-task-tabs span {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font-size: 9.5px;
}

/* The content itself shares the same centered column. */
.hig-task-tab-content {
  width: min(calc(100% - 68px), var(--task-v3-content));
  margin: 0 auto;
  padding: 30px 0 34px;
  box-sizing: border-box;
}

.hig-task-tab-content > .hig-update-thread,
.hig-task-tab-content > .hig-work-composer,
.hig-task-tab-content > .hig-task-files,
.hig-task-tab-content > .hig-event-thread,
.hig-task-tab-content > .hig-task-empty,
.hig-task-identifiers-tab {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.hig-update-thread-item {
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 16px;
  padding: 22px 0;
}

.hig-update-avatar {
  width: 38px;
  height: 38px;
  font-size: 11px;
}

.hig-update-content header b {
  font-size: 13px;
}

.hig-update-content time {
  font-size: 10.5px;
}

.hig-update-content p {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.66;
}

.hig-work-composer {
  margin-top: 30px;
}

.hig-work-composer textarea {
  min-height: 88px;
  padding: 14px 15px;
  font-size: 13px;
  line-height: 1.55;
}

.hig-work-composer-foot {
  min-height: 46px;
  padding: 6px 9px 6px 12px;
}

.hig-file-pick,
.hig-send-button {
  font-size: 11px;
}

/* Footer actions align to the same centered workspace geometry. */
.hig-task-footer {
  padding: 0 34px;
}

.hig-task-footer-inner {
  width: min(100%, var(--task-v3-content));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

@media (max-width: 900px) {
  .work-drawer-panel {
    width: min(100%, calc(100vw - 28px));
  }

  .hig-task-workspace {
    --task-v3-content: 100%;
  }

  .hig-task-tabs,
  .hig-task-tab-content {
    width: calc(100% - 40px);
  }
}

@media (max-width: 760px) {
  .work-drawer-panel {
    width: 100%;
    height: 100%;
    max-height: none;
  }

  .hig-task-head {
    padding: 22px 20px 16px;
  }

  .hig-task-tabs {
    width: 100%;
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    overflow-x: auto;
  }

  .hig-task-tabs button {
    min-height: 52px;
    font-size: 12px;
  }

  .hig-task-tab-content {
    width: calc(100% - 40px);
    padding-top: 22px;
  }

  .hig-task-footer {
    padding: 0 16px;
  }

  .hig-task-footer-inner {
    min-height: 62px;
  }
}


/* Task Detail v4 balanced workspace grid
   Wider centered content, fixed context columns, thinner navigation. */

.hig-task-workspace {
  --task-v3-content: 1080px;
}

/* Use the shell efficiently while preserving equal left/right breathing room. */
.hig-task-head {
  padding: 30px 28px 20px;
}

.hig-task-topline,
.hig-task-title-row,
.hig-task-context,
.hig-task-description {
  width: min(100%, var(--task-v3-content));
  margin-left: auto;
  margin-right: auto;
}

/* Context is a real four-column information rail, never a wrapping flex line. */
.hig-task-context {
  display: grid;
  grid-template-columns:
    minmax(170px, 1.05fr)
    minmax(320px, 2.35fr)
    minmax(105px, .72fr)
    minmax(180px, 1.18fr);
  align-items: center;
  gap: 0;
  margin-top: 24px;
  padding: 14px 0;
}

.hig-task-context-item {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 1px 18px;
}

.hig-task-context-item:first-child {
  padding-left: 0;
}

.hig-task-context-item small {
  white-space: nowrap;
}

.hig-task-context-item b {
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Thin segmented navigation: clear, but not visually dominant. */
.hig-task-tabs {
  width: min(calc(100% - 48px), var(--task-v3-content));
  min-height: 44px;
}

.hig-task-tabs button {
  min-height: 44px;
  padding: 0 12px;
  font-size: 12.25px;
  font-weight: 640;
}

.hig-task-tabs button.active {
  background: color-mix(
    in srgb,
    var(--blue) 3.5%,
    var(--panel)
  );
  font-weight: 740;
}

.hig-task-tabs span {
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 9px;
}

/* Reading surfaces consume the available centered width instead of clustering left. */
.hig-task-tab-content {
  width: min(calc(100% - 48px), var(--task-v3-content));
  padding: 32px 0 38px;
}

.hig-task-tab-content > .hig-update-thread,
.hig-task-tab-content > .hig-work-composer,
.hig-task-tab-content > .hig-task-files,
.hig-task-tab-content > .hig-event-thread,
.hig-task-tab-content > .hig-task-empty,
.hig-task-identifiers-tab {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.hig-update-thread-item {
  padding: 23px 0;
}

.hig-work-composer {
  margin-top: 32px;
}

/* Footer decisions sit on the very same centered axis. */
.hig-task-footer {
  padding: 0 24px;
}

.hig-task-footer-inner {
  width: min(100%, var(--task-v3-content));
}

@media (max-width: 1100px) {
  .hig-task-workspace {
    --task-v3-content: 100%;
  }

  .hig-task-context {
    grid-template-columns:
      minmax(150px, 1fr)
      minmax(260px, 2fr)
      minmax(95px, .75fr)
      minmax(150px, 1.1fr);
  }
}

@media (max-width: 820px) {
  .hig-task-context {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 14px;
  }

  .hig-task-context-item:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }
}

@media (max-width: 760px) {
  .hig-task-tabs {
    min-height: 42px;
  }

  .hig-task-tabs button {
    min-height: 42px;
    font-size: 11.5px;
  }

  .hig-task-tab-content {
    width: calc(100% - 36px);
    padding: 24px 0 30px;
  }
}


/* Task Detail v5 final spacing geometry
   Use the shell efficiently, keep context on one line, reduce tab chrome. */

.hig-task-workspace {
  --task-v3-content: 1120px;
}

.hig-task-head {
  padding: 26px 24px 18px;
}

.hig-task-topline,
.hig-task-title-row,
.hig-task-context,
.hig-task-description {
  width: min(calc(100% - 40px), var(--task-v3-content));
  margin-left: auto;
  margin-right: auto;
}

.hig-task-title-row {
  margin-top: 12px;
}

.hig-task-context {
  display: grid;
  grid-template-columns:
    minmax(140px, .95fr)
    minmax(280px, 2.25fr)
    minmax(90px, .62fr)
    minmax(150px, 1.05fr);
  align-items: center;
  gap: 0;
  margin-top: 22px;
  padding: 12px 0;
}

.hig-task-context-item {
  min-width: 0;
  width: 100%;
  padding: 0 16px;
  box-sizing: border-box;
}

.hig-task-context-item:first-child {
  padding-left: 0;
}

.hig-task-context-item small,
.hig-task-context-item b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tabs stay clear but stop dominating the workspace. */
.hig-task-tabs {
  width: min(calc(100% - 40px), var(--task-v3-content));
  min-height: 40px;
}

.hig-task-tabs button {
  min-height: 40px;
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 640;
}

.hig-task-tabs button.active {
  background: color-mix(
    in srgb,
    var(--blue) 2%,
    var(--panel)
  );
  font-weight: 730;
}

.hig-task-tabs span {
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  font-size: 8.5px;
}

/* Content and footer use the same wider center axis. */
.hig-task-tab-content {
  width: min(calc(100% - 40px), var(--task-v3-content));
  padding: 26px 0 32px;
}

.hig-task-footer {
  padding: 0 20px;
}

.hig-task-footer-inner {
  width: min(100%, var(--task-v3-content));
}

/* Preserve the four-column context rail across desktop and medium widths. */
@media (max-width: 1100px) {
  .hig-task-workspace {
    --task-v3-content: 100%;
  }

  .hig-task-context {
    grid-template-columns:
      minmax(130px, .9fr)
      minmax(250px, 2.2fr)
      minmax(82px, .65fr)
      minmax(140px, 1.05fr);
  }

  .hig-task-tabs,
  .hig-task-tab-content {
    width: calc(100% - 32px);
  }
}

/* Only real compact/mobile layouts may stack context. */
@media (max-width: 640px) {
  .hig-task-context {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 12px;
  }

  .hig-task-context-item:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .hig-task-tabs {
    width: 100%;
    min-height: 38px;
  }

  .hig-task-tabs button {
    min-height: 38px;
    font-size: 11px;
  }

  .hig-task-tab-content {
    width: calc(100% - 32px);
    padding-top: 22px;
  }
}


/* Task Detail v6 final geometry
   Optically centered workspace, separated context/navigation layers and a clear service action. */

.work-drawer-panel {
  overflow-x: hidden;
}

.work-drawer-close {
  position: absolute !important;
  top: 20px;
  right: 20px;
  float: none;
  margin: 0;
  z-index: 20;
}

.hig-task-workspace {
  --task-v3-content: 1132px;
}

.hig-task-head {
  padding: 26px 24px 12px;
}

.hig-task-topline,
.hig-task-title-row,
.hig-task-context,
.hig-task-description {
  width: min(calc(100% - 48px), var(--task-v3-content));
  margin-left: auto;
  margin-right: auto;
}

.hig-task-head-actions {
  margin-right: 58px;
}

.hig-task-context {
  grid-template-columns:
    minmax(150px, 1fr)
    minmax(300px, 2.2fr)
    minmax(96px, .68fr)
    minmax(160px, 1.08fr);
  margin-top: 20px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(
    in srgb,
    var(--soft) 52%,
    transparent
  );
}

.hig-task-context-item {
  padding: 0 16px;
}

.hig-task-context-item:first-child {
  padding-left: 4px;
}

.hig-task-context-item:last-child {
  padding-right: 4px;
}

/* Native-feeling segmented navigation is a distinct layer from the context rail. */
.hig-task-tabs {
  width: min(calc(100% - 48px), var(--task-v3-content));
  min-height: 34px;
  margin: 10px auto 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: color-mix(
    in srgb,
    var(--soft) 72%,
    var(--panel)
  );
}

.hig-task-tabs button {
  min-height: 34px;
  padding: 0 10px;
  border-bottom: 0;
  font-size: 11.25px;
  font-weight: 620;
}

.hig-task-tabs button.active {
  border-bottom: 0;
  background: var(--panel);
  box-shadow:
    0 1px 3px rgba(15, 23, 42, .08);
  font-weight: 720;
}

.hig-task-tabs span {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 8px;
}

.hig-task-tab-content {
  width: min(calc(100% - 48px), var(--task-v3-content));
  padding: 24px 0 30px;
}

.hig-task-footer {
  padding: 0 24px;
}

.hig-task-footer-inner {
  width: min(100%, var(--task-v3-content));
}

.hig-task-service-action {
  appearance: none;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 10.5px;
  font-weight: 650;
  cursor: pointer;
}

.hig-task-service-action:hover {
  background: var(--soft);
  border-color: color-mix(
    in srgb,
    var(--blue) 24%,
    var(--line)
  );
  color: var(--blue);
}

html[data-theme="dark"] .hig-task-context {
  background: color-mix(
    in srgb,
    var(--soft) 64%,
    transparent
  );
}

html[data-theme="dark"] .hig-task-tabs button.active {
  box-shadow:
    0 1px 3px rgba(0, 0, 0, .24);
}

@media (max-width: 1100px) {
  .hig-task-context {
    grid-template-columns:
      minmax(135px, .92fr)
      minmax(260px, 2.08fr)
      minmax(88px, .66fr)
      minmax(145px, 1.02fr);
  }

  .hig-task-tabs,
  .hig-task-tab-content {
    width: calc(100% - 40px);
  }
}

@media (max-width: 640px) {
  .work-drawer-close {
    top: 14px;
    right: 14px;
  }

  .hig-task-head-actions {
    margin-right: 52px;
  }

  .hig-task-context {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 11px 10px;
  }

  .hig-task-tabs {
    width: calc(100% - 24px);
    min-height: 34px;
    grid-template-columns: repeat(4, minmax(104px, 1fr));
  }

  .hig-task-tabs button {
    min-height: 34px;
  }

  .hig-task-tab-content {
    width: calc(100% - 32px);
  }

  .hig-task-service-action span:first-child {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}


/* Task Detail v6.1 context-card box model fix
   Keep the single native context rail inside its centered axis. */
.hig-task-context {
  box-sizing: border-box;
  grid-template-columns:
    minmax(0, 1.02fr)
    minmax(0, 2.28fr)
    minmax(88px, .68fr)
    minmax(150px, 1.22fr);
}

.hig-task-context-item {
  min-width: 0;
  overflow: hidden;
}

.hig-task-context-item b {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .hig-task-context {
    grid-template-columns:
      minmax(0, .98fr)
      minmax(0, 2.12fr)
      minmax(84px, .66fr)
      minmax(142px, 1.18fr);
  }
}
