/* ==========================================================================
   artifact-viewer.css — Orcheum-owned PDF preview surface
   --------------------------------------------------------------------------
   Conversation file cards keep their existing shape. Opening a PDF reveals a
   workspace-contained viewer: Orcheum chrome around an Adobe SIZED_CONTAINER
   document area. Adobe never owns the application shell.
   ========================================================================== */

/* The conversation's generated-file row is NOT here any more. It is the kit
   component 166:3466 (components/chat/generated-file.css); this file owns the
   PDF/spreadsheet viewer alone. The `.msg-file--document` rules that stood
   here — a 16px mark, a single crammed label, and two 10px chips on a tint —
   are deleted, not overridden. */

.oc-artifact-viewer {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: none;
  pointer-events: none;
  align-items: stretch;
  justify-content: stretch;
  min-width: 0;
  min-height: 0;
  padding: 16px;
  background: rgba(36, 37, 45, 0.12);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  box-sizing: border-box;
}
.oc-artifact-viewer.is-open {
  display: flex;
  pointer-events: auto;
}

.oc-artifact-viewer__panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--color-background, #fbf7ef);
  border: 1px solid var(--color-card-border, #e2e0d8);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(36, 37, 45, 0.12);
}

.oc-artifact-viewer__bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--ws-surface-line, #bdc4c6);
}
.oc-artifact-viewer__identity {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.oc-artifact-viewer__title {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: var(--font-weight-medium, 500);
  color: var(--ws-surface-ink, #24252d);
}
.oc-artifact-viewer__format {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ws-surface-muted, #73726c);
}
.oc-artifact-viewer__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.oc-artifact-viewer__action {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 2px 8px;
  border: 0;
  border-radius: 7px;
  background: var(--ws-surface-chip, #f0eee6);
  color: var(--ws-surface-ink, #24252d);
  font-family: Geist, Inter, var(--font-sans);
  font-size: 10px;
  line-height: 20px;
  cursor: pointer;
}
.oc-artifact-viewer__action:hover { filter: brightness(0.97); }
.oc-artifact-viewer__action:focus-visible,
.oc-artifact-viewer__close:focus-visible {
  outline: 2px solid var(--color-puddle-700, #0f172a);
  outline-offset: 2px;
}
.oc-artifact-viewer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: none;
  cursor: pointer;
}
.oc-artifact-viewer__close:hover { background: var(--ws-surface-chip, #f0eee6); }
.oc-artifact-viewer__close-icon {
  width: 14px;
  height: 14px;
  display: block;
  opacity: 0.7;
}

.oc-artifact-viewer__body {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  background: var(--color-cream-50, #fbf7ef);
}
.oc-artifact-viewer__adobe,
.oc-pdf-viewer__adobe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 240px;
}
.oc-artifact-viewer__status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: var(--color-cream-50, #fbf7ef);
  color: var(--color-text-secondary, #73726c);
  font-family: var(--font-sans);
  font-size: 14px;
  text-align: center;
}
.oc-artifact-viewer__status[hidden],
.oc-artifact-viewer__adobe[hidden],
.oc-artifact-viewer__sheet[hidden] { display: none; }

.oc-artifact-viewer__sheet {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 16px 20px 24px;
  background: var(--color-cream-50, #fbf7ef);
}
.oc-sheet-preview__header { margin-bottom: 12px; }
.oc-sheet-preview__title {
  display: block;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ws-surface-ink, #24252d);
}
.oc-sheet-preview__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.oc-sheet-preview__tab {
  height: 24px;
  padding: 2px 10px;
  border: 1px solid var(--color-card-border, #e2e0d8);
  border-radius: 7px;
  background: var(--ws-surface-chip, #f0eee6);
  font-family: var(--font-sans);
  font-size: 11px;
  cursor: pointer;
}
.oc-sheet-preview__tab[aria-selected="true"] {
  background: var(--ws-surface-ink, #24252d);
  color: #fbf7ef;
  border-color: transparent;
}
.oc-sheet-preview__table-wrap { overflow: auto; max-height: 100%; }
.oc-sheet-preview__table {
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 12px;
  min-width: 100%;
}
.oc-sheet-preview__table th,
.oc-sheet-preview__table td {
  border: 1px solid var(--color-card-border, #e2e0d8);
  padding: 6px 10px;
  text-align: left;
  white-space: nowrap;
}
.oc-sheet-preview__table th {
  background: #eef3f7;
  font-weight: 600;
}
.oc-sheet-preview__empty {
  margin: 0;
  color: var(--ws-surface-muted, #73726c);
  font-family: var(--font-sans);
  font-size: 13px;
}
.oc-artifact-viewer__status--ready { display: none; }
.oc-artifact-viewer__message {
  margin: 0;
  max-width: 28rem;
  line-height: 1.45;
  color: var(--ws-surface-ink, #24252d);
}
.oc-artifact-viewer__spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(36, 37, 45, 0.12);
  border-top-color: var(--ws-surface-ink, #24252d);
  border-radius: 50%;
  animation: oc-artifact-viewer-spin 0.85s linear infinite;
}

@keyframes oc-artifact-viewer-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1000px) {
  .oc-artifact-viewer { padding: 8px; }
  .oc-artifact-viewer__bar { padding: 10px 14px; }
}

@media (max-width: 640px) {
  .oc-artifact-viewer {
    padding: 0;
  }
  .oc-artifact-viewer__panel {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .oc-artifact-viewer__spinner { animation-duration: 1ms; }
}
