/* Data Tomo CSV attachments (LTA-109).
   Loaded after data-tomo.css; every class carries the dt- prefix, and there
   are no external assets -- the deployed CSP is `default-src 'self'` and
   img-src allows `data:` but NOT `blob:`. */

.dt-attach-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 18px 0 -8px;
}

/* The prototype's .chip, matched: 99px radius, 1px border, a mono count
   sub-label exactly where .chip .c sits. */
.dt-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--dt-border);
  border-radius: 99px;
  padding: 6px 8px 6px 15px;
  font-size: 0.78rem;
  color: var(--dt-text-body);
  max-width: 100%;
}

.dt-attach-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dt-attach-count {
  font-family: var(--dt-font-mono);
  font-size: 0.7rem;
  color: var(--dt-text-muted);
}

.dt-attach-x {
  background: none;
  border: 0;
  padding: 0 6px;
  margin: 0;
  width: auto;
  font-size: 1rem;
  line-height: 1;
  color: var(--dt-text-muted);
  cursor: pointer;
}

.dt-attach-x:hover { color: var(--dt-accent); }

.dt-attach-flash {
  font-size: 0.78rem;
  color: var(--dt-text-muted);
  padding: 6px 2px;
}

/* A third slot in the composer's existing flex row. */
.dt-attach-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 4px 6px;
  margin: 0;
  border-radius: 6px;
  color: var(--dt-text-muted);
  cursor: pointer;
  font-size: 0.9rem;
}

.dt-attach-btn:hover { background: var(--dt-hover-bg); color: var(--dt-accent); }
.dt-attach-btn:focus-within { outline: 2px solid var(--dt-accent); outline-offset: 2px; }
.dt-attach-busy { opacity: .5; pointer-events: none; }

/* The composer is `disabled` for an admin reading someone else's history, and
   attaching is a write -- so the control goes with it. */
.dt-composer-locked .dt-attach-btn { opacity: .4; pointer-events: none; }

.dt-visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* The prototype's .figure / .fig-t / .fig-s, with an <img> instead of the
   hand-authored SVG. The table still renders beneath it. */
.dt-figure { padding: 4px 20px 0; }
.dt-fig-t {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--dt-text-head);
  margin: 0 0 2px;
}
.dt-fig-s {
  font-size: 0.7rem;
  color: var(--dt-text-muted);
  margin: 0 0 10px;
}
.dt-figure-img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--dt-border-light);
  border-radius: 8px;
}

/* Matches .dt-sql, so the two receipts read as one pair. */
.dt-code {
  background: #22333d;
  color: #dbe6ee;
  border-radius: 8px;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--dt-font-mono);
  font-size: 0.7rem;
  line-height: 1.7;
  margin: 0;
  white-space: pre;
}

@media (max-width: 640px) {
  .dt-attach-chip { max-width: 100%; }
  .dt-attach-name { max-width: 55vw; }
}
