/* Viral — TikTok posts & animated previews from your paintings */

#panel-viral.panel[hidden] { display: none !important; }

#panel-viral.panel.active {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 8rem);
  max-height: calc(100dvh - 8rem);
  overflow: hidden;
  padding: 0;
  margin: 0;
}

body.vi-tab-active #panel-viral.panel.active {
  min-height: calc(100dvh - 5.5rem);
  max-height: calc(100dvh - 5.5rem);
}

body.vi-tab-active .site-footer,
body.vi-tab-active .site-header .subtitle { display: none; }

.vi-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse 110% 80% at 50% -10%, #1a0a1e 0%, #08060c 45%, #000 100%);
}

.vi-top {
  flex: 0 0 auto;
  padding: 0.5rem 0.75rem 0.35rem;
  border-bottom: 1px solid rgba(255, 80, 120, 0.2);
}

.vi-top h2 {
  margin: 0 0 0.15rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  background: linear-gradient(90deg, #ff6b9d, #c8a8ff, #60d8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.vi-hint {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.vi-hint strong { color: #ffb8d0; font-weight: 600; }

.vi-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(10rem, 13rem) minmax(0, 1fr);
  gap: 0.55rem;
  padding: 0.5rem 0.65rem 0;
  overflow: hidden;
}

.vi-sidebar {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-right: 0.2rem;
}

.vi-section-label {
  margin: 0.15rem 0 0;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 140, 180, 0.7);
}

.vi-topics {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.vi-topic {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  padding: 0.35rem 0.45rem;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 100, 150, 0.14);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.68rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.vi-topic:hover {
  border-color: rgba(255, 120, 170, 0.35);
  background: rgba(40, 10, 30, 0.4);
}

.vi-topic.active {
  border-color: rgba(255, 100, 160, 0.55);
  background: rgba(80, 20, 50, 0.35);
  color: #ffd0e0;
}

.vi-topic-label { font-weight: 600; color: #ffb0cc; }

.vi-topic-hint {
  font-size: 0.58rem;
  opacity: 0.75;
  line-height: 1.3;
}

.vi-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.vi-chip {
  padding: 0.18rem 0.42rem;
  font-size: 0.62rem;
  border: 1px solid rgba(200, 120, 255, 0.2);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-muted);
  cursor: pointer;
}

.vi-chip.active {
  border-color: rgba(255, 120, 180, 0.5);
  background: rgba(255, 80, 140, 0.15);
  color: #ffd8e8;
}

.vi-btn {
  padding: 0.35rem 0.55rem;
  font-size: 0.68rem;
  border: 1px solid rgba(180, 120, 255, 0.22);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.32);
  color: var(--text-muted);
  cursor: pointer;
}

.vi-btn:hover:not(:disabled) {
  border-color: rgba(255, 120, 180, 0.4);
  color: #ffe0ee;
}

.vi-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.vi-btn.accent {
  border-color: rgba(255, 90, 150, 0.45);
  background: linear-gradient(135deg, rgba(255, 60, 120, 0.25), rgba(180, 80, 255, 0.2));
  color: #ffe8f2;
  font-weight: 500;
}

.vi-featured-wrap { margin-top: 0.2rem; }

.vi-featured {
  min-height: 4.5rem;
  padding: 0.35rem;
  background: rgba(0, 0, 0, 0.3);
  border: 2px dashed rgba(255, 100, 160, 0.28);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.vi-featured.drop-active {
  border-color: rgba(255, 120, 200, 0.65);
  background: rgba(60, 15, 40, 0.35);
}

.vi-featured-empty {
  margin: 0;
  font-size: 0.62rem;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.75;
}

.vi-featured-card {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
}

.vi-featured-card img {
  width: 3rem;
  height: 3rem;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid rgba(255, 120, 180, 0.3);
}

.vi-featured-meta {
  flex: 1;
  min-width: 0;
  font-size: 0.62rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.vi-featured-meta strong {
  display: block;
  color: #ffc8dc;
  font-size: 0.68rem;
}

.vi-featured-rm {
  border: none;
  background: transparent;
  color: rgba(255, 150, 180, 0.8);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.2rem;
}

.vi-main {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(14rem, 0.85fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0.65rem;
  overflow: hidden;
}

.vi-boards-col {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 0.3rem;
}

.vi-boards-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.45rem;
  align-content: start;
  padding-right: 0.15rem;
}

.vi-board {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.4rem;
  border: 1px solid rgba(255, 100, 150, 0.16);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.28);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.vi-board:hover {
  border-color: rgba(255, 120, 180, 0.35);
}

.vi-board.active {
  border-color: rgba(255, 120, 180, 0.62);
  box-shadow: 0 0 0 1px rgba(255, 140, 190, 0.22);
  background: rgba(50, 12, 32, 0.42);
}

.vi-board.forging {
  border-color: rgba(232, 200, 120, 0.45);
}

.vi-board.done {
  border-color: rgba(120, 220, 160, 0.35);
}

.vi-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.vi-board-title {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  color: #ffd0e4;
}

.vi-board-status {
  font-size: 0.52rem;
  padding: 0.1rem 0.32rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 140, 190, 0.2);
  color: var(--text-muted);
}

.vi-board-status.done { color: #9ad8b0; border-color: rgba(120, 220, 160, 0.35); }
.vi-board-status.forging { color: #e8c878; border-color: rgba(232, 200, 120, 0.35); }
.vi-board-status.error { color: #ff9eb8; }

.vi-board-chain {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  overflow-x: auto;
  padding-bottom: 0.1rem;
}

.vi-board-step {
  flex: 0 0 auto;
  position: relative;
  width: 3.5rem;
  border: 1px solid rgba(255, 120, 180, 0.18);
  border-radius: calc(var(--radius) - 2px);
  background: rgba(0, 0, 0, 0.35);
  padding: 0.12rem;
}

.vi-board-step.swap-target,
.vi-board-step:hover {
  border-color: rgba(255, 160, 210, 0.55);
}

.vi-board-step img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 3px;
  display: block;
}

.vi-board-step-op {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.48rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #ff9ec0;
  font-weight: 600;
}

.vi-board-step-num {
  display: block;
  font-size: 0.48rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vi-board-step-swap {
  position: absolute;
  top: 0.1rem;
  right: 0.1rem;
  width: 1rem;
  height: 1rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #ffd8ea;
  font-size: 0.58rem;
  line-height: 1;
  cursor: pointer;
}

.vi-board-fused {
  margin: 0;
  max-height: 3.2rem;
  overflow: auto;
  font-size: 0.52rem;
  line-height: 1.35;
  color: rgba(200, 180, 220, 0.88);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, Consolas, monospace;
}

.vi-board-preview {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 5.5rem;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid rgba(255, 120, 180, 0.22);
}

.vi-board-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.vi-board-actions .vi-btn {
  flex: 1 1 auto;
  font-size: 0.58rem;
  padding: 0.22rem 0.35rem;
}

.vi-slider-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.62rem;
  color: var(--text-muted);
}

.vi-slider-row input[type="range"] {
  flex: 1 1 5rem;
  accent-color: #ff6b9d;
}

.vi-pipeline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.vi-pipe-step {
  padding: 0.15rem 0.38rem;
  font-size: 0.58rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 100, 150, 0.15);
  color: var(--text-muted);
}

.vi-pipe-step.active {
  border-color: rgba(255, 120, 180, 0.55);
  background: rgba(255, 80, 140, 0.18);
  color: #ffd8e8;
}

.vi-pipe-step.done {
  border-color: rgba(120, 220, 160, 0.35);
  color: #b8f0d0;
}

.vi-status {
  margin: 0.2rem 0 0;
  font-size: 0.62rem;
  color: var(--text-muted);
  min-height: 1.2rem;
  line-height: 1.35;
}

.vi-status.ok { color: #9ad8b0; }
.vi-status.error { color: #ff9eb8; }
.vi-status.pending { color: #e8c878; }

.vi-chain-col,
.vi-feed-col {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.vi-feed-col {
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  padding: 0.15rem 0.25rem;
}

.vi-chain {
  flex: 0 1 auto;
  max-height: 9rem;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.35rem;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 100, 160, 0.14);
  border-radius: var(--radius);
}

.vi-chain-empty {
  margin: 0;
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.8;
}

.vi-chain-step {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  width: 4.2rem;
}

.vi-chain-step img {
  width: 3.6rem;
  height: 3.6rem;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid rgba(255, 120, 180, 0.28);
}

.vi-chain-meta {
  text-align: center;
  font-size: 0.52rem;
  line-height: 1.25;
  color: var(--text-muted);
  max-width: 4.2rem;
}

.vi-chain-op {
  display: block;
  color: #ff9ec0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.vi-chain-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vi-chain-arrow {
  flex: 0 0 auto;
  color: rgba(255, 140, 180, 0.55);
  font-size: 0.9rem;
  padding: 0 0.1rem;
}

.vi-fused {
  flex: 1 1 auto;
  min-height: 4rem;
  max-height: 8rem;
  margin: 0;
  overflow: auto;
  padding: 0.4rem 0.45rem;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(180, 120, 255, 0.14);
  border-radius: var(--radius);
  font-size: 0.58rem;
  line-height: 1.4;
  color: rgba(200, 180, 220, 0.9);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}

/* TikTok-style centered vertical feed */
.vi-feed-stage {
  --feed-h: min(calc(100dvh - 24rem), 28rem);
  position: relative;
  flex: 1 1 auto;
  width: min(100%, calc(var(--feed-h) * 9 / 16 + 1.8rem));
  max-width: 24rem;
  min-height: 0;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vi-feed-viewport {
  position: relative;
  height: var(--feed-h);
  width: calc(var(--feed-h) * 9 / 16);
  max-width: 100%;
  margin: 0 auto;
  border-radius: 1.15rem;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 0 0 1px rgba(255, 80, 140, 0.22),
    0 16px 48px rgba(0, 0, 0, 0.6),
    inset 0 0 40px rgba(255, 60, 120, 0.05);
  background: #000;
}

.vi-feed-track {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
}

.vi-feed-track::-webkit-scrollbar {
  display: none;
}

.vi-feed-slide {
  position: relative;
  height: 100%;
  min-height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

.vi-feed-slide video,
.vi-feed-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.vi-feed-slide.is-pending::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.55));
  pointer-events: none;
}

.vi-feed-slide.is-failed::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(80, 0, 20, 0.25), rgba(0, 0, 0, 0.65));
  pointer-events: none;
}

.vi-feed-retry {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  transform: translate(-50%, -50%);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 140, 190, 0.55);
  background: rgba(20, 0, 12, 0.82);
  color: #ffd8ea;
  font-size: 0.62rem;
  font-weight: 600;
  cursor: pointer;
}

.vi-variant-card.is-failed {
  opacity: 0.55;
  border-color: rgba(255, 90, 120, 0.45);
}

.vi-feed-empty {
  padding: 1.25rem;
  text-align: center;
}

.vi-feed-empty p {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.vi-feed-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 3;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.vi-feed-poster.is-hidden {
  opacity: 0;
  z-index: 1;
}

.vi-feed-slide video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  background: #000;
}

.vi-feed-slide video:not(.is-playing) {
  opacity: 0;
}

.vi-feed-slide video.is-playing {
  opacity: 1;
}

.vi-feed-label {
  position: absolute;
  left: 0.55rem;
  bottom: 0.55rem;
  z-index: 4;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 140, 190, 0.35);
  font-size: 0.58rem;
  font-weight: 600;
  color: #ffd8ea;
  letter-spacing: 0.03em;
}

.vi-feed-meta {
  position: absolute;
  left: 0.55rem;
  top: 0.55rem;
  z-index: 4;
  padding: 0.15rem 0.38rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  font-size: 0.52rem;
  color: rgba(255, 220, 235, 0.9);
}

.vi-feed-spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 140, 190, 0.25);
  border-top-color: #ff8cb8;
  animation: vi-spin 0.9s linear infinite;
}

@keyframes vi-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.vi-feed-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}

.vi-feed-rail {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  z-index: 6;
  pointer-events: none;
}

.vi-feed-dot {
  width: 0.34rem;
  height: 0.34rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(255, 140, 190, 0.25);
  transition: transform 0.15s, background 0.15s;
}

.vi-feed-dot.active {
  transform: scale(1.35);
  background: #ff8cb8;
  border-color: rgba(255, 200, 220, 0.8);
}

.vi-feed-badge {
  position: absolute;
  top: 0.45rem;
  right: 0.15rem;
  z-index: 6;
  padding: 0.12rem 0.34rem;
  font-size: 0.52rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 120, 180, 0.35);
  border-radius: 999px;
  color: #ffb8d0;
  pointer-events: none;
}

.vi-feed-scroll-hint {
  margin: 0;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 140, 180, 0.75);
  text-align: center;
}

.vi-variants {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.1rem 0.15rem 0.2rem;
  min-height: 4.8rem;
  width: 100%;
  max-width: 22rem;
  justify-content: flex-start;
  scroll-snap-type: x proximity;
}

.vi-variant-card {
  flex: 0 0 auto;
  width: 3.8rem;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.2rem;
  border: 1px solid rgba(255, 100, 150, 0.16);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.28);
  cursor: pointer;
  text-align: center;
}

.vi-variant-card.active {
  border-color: rgba(255, 120, 180, 0.6);
  background: rgba(80, 20, 50, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 140, 190, 0.25);
}

.vi-variant-card.is-pending {
  opacity: 0.55;
  pointer-events: none;
}

.vi-variant-thumb {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
  background: #111;
}

.vi-variant-label {
  font-size: 0.52rem;
  color: #ffd0e4;
  line-height: 1.2;
}

.vi-variant-meta {
  font-size: 0.48rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.vi-upload-hint {
  margin: 0;
  font-size: 0.56rem;
  color: var(--text-muted);
  line-height: 1.35;
  opacity: 0.85;
}

.vi-history {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.vi-history-empty {
  margin: 0;
  font-size: 0.62rem;
  color: var(--text-muted);
  opacity: 0.75;
}

.vi-history-card {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0.3rem;
  align-items: center;
  padding: 0.28rem;
  text-align: left;
  border: 1px solid rgba(255, 100, 150, 0.12);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.22);
  cursor: pointer;
  color: var(--text-muted);
}

.vi-history-card:hover {
  border-color: rgba(255, 120, 180, 0.35);
}

.vi-history-card img {
  width: 2.2rem;
  height: 2.2rem;
  object-fit: cover;
  border-radius: 4px;
}

.vi-history-hook {
  font-size: 0.58rem;
  line-height: 1.3;
  color: #ffd0e4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vi-topics-compact .vi-topic {
  padding: 0.28rem 0.38rem;
}

.vi-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: center;
  width: 100%;
  max-width: 22rem;
}

.vi-export-status {
  margin: 0;
  font-size: 0.6rem;
  color: var(--text-muted);
  text-align: center;
  min-height: 1rem;
}

.vi-detail-col {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.vi-detail {
  flex: 0 0 auto;
  padding: 0.45rem 0.5rem;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 100, 160, 0.18);
  border-radius: var(--radius);
  margin-bottom: 0.35rem;
}

.vi-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.vi-detail-format {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ff9ec0;
}

.vi-detail-score {
  font-size: 0.58rem;
  color: #e8c878;
  font-variant-numeric: tabular-nums;
}

.vi-detail-hook {
  margin: 0 0 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffe8f4;
  line-height: 1.35;
}

.vi-detail-caption {
  margin: 0 0 0.25rem;
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.45;
  white-space: pre-wrap;
}

.vi-detail-sound {
  margin: 0 0 0.2rem;
  font-size: 0.62rem;
  color: rgba(200, 168, 255, 0.85);
}

.vi-detail-tags {
  margin: 0;
  font-size: 0.62rem;
  color: #9ad8ff;
  line-height: 1.5;
  word-break: break-word;
}

.vi-detail-paintings {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.35rem;
}

.vi-detail-paintings img {
  width: 2.4rem;
  height: 2.4rem;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(255, 120, 180, 0.25);
}

.vi-tray { flex: 0 0 auto; }

#panel-viral .st-spell.vi-spell { border-color: rgba(255, 100, 160, 0.28); }

@media (max-width: 900px) {
  .vi-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .vi-sidebar { max-height: 12rem; }
  .vi-main {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .vi-boards-grid {
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  }
  .vi-feed-viewport {
    --feed-h: min(calc(100dvh - 18rem), 26rem);
    max-width: 100%;
  }
  .vi-feed-rail,
  .vi-feed-badge {
    display: none;
  }
}

body.vi-tab-active .vi-feed-stage {
  --feed-h: min(calc(100dvh - 22rem), 30rem);
}

.vi-studio {
  grid-column: 1 / -1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.35rem 0.4rem 0.15rem;
  border-top: 1px solid rgba(255, 100, 160, 0.22);
}

.vi-studio-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.vi-studio-row select,
.vi-studio-row input[type="number"] {
  background: rgba(0, 0, 0, 0.35);
  color: #ffe8f4;
  border: 1px solid rgba(255, 120, 180, 0.35);
  border-radius: var(--radius);
  padding: 0.2rem 0.35rem;
  font-size: 0.68rem;
}

.vi-studio-row input[type="number"] { width: 3.2rem; }

.vi-file-btn { display: inline-flex; align-items: center; }
.vi-file-btn input { display: none; }

.vi-seq {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  max-height: 6.5rem;
  overflow-y: auto;
}

.vi-seq-empty {
  margin: 0;
  font-size: 0.62rem;
  color: var(--text-muted);
}

.vi-seq-item {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr) auto auto auto;
  gap: 0.28rem;
  align-items: center;
}

.vi-seq-thumb {
  width: 1.6rem;
  height: 1.6rem;
  object-fit: cover;
  border-radius: 3px;
  background: #111;
}

.vi-seq-thumb-empty { display: block; border: 1px solid rgba(255, 120, 180, 0.25); }

.vi-seq-label {
  min-width: 0;
  font-size: 0.62rem;
  color: #ffd0e4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vi-seq-label small {
  display: block;
  color: var(--text-muted);
  font-size: 0.56rem;
}

.vi-seq-item .vi-btn { padding: 0.18rem 0.35rem; font-size: 0.58rem; }