:root {
  color-scheme: light;
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  background: #f4faf8;
  color: #123d37;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 280px;
  min-height: 220px;
  background: #f4faf8;
}

button {
  font: inherit;
}

.wt-pip {
  --live: #0b7f70;
  position: relative;
  min-height: 100vh;
  padding: 16px 16px 14px 22px;
  overflow: hidden;
}

.wt-pip[data-mode="paused"] {
  --live: #b87812;
  background: #fffaf0;
}

.wt-pip[data-mode="completed"] {
  --live: #287a4d;
  background: #f3fbf6;
}

.wt-pip-rail {
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: var(--live);
}

.wt-pip[data-mode="active"] .wt-pip-rail {
  animation: wt-pip-pulse 1.8s ease-in-out infinite;
}

.wt-pip header,
.wt-pip-actions,
.wt-pip-confirm > div,
.wt-pip-meta {
  display: flex;
  align-items: center;
}

.wt-pip header {
  justify-content: space-between;
  gap: 12px;
}

.wt-pip-badge {
  border-radius: 999px;
  padding: 5px 11px;
  background: var(--live);
  color: white;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
}

.wt-pip-sync {
  color: #57736e;
  font-size: 12px;
}

.wt-pip-task {
  margin: 15px 0 2px;
  overflow: hidden;
  color: #315b54;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wt-pip-clock {
  display: block;
  margin: 0;
  color: #073f37;
  font-family: "Cascadia Mono", "Roboto Mono", Consolas, monospace;
  font-size: clamp(38px, 15vw, 58px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.06em;
  line-height: 1.15;
}

.wt-pip-meta {
  gap: 18px;
  margin: 4px 0 12px;
}

.wt-pip-meta div {
  min-width: 0;
}

.wt-pip-meta dt {
  color: #66807b;
  font-size: 11px;
}

.wt-pip-meta dd {
  margin: 1px 0 0;
  max-width: 150px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wt-pip-message {
  margin: 0 0 10px;
  border-radius: 8px;
  padding: 8px 10px;
  background: #e6f1ef;
  color: #244e47;
  font-size: 12px;
}

.wt-pip-message[data-tone="error"] {
  background: #fde9e7;
  color: #8a2920;
}

.wt-pip-message[data-tone="success"] {
  background: #e1f3e8;
  color: #23613e;
}

.wt-pip-actions,
.wt-pip-confirm > div {
  gap: 8px;
}

.wt-pip-actions button,
.wt-pip-confirm button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 800;
}

.wt-pip-actions button:focus-visible,
.wt-pip-confirm button:focus-visible {
  outline: 3px solid #8ccfc4;
  outline-offset: 2px;
}

.wt-pip-actions button:disabled,
.wt-pip-confirm button:disabled {
  cursor: wait;
  opacity: .58;
}

.wt-pip-ghost {
  border-color: #a9c1bc !important;
  background: white;
  color: #315b54;
}

.wt-pip-primary {
  background: #0b7f70;
  color: white;
}

.wt-pip-warning {
  background: #b87812;
  color: white;
}

.wt-pip-danger {
  background: #a73a32;
  color: white;
}

.wt-pip-confirm {
  border-top: 1px solid #d5e4e1;
  padding-top: 10px;
}

.wt-pip-confirm strong,
.wt-pip-confirm span {
  display: block;
}

.wt-pip-confirm span {
  margin: 3px 0 9px;
  color: #5d716d;
  font-size: 12px;
}

@keyframes wt-pip-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .46; }
}

@media (prefers-reduced-motion: reduce) {
  .wt-pip[data-mode="active"] .wt-pip-rail {
    animation: none;
  }
}
