.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-scroll .scroll-area-content {
  display: grid;
  min-height: 0;
  overflow: hidden;
}

.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-content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.task-panel-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.task-panel-stat-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 3px;
  min-width: 0;
  min-height: 92px;
  padding: 15px;
  border-radius: 14px;
  border: 1px solid rgba(219, 234, 254, 0.92);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.045);
}

.task-panel-stat-icon {
  display: grid;
  grid-row: 1 / span 2;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.task-panel-stat-icon svg {
  width: 21px;
  height: 21px;
}

.task-panel-stat-card-messages .task-panel-stat-icon,
.task-panel-stat-card-employees .task-panel-stat-icon {
  color: #0f766e;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.task-panel-stat-card-artifacts .task-panel-stat-icon {
  color: #0891b2;
  background: #ecfeff;
  border-color: #a5f3fc;
}

.task-panel-stat-label {
  align-self: start;
  min-width: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-panel-stat-value {
  align-self: end;
  min-width: 0;
  color: #17253d;
  font-size: 24px;
  font-weight: 780;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.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-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-output-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  min-height: 0;
}

.task-panel-output-header {
  display: grid;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(219, 234, 254, 0.82);
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.task-panel-output-heading {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.task-panel-output-heading-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  color: #0f766e;
  background: linear-gradient(135deg, #ecfeff 0%, #ecfdf5 100%);
  border: 1px solid #99f6e4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 8px 16px rgba(15, 118, 110, 0.1);
  font-size: 24px;
  line-height: 1;
}

.task-panel-output-header h2 {
  margin: 0;
  color: #17253d;
  font-size: 16px;
  font-weight: 780;
  line-height: 1.35;
}

.task-panel-output-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.task-panel-output-item {
  display: grid;
  position: relative;
  grid-template-columns: 30px minmax(0, 1fr) minmax(260px, 0.46fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  background: rgba(255, 255, 255, 0.92);
  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-output-item:hover,
.task-panel-output-item: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-output-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  color: #0f766e;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.task-panel-output-icon svg {
  width: 18px;
  height: 18px;
}

.task-panel-output-main,
.task-panel-output-meta,
.task-panel-output-meta > div {
  min-width: 0;
}

.task-panel-output-main {
  display: grid;
  gap: 5px;
}

.task-panel-output-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.task-panel-output-title-row strong {
  min-width: 0;
  color: #17253d;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-panel-output-kind {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  color: #0f766e;
  background: #ccfbf1;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.task-panel-output-main p {
  margin: 0;
  color: #52657f;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
}

.task-panel-output-url-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  justify-self: start;
  max-width: 100%;
}

.task-panel-output-url {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #60728c;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

.task-panel-output-meta {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.task-panel-output-meta > div {
  display: grid;
  gap: 2px;
}

.task-panel-output-meta > div strong,
.task-panel-output-meta > div span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-panel-output-meta > div strong {
  color: #1c324d;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.35;
}

.task-panel-output-meta > div span {
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.task-panel-output-empty {
  min-height: 180px;
}

.task-panel-artifact-copied {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(167, 243, 208, 0.9);
  background: rgba(240, 253, 250, 0.96);
  color: #047857;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  pointer-events: none;
  white-space: nowrap;
}

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

.task-panel-loading-row {
  display: grid;
  grid-template-columns: 38px repeat(4, minmax(0, 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-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-panel-output-item {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .task-panel-output-meta {
    grid-column: 2;
  }
}

@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-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-panel-stat-card {
    min-height: 78px;
  }

  .task-panel-output-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-panel-output-icon,
  .task-panel-output-meta {
    grid-column: 1;
  }

  .task-panel-output-icon {
    width: 30px;
    height: 30px;
  }

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

@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-output-item {
    transition: none;
  }

  .task-panel-output-item:hover,
  .task-panel-output-item:focus-within {
    transform: none;
  }
}
