/* Agent: Today, Chat, Memory and Activity.
   Styles for this area only; colours and sizes come from the tokens in theme.css (no raw colour values here). Mobile
   first: one column, then two from 1024px where the content column is wide enough for a main card and a side column. */

/* ============================== frame ============================== */

.agent-screen {
  display: grid;
  gap: var(--space-16);
  align-content: start;
}

:where(.agent-screen) p {
  margin: 0;
}

/* A status line under the title: on or off, and who answers. */
.agent-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-12);
  min-width: 0;
}

.agent-status .caption {
  min-width: 0;
}

.agent-group {
  display: grid;
  gap: var(--space-24);
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}

/* Cards: 16px between the parts of one (the kit's own rows and disclosures keep their own padding). */
.agent-screen .card > * + * {
  margin-top: var(--space-16);
}

.ag-alerts {
  display: grid;
  gap: var(--space-8);
}

.ag-alerts:empty,
.ag-rows:empty,
.ag-cards:empty,
.ag-proposals:empty,
.ag-groups:empty,
.run-list:empty {
  display: none;
}

/* Small print on an inset surface (a proposal, a decision, a bubble, a run's detail) is a notch stronger: the inset is
   darker than the card, and the secondary grey alone falls just short of 4.5:1 on it. */
.ag-proposal,
.ag-card-row,
.run-detail,
.agent-chat .bubble {
  --text-2: var(--text-2-strong);
}

/* An empty list inside a card is a quiet note, not a page: a smaller icon, a title at body size, no extra padding. */
.agent-screen .ui-empty-compact {
  padding: var(--space-4) 0 var(--space-8);
}

.agent-screen .ui-empty-compact .ui-empty-icon {
  width: 44px;
  height: 44px;
  margin-bottom: var(--space-8);
}

.agent-screen .ui-empty-compact .ui-empty-title {
  font-size: var(--text-md-size);
  line-height: var(--text-md-line);
}

/* Chips hold words that come from data (a severity, a status): they may wrap rather than widen the page. */
.agent-screen .chip {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.ag-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-6);
  min-width: 0;
}

/* One line of small print: "Sat 17 Oct, 14:30 · claude-opus-5-5 · Scheduled brief". Not tabular: the model name has hyphens, and
   tabular figures would space them as wide as digits. */
.ag-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--space-6);
  color: var(--text-2);
  font-size: var(--text-xs-size);
  line-height: var(--text-xs-line);
}

.ag-dot {
  color: var(--text-faint);
}

.ag-lead {
  margin-bottom: var(--space-4);
}

.ag-failed {
  display: grid;
  justify-items: start;
  gap: var(--space-12);
}

.ag-bullets {
  margin: var(--space-4) 0 0;
  padding-left: var(--space-18);
}

.ag-bullets li + li {
  margin-top: var(--space-4);
}

/* ============================== Today ============================== */

/* Today is one stack on a phone, in the order of the page (the brief, the proposals, the overrides; a proposal that is
   waiting for the owner moves up to the top: the order is the page's own, so the keyboard follows the eye). From a
   desktop width the brief and the overrides share a column and the decisions waiting for the owner sit beside them;
   the second row takes the slack, so a tall column leaves no gap between the two cards of the other. */
.agent-today-cols {
  display: grid;
  gap: var(--space-24);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1024px) {
  .agent-today-cols {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    grid-template-rows: auto 1fr;
    align-items: start;
  }

  .agent-today-cols > .agent-brief {
    grid-area: 1 / 1;
  }

  .agent-today-cols > #agent-overrides-card {
    grid-area: 2 / 1;
  }

  .agent-today-cols > .agent-proposals-card {
    grid-area: 1 / 2 / span 2;
  }
}

/* The latest brief: the headline is the card's hero. */
.agent-brief {
  display: grid;
  gap: var(--space-4);
  align-content: start;
  padding: var(--space-20);
}

/* The brief card is drawn by renderBrief() into any card (Home shows it too): it carries its own spacing and resets. */
.agent-brief.card > * + * {
  margin-top: 0;
}

:where(.agent-brief) p {
  margin: 0;
}

.agent-brief .chip {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.brief-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
}

.brief-title {
  display: inline-flex;
  align-items: center;
  gap: var(--space-6);
  margin: 0;
  color: var(--text-2);
  font-size: var(--text-sm-size);
  line-height: var(--text-sm-line);
  font-weight: var(--weight-medium);
}

.brief-title > .eh-icon {
  color: var(--accent);
}

.brief-body {
  display: grid;
  gap: var(--space-20);
}

.agent-brief.card > .brief-body,
.agent-brief.card > .brief-headline {
  margin-top: var(--space-12);
}

.brief-headline {
  color: var(--text);
  font-size: var(--text-xl-size);
  line-height: var(--text-xl-line);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
}

@media (min-width: 640px) {
  .brief-headline {
    font-size: var(--display-xs-size);
    line-height: var(--display-xs-line);
  }
}

.brief-block > h3 {
  margin-bottom: var(--space-10);
  color: var(--text-2);
  font-size: var(--text-sm-size);
  line-height: var(--text-sm-line);
  font-weight: var(--weight-medium);
}

/* Key decisions hang off a line, each with its time (ol.plain in styles.css has the same weight: this comes later). */
ol.brief-decisions {
  display: grid;
  gap: var(--space-16);
  margin: 0 0 0 var(--space-4);
  padding: 0 0 0 var(--space-16);
  border-left: 2px solid var(--border);
}

.brief-decisions > li {
  position: relative;
  min-width: 0;
}

.brief-decisions > li::before {
  content: '';
  position: absolute;
  top: var(--space-4);
  left: calc(-1 * var(--space-16) - 6px);
  width: 10px;
  height: 10px;
  border: 2px solid var(--surface);
  border-radius: var(--radius-full);
  background: var(--accent);
}

.brief-when {
  display: block;
  color: var(--accent);
  font-size: var(--text-xs-size);
  line-height: var(--text-xs-line);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}

.brief-what {
  margin-top: var(--space-2);
  color: var(--text);
  font-size: var(--text-md-size);
  line-height: var(--text-md-line);
  font-weight: var(--weight-medium);
}

.brief-why {
  display: -webkit-box;
  margin-top: var(--space-2);
  overflow: hidden;
  color: var(--text-2);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.brief-more-hint {
  margin: var(--space-10) 0 0 calc(var(--space-4) + var(--space-16) + 2px);
  color: var(--text-2);
  font-size: var(--text-sm-size);
  line-height: var(--text-sm-line);
}

.brief-risks {
  display: grid;
  gap: var(--space-10);
}

.brief-risks > li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-10);
  margin: 0;
}

.brief-risks > li > .chip {
  flex: none;
  max-width: 45%;
  margin-top: var(--space-2);
}

.brief-risks > li > span:last-child {
  min-width: 0;
}

.brief-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-8);
}

.brief-foot > .link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  margin-left: auto;
  font-weight: var(--weight-medium);
}

.brief-body > .ui-disclosure-plain {
  margin-bottom: calc(-1 * var(--space-4));
  border-bottom: 0;
}

.brief-more {
  display: grid;
  gap: var(--space-16);
  font-size: var(--text-sm-size);
  line-height: var(--text-sm-line);
}

.brief-more-what {
  font-weight: var(--weight-semibold);
}

.brief-more-item + .brief-more-item {
  padding-top: var(--space-16);
  border-top: 1px solid var(--border);
}

.brief-more-item > .brief-when {
  margin-bottom: var(--space-2);
}

.brief-more-item > p + p {
  margin-top: var(--space-4);
}

.brief-more-item > h3 {
  margin-bottom: var(--space-4);
  color: var(--text-2);
  font-size: var(--text-sm-size);
  font-weight: var(--weight-medium);
}

/* Proposals: each one is a small card of its own. */
.ag-proposals {
  display: grid;
  gap: var(--space-12);
}

.ag-proposals > li,
.ag-proposals > li + li {
  margin: 0;
}

.ag-proposal {
  display: grid;
  gap: var(--space-12);
  padding: var(--space-16);
  border: 1px solid var(--border);
  border-radius: var(--radius-12);
  background: var(--surface-2);
}

.prop-head {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  min-width: 0;
}

.prop-head-text {
  min-width: 0;
}

.prop-title {
  color: var(--text);
  font-size: var(--text-md-size);
  line-height: var(--text-md-line);
  font-weight: var(--weight-semibold);
}

.prop-sub {
  color: var(--text-2);
  font-size: var(--text-xs-size);
  line-height: var(--text-xs-line);
}

.prop-why {
  color: var(--text);
  font-size: var(--text-md-size);
  line-height: var(--text-md-line);
}

.prop-effect {
  padding: var(--space-12);
  border-radius: var(--radius-8);
  background: var(--accent-weak);
  color: var(--accent-weak-text);
  font-size: var(--text-sm-size);
  line-height: var(--text-sm-line);
}

.prop-effect-label {
  font-weight: var(--weight-semibold);
}

.ag-proposal .ui-disclosure-plain {
  border-bottom: 0;
}

.ag-proposal .ui-disc-summary {
  min-height: 44px;
  padding: 0;
  font-size: var(--text-sm-size);
  line-height: var(--text-sm-line);
}

.ag-proposal .ui-disc-body {
  padding-bottom: var(--space-8);
}

.prop-expiry {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  color: var(--text-2);
  font-size: var(--text-xs-size);
  line-height: var(--text-xs-line);
  font-variant-numeric: tabular-nums;
}

.prop-expiry.is-soon {
  color: var(--warn-text);
  font-weight: var(--weight-medium);
}

.prop-actions {
  display: flex;
  gap: var(--space-12);
}

.prop-actions > button {
  flex: 1 1 0;
  min-height: 44px;
}

/* ============================== rows (overrides, knowledge, events) ============================== */

.ag-rows {
  display: grid;
}

.ag-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-12);
  padding: var(--space-12) 0;
}

.ag-rows > .ag-row + .ag-row {
  margin-top: 0;
  border-top: 1px solid var(--border);
}

.ag-rows > .ag-row:first-child {
  padding-top: var(--space-4);
}

.ag-rows > .ag-row:last-child {
  padding-bottom: var(--space-4);
}

.ag-row > .featured {
  margin-top: var(--space-2);
}

.ag-main {
  display: grid;
  flex: 1 1 auto;
  gap: var(--space-6);
  min-width: 0;
}

.ag-text {
  color: var(--text);
  font-size: var(--text-md-size);
  line-height: var(--text-md-line);
  font-weight: var(--weight-medium);
}

.ag-note {
  color: var(--text-2);
  font-size: var(--text-sm-size);
  line-height: var(--text-sm-line);
}

.ag-quote {
  color: var(--text);
  font-size: var(--text-sm-size);
  line-height: var(--text-sm-line);
}

.ag-side {
  flex: none;
  min-height: 40px;
}

.ag-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-8);
  margin-top: var(--space-4);
}

.ag-actions > button {
  min-height: 40px;
}

button.link.ag-act {
  padding: 0 var(--space-4);
  font-weight: var(--weight-medium);
}

button.ag-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  justify-self: start;
  min-height: 36px;
  padding: 0;
  font-weight: var(--weight-medium);
}

.ag-toggle > .eh-icon {
  transition: transform var(--dur-2) var(--ease-out);
}

.ag-toggle[aria-expanded='true'] > .eh-icon {
  transform: rotate(180deg);
}

/* Knowledge, grouped by kind. */
.ag-groups {
  display: grid;
  gap: var(--space-20);
}

.ag-group-title {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin-bottom: var(--space-4);
  color: var(--text-2);
  font-size: var(--text-sm-size);
  line-height: var(--text-sm-line);
  font-weight: var(--weight-medium);
}

.ag-group-title > .eh-icon {
  color: var(--accent);
}

/* The decision journal: each decision is a small card of its own. */
.ag-cards {
  display: grid;
  gap: var(--space-12);
}

.ag-cards > li,
.ag-cards > li + li {
  margin: 0;
}

.ag-card-row {
  display: grid;
  gap: var(--space-8);
  padding: var(--space-16);
  border: 1px solid var(--border);
  border-radius: var(--radius-12);
  background: var(--surface-2);
}

.ag-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4) var(--space-8);
}

.ag-when {
  color: var(--text-2);
  font-size: var(--text-xs-size);
  line-height: var(--text-xs-line);
  font-variant-numeric: tabular-nums;
}

.ag-title {
  color: var(--text);
  font-size: var(--text-md-size);
  line-height: var(--text-md-line);
  font-weight: var(--weight-semibold);
}

.ag-why {
  color: var(--text);
  font-size: var(--text-sm-size);
  line-height: var(--text-sm-line);
}

.ag-detail {
  display: grid;
  gap: var(--space-12);
  padding: var(--space-12);
  border: 1px solid var(--border);
  border-radius: var(--radius-8);
  background: var(--surface);
  font-size: var(--text-sm-size);
  line-height: var(--text-sm-line);
}

.ag-detail-label {
  color: var(--text-2);
  font-size: var(--text-xs-size);
  line-height: var(--text-xs-line);
  font-weight: var(--weight-medium);
}

.ag-feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-8);
  font-size: var(--text-sm-size);
  line-height: var(--text-sm-line);
}

.ag-feedback-text {
  flex: 1 1 12em;
  min-width: 0;
}

.ag-days {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-16);
}

.ag-days > label {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin: 0;
  color: var(--text);
  font-size: var(--text-md-size);
}

.ag-form {
  display: grid;
  gap: var(--space-16);
}

.ag-form > .row > button {
  min-height: 44px;
}

/* ============================== Memory ============================== */

@media (min-width: 1024px) {
  .agent-memory {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    align-items: start;
  }

  .agent-memory {
    grid-template-rows: auto 1fr;
  }

  .agent-memory > #memory-decisions-card {
    grid-area: 1 / 1 / span 2;
  }

  .agent-memory > #memory-knowledge-card {
    grid-area: 1 / 2;
  }

  .agent-memory > #memory-events-card {
    grid-area: 2 / 2;
  }
}

/* ============================== Chat ============================== */

/* A conversation reads best in a column of its own: wide, the two sides of it would sit far apart. */
.agent-chatgroup {
  max-width: 880px;
}

.agent-screen .agent-chat {
  display: flex;
  flex-direction: column;
  height: clamp(440px, calc(100dvh - 292px), 760px);
  padding: 0;
  overflow: hidden;
}

.agent-screen .agent-chat > * + * {
  margin-top: 0;
}

/* Nothing said yet: the card is as tall as the prompt and its three questions need (never a scroller too short for them, with
   the last question cut off), and at least as tall as a conversation would be. */
.agent-screen .agent-chat:has(.chat-empty) {
  height: auto;
  min-height: clamp(440px, calc(100dvh - 292px), 760px);
}

/* On a short screen the prompt keeps to its title and the questions, so the message box is above the tab bar without scrolling. */
@media (max-height: 720px) {
  .agent-screen .agent-chat:has(.chat-empty) {
    min-height: 0;
  }

  .chat-empty .ui-empty-icon,
  .chat-empty .ui-empty-text {
    display: none;
  }

  .agent-screen .chat-log:has(.chat-empty) {
    padding-block: var(--space-12);
  }
}

.chat-head {
  padding: var(--space-16) var(--space-16) var(--space-12);
  border-bottom: 1px solid var(--border);
}

.chat-head > h2 {
  margin: 0;
}

.chat-head > .caption {
  display: none;
  margin-top: var(--space-2);
}

@media (min-width: 640px) {
  .chat-head > .caption {
    display: block;
  }
}

.agent-screen .chat-log {
  flex: 1 1 auto;
  gap: var(--space-12);
  min-height: 0;
  max-height: none;
  padding: var(--space-16);
  overscroll-behavior: contain;
}

.msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  min-width: 0;
  max-width: 100%;
}

.msg-user {
  align-items: flex-end;
}

.msg-agent {
  flex-direction: row;
  align-items: flex-start;
  gap: var(--space-8);
}

.msg-avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-top: var(--space-2);
  border-radius: var(--radius-full);
  background: var(--accent-weak);
  color: var(--accent);
}

.msg-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  min-width: 0;
  max-width: min(100%, 600px);
}

.agent-screen .agent-chat .bubble {
  width: fit-content;
  max-width: 100%;
  padding: var(--space-10) var(--space-14);
  border-radius: 18px 18px 18px 6px;
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--text-md-size);
  line-height: var(--text-md-line);
}

.agent-screen .agent-chat .bubble.user {
  max-width: min(88%, 560px);
  border-radius: 18px 18px 6px 18px;
  background: var(--accent-weak);
}

.msg-meta {
  padding: 0 var(--space-6);
  color: var(--text-2);
  font-size: var(--text-xs-size);
  line-height: var(--text-xs-line);
  font-variant-numeric: tabular-nums;
}

.msg-meta:empty {
  display: none;
}

.thinking {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  color: var(--text-2);
}

.typing-dots {
  display: inline-flex;
  gap: var(--space-4);
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: currentColor;
  opacity: 0.4;
  animation: ag-typing 1.2s var(--ease-out) infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 150ms;
}

.typing-dot:nth-child(3) {
  animation-delay: 300ms;
}

@keyframes ag-typing {
  0%,
  60%,
  100% {
    opacity: 0.4;
    transform: none;
  }

  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.bubble-steps-host:not(:empty) {
  margin-top: var(--space-8);
}

.bubble-steps > summary {
  color: var(--text-2);
  font-size: var(--text-xs-size);
  line-height: var(--text-xs-line);
  font-weight: var(--weight-medium);
  cursor: pointer;
}

.bubble .timeline {
  margin-top: var(--space-6);
  font-size: var(--text-xs-size);
  line-height: var(--text-xs-line);
}

.bubble-foot:not([hidden]) {
  margin-top: var(--space-8);
}

/* Nothing said yet: a prompt and three questions that fill the message box. */
.chat-empty {
  display: grid;
  gap: var(--space-8);
  justify-items: center;
  max-width: 460px;
  margin: auto;
}

.chat-suggest {
  display: grid;
  justify-items: center;
  gap: var(--space-8);
  width: 100%;
}

.chat-suggest-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-8);
}

.agent-screen button.suggest {
  min-height: 40px;
  padding: var(--space-8) var(--space-14);
  border-color: var(--control-border, var(--btn-border));
  border-radius: 20px;
  background: var(--surface);
  font-size: var(--text-sm-size);
  line-height: var(--text-sm-line);
  font-weight: var(--weight-medium);
  text-align: left;
  white-space: normal;
}

/* The composer sits at the foot of the card. */
.composer {
  display: grid;
  gap: var(--space-8);
  padding: var(--space-12);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.composer-focus:empty {
  display: none;
}

.composer-row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-8);
}

.composer textarea {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  max-height: 9.5rem;
  padding: var(--space-10) var(--space-16);
  border-radius: 22px;
  field-sizing: content;
  resize: none;
}

.composer button.send {
  flex: none;
  width: 44px;
  height: 44px;
  min-height: 0;
  padding: 0;
  border-radius: var(--radius-full);
}

.composer-note {
  padding: 0 var(--space-4);
}

.chip-focus {
  padding-right: var(--space-4);
}

.agent-screen button.chip-x {
  width: 24px;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: none;
  box-shadow: none;
  color: inherit;
}

.agent-screen button.chip-x:hover:not(:disabled) {
  background: var(--accent-weak);
}

/* ============================== Activity ============================== */

@media (min-width: 1024px) {
  .agent-activity {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    align-items: start;
  }
}

.ag-block {
  display: grid;
  gap: var(--space-12);
}

.ag-block > h3 {
  color: var(--text-2);
  font-size: var(--text-sm-size);
  line-height: var(--text-sm-line);
  font-weight: var(--weight-medium);
}

.meters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-12);
}

@media (min-width: 640px) {
  .meters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .meters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.meter {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  padding: var(--space-12) var(--space-8);
  border: 1px solid var(--border);
  border-radius: var(--radius-12);
  background: var(--surface);
  text-align: center;
}

.meter > .ui-ring {
  margin-bottom: var(--space-6);
}

.meter-label {
  color: var(--text-2);
  font-size: var(--text-xs-size);
  line-height: var(--text-xs-line);
}

.meter-text {
  color: var(--text);
  font-size: var(--text-md-size);
  line-height: var(--text-md-line);
  font-weight: var(--weight-semibold);
}

.ag-autonomy {
  padding: var(--space-12);
  border-radius: var(--radius-8);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--text-sm-size);
  line-height: var(--text-sm-line);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats > .ui-stat {
  min-width: 0;
  padding-left: var(--space-12);
  border-left: 1px solid var(--border);
}

.stats > .ui-stat:first-child {
  padding-left: 0;
  border-left: 0;
}

/* Recent runs: a timeline, the newest first. */
.run-list {
  display: grid;
}

.run-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-12);
  padding-bottom: var(--space-20);
}

.run-list > .run-row + .run-row {
  margin-top: 0;
}

.run-row:last-child {
  padding-bottom: 0;
}

/* The line that joins one run to the next, behind the icon tiles. */
.run-row:not(:last-child)::before {
  content: '';
  position: absolute;
  top: 44px;
  bottom: var(--space-4);
  left: 19px;
  width: 2px;
  border-radius: var(--radius-full);
  background: var(--border);
}

.run-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4) var(--space-8);
}

.run-who {
  min-width: 0;
}

.run-when {
  color: var(--text-2);
  font-size: var(--text-xs-size);
  line-height: var(--text-xs-line);
  font-variant-numeric: tabular-nums;
}

.run-end {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.run-cost {
  color: var(--text-2);
  font-size: var(--text-xs-size);
  line-height: var(--text-xs-line);
}

.run-note {
  color: var(--text);
}

.run-note.muted {
  color: var(--text-2);
}

.run-detail {
  padding: var(--space-12);
  border-radius: var(--radius-8);
  background: var(--surface-2);
}

.run-detail .timeline li {
  margin-bottom: var(--space-8);
}

.tl-time {
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .typing-dot {
    opacity: 0.7;
    animation: none;
  }

  .ag-toggle > .eh-icon {
    transition: none;
  }
}
