/* ThoughtLine CSS */
.thought-line {
  --tl-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --tl-ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --tl-font: 13px;
  --tl-color: #18181b;
  --tl-glyph: #18181b;
  --tl-settle: 250ms;
  --tl-blur: 2px;
  --tl-shimmer: 1.8s;
  --tl-done: 0.75;
  --tl-timer: 0.55;

  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  color: var(--tl-color);
  font-family: inherit;
  font-size: var(--tl-font);
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 6px;
}

.thought-line__head {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin: 0;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  color: inherit;
  font: inherit;
  text-align: left;
  white-space: nowrap;
  outline: none;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: all 0.15s ease;
}

.thought-line__head:hover {
  background: #f4f4f6;
  border-color: rgba(0, 0, 0, 0.15);
}

.thought-line__glyph {
  display: inline-flex;
  flex: none;
  width: 1em;
  height: 1em;
  color: var(--tl-glyph);
}

.thought-line__glyph svg {
  display: block;
  width: 100%;
  height: 100%;
}

.thought-line__label {
  display: inline-grid;
}

.thought-line__text {
  grid-area: 1 / 1;
  width: max-content;
  opacity: 0;
  filter: blur(var(--tl-blur));
  transition:
    opacity var(--tl-settle) var(--tl-ease-out),
    filter var(--tl-settle) var(--tl-ease-out);
}

.thought-line__text[data-active] {
  opacity: 1;
  filter: blur(0);
}

.thought-line__text--done[data-active] {
  opacity: var(--tl-done);
}

.thought-line__breath {
  display: inline-block;
}

.thought-line[data-working] .thought-line__breath[data-shimmer] {
  background: linear-gradient(
    100deg,
    rgba(24, 24, 27, 0.3) 30%,
    rgba(24, 24, 27, 1) 50%,
    rgba(24, 24, 27, 0.3) 70%
  );
  background-size: 250% 100%;
  background-position: 125% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: thought-line-shimmer var(--tl-shimmer) linear infinite;
}

@keyframes thought-line-shimmer {
  to {
    background-position: -125% 0;
  }
}

.thought-line__timer {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  opacity: var(--tl-timer);
  font-size: 0.9em;
}

/* Chevron: Points strictly DOWN (v) by default, and rotates UP (^) when [data-open] */
.thought-line__chevron {
  display: inline-flex;
  margin-left: 0.25em;
  opacity: 0.6;
  transform: rotate(0deg);
  transition: transform 200ms var(--tl-ease-out);
}

.thought-line[data-open] .thought-line__chevron {
  transform: rotate(180deg);
}

.thought-line__trace {
  display: grid;
  grid-template-rows: 0fr;
  width: 100%;
  transition: grid-template-rows var(--tl-settle) var(--tl-ease-out);
}

.thought-line[data-open] .thought-line__trace {
  grid-template-rows: 1fr;
}

.thought-line__fold {
  min-height: 0;
  overflow-x: visible;
  overflow-y: clip;
}

.thought-line__steps {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  padding: 0.5em 0 0.2em 0.6em;
  font-size: 0.85em;
  font-family: var(--font-mono);
  font-weight: 400;
  color: #52525b;
}

.thought-line__step {
  display: flex;
  align-items: center;
  gap: 0.5em;
  opacity: 1;
  transition: opacity 200ms var(--tl-ease-out);
}

.thought-line__mark {
  display: inline-grid;
  place-items: center;
  width: 1em;
  height: 1em;
  opacity: 0.7;
}

.thought-line__pulse {
  display: block;
  width: 0.45em;
  height: 0.45em;
  border-radius: 50%;
  background: #18181b;
  animation: thought-line-pulse 1.4s var(--tl-ease-in-out) infinite;
}

@keyframes thought-line-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}

.thought-line__step[data-done] {
  opacity: 0.65;
}
