.artifact-card {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem .7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: .5rem;
  max-width: 28rem;
}
.artifact-name {
  font-family: var(--font-ui);
  font-size: .8rem;
  font-weight: 700;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}
.artifact-size {
  flex-shrink: 0;
  font-size: .72rem;
  color: var(--muted);
  white-space: nowrap;
}
.artifact-open { flex-shrink: 0; }
#artifact-reload {
  padding: .3rem .7rem;
  white-space: nowrap;
}
.artifact-body {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.artifact-frame {
  border: 0;
  width: 100%;
  flex: 1 1 auto;
  background: #fff;
}
.artifact-prose {
  padding: 1rem 1.1rem;
  max-width: 44rem;
}
.artifact-text {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow: auto;
}
.artifact-image {
  max-width: 100%;
  align-self: center;
  margin: 1rem;
}
.artifact-body .panel-note { padding: 1rem 1.1rem; }
/* Artifact discussions: Discuss points into the frame; the discussions
   sidebar sits beside it, and over it on a phone. */
.artifact-main { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
.artifact-main .artifact-body { min-width: 0; }
#artifact-discussion[aria-pressed="true"],
#artifact-discussions[aria-expanded="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}
#artifact-discussions { display: inline-flex; align-items: center; gap: .4rem; position: relative; }
#artifact-discussions .count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font: 600 11px/18px var(--font-ui); text-align: center; }
/* Folded into the header's ⋯, the button's unread dot marks the menu. */
/* A folded Reload, like unread discussions, marks the ⋯ menu. */
#artifact-panel .head-more:has(#artifact-discussions.unread) > summary,
#artifact-panel .head-more:has(#artifact-reload:not([hidden])) > summary { position: relative; }
#artifact-panel .head-more:has(#artifact-discussions.unread) > summary::after,
#artifact-panel .head-more:has(#artifact-reload:not([hidden])) > summary::after,
#artifact-discussions.unread::after { content: ""; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
.artifact-side { flex: none; width: min(380px, 42vw); display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); font-family: var(--font-ui); font-size: 14px; }
.artifact-side[hidden] { display: none; }
.artifact-side-head { flex: none; display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 4px 8px 4px 14px; border-bottom: 1px solid var(--line); }
.artifact-side-head button { min-width: 32px; font-size: 20px; line-height: 1; }
@media (max-width: 799px) {
  .artifact-side { position: absolute; inset: 0; z-index: 6; width: auto; border-left: 0; }
}
/* A marker under the pointer shows its latest message. */
.artifact-peek { position: absolute; z-index: 5; max-width: 260px; padding: 7px 9px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); font: 12px/1.45 var(--font-ui); pointer-events: none; }
.artifact-peek[hidden] { display: none; }
.artifact-peek small { display: block; color: var(--muted); font-weight: 700; }
.artifact-peek p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
/* A turn reached from an artifact discussion's "Show in chat". */
@keyframes turn-revealed {
  from { background: var(--accent-soft); }
  to { background: transparent; }
}
.turn-revealed {
  animation: turn-revealed 2.4s ease-out;
  border-radius: .4rem;
}
@media (prefers-reduced-motion: reduce) {
  .turn-revealed { animation: none; outline: 2px solid var(--accent); }
}
