@import url("/dev/shared/assets/flow-playground.css");

:root {
  --accent: #0f766e;
  --accent-2: #264653;
}

.dump-workspace {
  grid-template-columns: minmax(300px, 360px) minmax(340px, 430px) minmax(560px, 1fr);
  align-items: stretch;
}

.dump-source-panel,
.dump-chat-panel,
.dump-viewer-panel {
  min-height: calc(100vh - 104px);
}

.dump-viewer-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dump-viewer-panel .panel-body {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.dump-chat-viewer {
  display: flex;
  flex: 1;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e7ede9;
  padding: 10px;
}

.dump-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.media-filters {
  max-height: 94px;
  overflow: auto;
  padding-right: 2px;
}

.dump-filter-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  padding: 6px 9px;
  font-size: 0.74rem;
  font-weight: 800;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.dump-filter-pill.active {
  border-color: rgba(15, 118, 110, 0.62);
  background: #e8f5f2;
  color: var(--ink);
}

.dump-filter-pill span {
  margin-left: 4px;
  color: inherit;
  font-family: var(--mono);
}

.dump-chat-row button {
  gap: 6px;
}

.dump-list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.dump-chat-row .dump-list-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  padding: 3px 6px;
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 800;
}

.dump-viewer-head {
  display: grid;
  grid-template-columns: minmax(220px, 0.48fr) minmax(340px, 1fr) auto;
  grid-template-areas:
    "summary search badge"
    "filters filters filters";
  align-items: start;
  gap: 8px 10px;
}

.dump-viewer-summary {
  grid-area: summary;
  min-width: 0;
}

.dump-viewer-summary h2,
.dump-viewer-summary .section-copy {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dump-participant-line {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.dump-viewer-tools {
  display: contents;
}

.dump-viewer-tools .mode-badge {
  grid-area: badge;
  align-self: start;
  justify-self: end;
  min-height: 26px;
  padding: 4px 7px;
  font-size: 0.68rem;
}

#chatHeaderTools {
  display: contents;
  min-width: 0;
}

.wa-chat-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
}

.dump-viewer-tools .wa-chat-tools {
  display: contents;
}

.wa-chat-search-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
  grid-area: search;
  align-items: end;
  min-width: 0;
}

.wa-chat-search {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.wa-chat-search span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.wa-chat-search input {
  padding: 6px 8px;
  font-size: 0.86rem;
}

.wa-chat-match-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(44px, auto));
  align-items: center;
  align-self: end;
  gap: 3px 5px;
  justify-self: end;
}

.wa-chat-match-nav .tiny-button {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 0.68rem;
}

.wa-chat-match-nav span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1.05;
  margin: 0;
  text-align: right;
  white-space: nowrap;
}

.wa-chat-media-filters {
  grid-area: filters;
  max-height: none;
  overflow: visible;
}

.wa-chat-media-filters .dump-filter-pill {
  padding: 4px 7px;
  font-size: 0.68rem;
}

.wa-no-media-filters {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.dump-chat-viewer .wa-phone {
  display: flex;
  flex: 1;
  min-width: 0;
  max-width: none;
  min-height: 0;
  flex-direction: column;
  margin: 0;
}

.wa-phone {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #efe7dc;
}

.dump-chat-viewer .wa-chat {
  display: grid;
  align-content: start;
  gap: 8px;
  flex: 1;
  max-height: none;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px;
}

.wa-system-pill {
  justify-self: center;
  width: fit-content;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  padding: 5px 9px;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 800;
}

.wa-message-row {
  display: flex;
  min-width: 0;
}

.wa-message-row.out {
  justify-content: flex-end;
}

.wa-bubble {
  min-width: 0;
  max-width: min(82%, 680px);
  border: 1px solid rgba(23, 32, 42, 0.08);
  border-radius: 12px;
  background: #ffffff;
  padding: 9px 10px;
  box-shadow: 0 5px 18px rgba(23, 32, 42, 0.06);
  overflow-wrap: anywhere;
}

.wa-message-row.out .wa-bubble {
  background: #dcf8c6;
}

.wa-bubble p {
  margin: 0 0 6px;
  line-height: 1.42;
}

.wa-author {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 900;
}

.wa-meta {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  color: rgba(23, 32, 42, 0.56);
  font-family: var(--mono);
  font-size: 0.62rem;
}

.wa-muted-event {
  color: var(--muted);
  font-style: italic;
}

.wa-search-match .wa-bubble {
  box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.26), 0 10px 28px rgba(16, 24, 40, 0.08);
}

.wa-search-current .wa-bubble {
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.55), 0 12px 32px rgba(16, 24, 40, 0.12);
}

.wa-search-highlight {
  border-radius: 3px;
  background: #fde68a;
  color: #111827;
  padding: 0 2px;
}

.wa-media-link,
.wa-document {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  padding: 8px;
  text-decoration: none;
}

.wa-media-link img,
.wa-bubble video,
.wa-bubble audio {
  display: block;
  max-width: min(340px, 100%);
  border-radius: 8px;
}

.wa-missing-media {
  border-color: rgba(180, 35, 24, 0.28);
  background: #fff5f3;
  color: #7f1d1d;
}

.wa-missing-media span {
  color: #9f1239;
}

.wa-media-name {
  overflow-wrap: anywhere;
}

.wa-rich-block,
.wa-event-chip,
.wa-reaction,
.wa-quote {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background: rgba(232, 245, 242, 0.72);
  padding: 9px;
  margin-bottom: 7px;
}

.wa-rich-block strong,
.wa-event-chip,
.wa-reaction,
.wa-quote strong {
  overflow-wrap: anywhere;
}

.wa-rich-block span,
.wa-rich-block li,
.wa-quote span {
  color: var(--muted);
  font-size: 0.78rem;
}

.wa-quote {
  border-left: 3px solid #0f766e;
  background: rgba(255, 255, 255, 0.74);
}

.wa-rich-block ul {
  margin: 0;
  padding-left: 18px;
}

.wa-quote-reply-only span {
  font-style: italic;
}

.wa-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}

.wa-flag-badge {
  border: 1px solid rgba(15, 118, 110, 0.25);
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 700;
}

.wa-system-event {
  font-style: normal;
}

.wa-event-unsupported {
  border-color: rgba(180, 83, 9, 0.45) !important;
  background: rgba(254, 243, 199, 0.8) !important;
  color: #9a3412;
}

.wa-raw-debug {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.72rem;
}

.wa-raw-debug pre {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.wa-bubble a {
  color: #0f766e;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.dump-viewer-panel .payload-grid {
  margin-top: 12px;
}

@media (max-width: 1280px) {
  .dump-workspace {
    grid-template-columns: 1fr;
  }

  .dump-source-panel,
  .dump-chat-panel,
  .dump-viewer-panel {
    min-height: auto;
  }
}
