.task-panel-page-stack {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.task-panel-page {
  flex: 1;
  min-height: 0;
  padding: 18px;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--ui-color-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.07);
}

.task-panel-body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  height: 100%;
  padding: 0;
}

.task-panel-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 0 2px 2px;
}

.task-panel-title-group {
  display: grid;
  min-width: 0;
}

.task-panel-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.task-panel-greeting {
  margin: 0;
  color: #334155;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: 0;
  white-space: nowrap;
}

.task-panel-greeting::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 1.08em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.72), rgba(59, 130, 246, 0.18));
  animation: task-panel-greeting-caret 0.9s steps(1, end) infinite;
}

.task-panel-date-field {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
}

.task-panel-date-field input {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.task-panel-header .task-panel-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #1f2f49;
  cursor: pointer;
  font: inherit;
  transition: color 180ms ease;
}

.task-panel-header .task-panel-date-pill:hover,
.task-panel-header .task-panel-date-pill:focus-visible {
  background: transparent;
  box-shadow: none;
  color: #1d4ed8;
}

.task-panel-header .task-panel-date-pill:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.task-panel-date-calendar {
  display: grid;
  grid-template-rows: 10px 1fr;
  width: 30px;
  height: 30px;
  overflow: hidden;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #eef4ff 100%);
  border: 1px solid #d7e1ef;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94), 0 5px 10px rgba(15, 23, 42, 0.08);
}

.task-panel-date-calendar-month {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background: #ff5f57;
  color: #ffffff;
  font-size: 7px;
  font-weight: 800;
  line-height: 1;
}

.task-panel-date-calendar-day {
  color: #1f2f49;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.task-panel-date-value {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 0 13px;
  border: 1px solid rgba(203, 213, 225, 0.92);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.task-panel-header .task-panel-date-pill:hover .task-panel-date-value,
.task-panel-header .task-panel-date-pill:focus-visible .task-panel-date-value {
  border-color: #93c5fd;
  color: #1d4ed8;
}

.task-panel-scroll {
  min-height: 0;
  padding-right: 2px;
}

.task-panel-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 28px;
  border-radius: 14px;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.96), rgba(255, 255, 255, 0.96));
  border-color: rgba(203, 213, 225, 0.82);
}

.task-panel-table {
  display: grid;
  gap: 6px;
  min-width: 860px;
}

.task-panel-row {
  display: grid;
  grid-template-columns: 150px 150px 138px minmax(280px, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 82px;
  padding: 12px 14px;
  overflow: visible;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.035);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.task-panel-row-head {
  min-height: 36px;
  align-items: center;
  padding: 8px 14px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.92);
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  box-shadow: none;
}

.task-panel-row:not(.task-panel-row-head):hover,
.task-panel-row:not(.task-panel-row-head):focus-within {
  border-color: rgba(147, 197, 253, 0.86);
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.07);
  transform: translateY(-1px);
}

.task-panel-row > div {
  min-width: 0;
}

.task-panel-row:not(.task-panel-row-head) > div:nth-child(3) {
  padding-left: 14px;
}

.task-panel-row:not(.task-panel-row-head) > div:nth-child(4) {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: flex-start;
  padding-left: 0;
}

.task-panel-expert-cell {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.task-panel-expert-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #dbeafe;
}

.task-panel-expert-icon svg {
  width: 19px;
  height: 19px;
}

.task-panel-expert-icon-planner {
  color: #0f766e;
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.task-panel-expert-icon-zhihu {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.task-panel-expert-icon-leads {
  color: #0f766e;
  background: #ecfeff;
  border-color: #a5f3fc;
}

.task-panel-expert-icon-poster {
  color: #be123c;
  background: #fff1f2;
  border-color: #fecdd3;
}

.task-panel-expert-cell strong {
  min-width: 0;
  color: #1c324d;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-panel-task-cell {
  display: flex;
  min-width: 0;
}

.task-panel-task-cell select {
  width: 10em;
  max-width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 0 34px 0 12px;
  border-radius: 10px;
  border: 1px solid #d8e1ef;
  background: #f8fafc;
  color: #1f2f49;
  font: inherit;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.task-panel-task-cell select:hover,
.task-panel-task-cell select:focus-visible {
  border-color: #93c5fd;
  background: #ffffff;
}

.task-panel-task-cell select:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.26);
  outline-offset: 2px;
}

.task-panel-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.task-panel-status-icon {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.task-panel-status-text {
  min-width: 0;
  color: #1f2f49;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-panel-running-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.task-panel-running-dots span {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  animation: task-status-dot-bounce 1s ease-in-out infinite;
}

.task-panel-running-dots span:nth-child(2) {
  animation-delay: 0.14s;
}

.task-panel-running-dots span:nth-child(3) {
  animation-delay: 0.28s;
}

.task-panel-muted {
  color: #61758f;
  font-size: 13px;
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-panel-status-completed .task-panel-status-icon {
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.task-panel-status-pending .task-panel-status-icon {
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.task-panel-status-running .task-panel-status-icon {
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.task-panel-status-failed .task-panel-status-icon {
  color: #b42318;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.task-panel-artifact-list {
  display: grid;
  gap: 5px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
  overflow: visible;
}

.task-panel-artifact-center {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
}

.task-panel-artifact-menu {
  position: relative;
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
  z-index: 4;
}

.task-panel-artifact-trigger {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #cfe0f5;
  background: #ffffff;
  color: #1f2f49;
  box-shadow: none;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.task-panel-artifact-trigger:hover,
.task-panel-artifact-trigger:focus-visible,
.task-panel-artifact-trigger[aria-expanded="true"] {
  border-color: #93c5fd;
  color: #1d4ed8;
}

.task-panel-artifact-trigger:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.task-panel-artifact-popover {
  position: fixed;
  overflow-y: auto;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(203, 213, 225, 0.96);
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
  transform: none;
  z-index: 1200;
}

.task-panel-artifact-popover .task-panel-artifact-list {
  width: 100%;
}

.task-panel-artifact-list li {
  display: grid;
  position: relative;
  grid-template-columns: minmax(96px, 0.72fr) minmax(0, 1.28fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 32px;
  padding: 5px 8px;
  border-radius: 9px;
  background: rgba(248, 250, 252, 0.88);
  border: 1px solid transparent;
  transition: border-color 160ms ease, background 160ms ease;
}

.task-panel-artifact-list li:hover,
.task-panel-artifact-list li:focus-within {
  border-color: #dbeafe;
  background: #ffffff;
}

.task-panel-artifact-list li.task-panel-artifact-item-copied {
  padding-right: 8px;
}

.task-panel-artifact-name,
.task-panel-artifact-url {
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-panel-artifact-name {
  color: #1f2f49;
  font-weight: 750;
}

.task-panel-artifact-url {
  color: #60728c;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.task-panel-artifact-url:hover,
.task-panel-artifact-url:focus-visible {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.task-panel-artifact-url:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.34);
  outline-offset: 2px;
  border-radius: 6px;
}

.task-panel-artifact-copied {
  position: static;
  color: #047857;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
  text-align: right;
  white-space: nowrap;
}

.task-panel-loading-state {
  display: grid;
  gap: 6px;
  min-width: 860px;
}

.task-panel-loading-row {
  display: grid;
  grid-template-columns: 32px 106px 150px 138px minmax(280px, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 82px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.78);
  background: rgba(255, 255, 255, 0.76);
}

.task-panel-loading-avatar,
.task-panel-loading-line,
.task-panel-loading-pill {
  display: block;
  overflow: hidden;
  background: linear-gradient(90deg, #eef2f7 0%, #f8fafc 48%, #eef2f7 100%);
  background-size: 220% 100%;
  animation: task-panel-loading-shimmer 1.3s ease-in-out infinite;
}

.task-panel-loading-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.task-panel-loading-line {
  height: 12px;
  border-radius: 999px;
}

.task-panel-loading-line-name {
  width: 88px;
}

.task-panel-loading-line-task {
  width: min(100%, 10em);
}

.task-panel-loading-pill {
  width: 78px;
  height: 24px;
  border-radius: 999px;
}

.task-panel-loading-line-artifact {
  width: min(100%, 360px);
}

@keyframes task-panel-greeting-caret {
  0%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0.18;
  }
}

@keyframes task-panel-loading-shimmer {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

@keyframes task-status-dot-bounce {
  0%, 80%, 100% {
    opacity: 0.42;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (max-width: 980px) {
  .task-panel-scroll {
    overflow-x: auto;
  }
}

@media (max-width: 720px) {
  .task-panel-page {
    padding: 14px;
    border-radius: 18px;
  }

  .task-panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .task-panel-date-field {
    width: fit-content;
  }

  .task-panel-table,
  .task-panel-loading-state {
    min-width: 0;
  }

  .task-panel-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    min-height: 0;
  }

  .task-panel-row-head {
    display: none;
  }

  .task-panel-row:not(.task-panel-row-head) > div:nth-child(3) {
    padding-left: 0;
  }

  .task-panel-loading-row {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .task-panel-loading-line-task,
  .task-panel-loading-pill,
  .task-panel-loading-line-artifact {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .task-panel-greeting::after,
  .task-panel-running-dots span,
  .task-panel-loading-avatar,
  .task-panel-loading-line,
  .task-panel-loading-pill {
    animation: none;
  }

  .task-panel-row {
    transition: none;
  }

  .task-panel-row:not(.task-panel-row-head):hover,
  .task-panel-row:not(.task-panel-row-head):focus-within {
    transform: none;
  }
}
