/* SKIAPI playground video — rc.44 design tokens, scoped to this injection layer.
 * All UI colors, font sizes, font families and corner radii consume runtime
 * tokens with standalone fallbacks; --radius follows data-theme-radius.
 * No React selectors, external assets, fonts or style mutations on native UI. */

.skiapi-pgv-icon { width: 16px; height: 16px; flex: none; pointer-events: none; }

/* A1/T2/G3: full-height right drawer, under native z-50 Dialog/Popover. */
.skiapi-pgv-veil {
  position: fixed;
  inset: 0;
  z-index: 44;
  background: rgba(0, 0, 0, .26);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: skiapi-pgv-fade 100ms ease-out;
}
.skiapi-pgv-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 45;
  width: min(620px, 100vw);
  height: 100vh;
  height: 100dvh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border, #e2e2e7);
  border-right: 0;
  border-radius: 0;
  background: var(--background, #fff);
  color: var(--foreground, #1c1c1e);
  box-shadow: -16px 0 36px rgba(0, 0, 0, .16);
  font-family: var(--font-body, sans-serif);
  font-size: var(--text-sm, 14px);
  line-height: 1.5;
  animation: skiapi-pgv-drawer 100ms ease-out;
}
.skiapi-pgv-panel *, .skiapi-pgv-panel *::before, .skiapi-pgv-panel *::after {
  box-sizing: border-box;
}
.skiapi-pgv-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: none;
  padding: 12px 16px;
  background: var(--background, #fff);
  border-bottom: 1px solid var(--border, #e2e2e7);
}
.skiapi-pgv-headings { flex: 1; min-width: 0; }
.skiapi-pgv-title { font-size: var(--text-sm, 14px); font-weight: 600; }
.skiapi-pgv-subtitle {
  margin-top: 2px;
  color: var(--muted-foreground, #6e6e73);
  font-size: var(--text-xs, 12px);
}
.skiapi-pgv-x, .skiapi-pgv-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md, calc(var(--radius, 1rem) * .8));
  background: transparent;
  color: var(--muted-foreground, #6e6e73);
  font: 500 var(--text-xs, 12px)/1.2 var(--font-body, sans-serif);
  cursor: pointer;
}
.skiapi-pgv-x:hover, .skiapi-pgv-copy:hover {
  background: var(--muted, #f5f5f7);
  color: var(--foreground, #1c1c1e);
}
.skiapi-pgv-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border, #e2e2e7) transparent;
}
.skiapi-pgv-row, .skiapi-pgv-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.skiapi-pgv-cols { display: flex; gap: 12px; }
.skiapi-pgv-col { flex: 1 1 0; }
.skiapi-pgv-label {
  color: var(--foreground, #1c1c1e);
  font-size: var(--text-sm, 14px);
  font-weight: 500;
}

/* A2/A3: native h-8, rounded-lg (default 16px), text-sm, bg-input/30. */
.skiapi-pgv-input, .skiapi-pgv-static {
  display: block;
  width: 100%;
  height: 32px;
  min-width: 0;
  padding: 4px 10px;
  border: 1px solid var(--input, #e2e2e7);
  border-radius: var(--radius-lg, var(--radius, 1rem));
  background: color-mix(in oklab, var(--input, #e2e2e7) 30%, transparent);
  color: var(--foreground, #1c1c1e);
  font: 400 var(--text-sm, 14px)/1.4 var(--font-body, sans-serif);
  outline: none;
  transition: border-color 100ms, box-shadow 100ms, background-color 100ms;
}
.skiapi-pgv-input::placeholder { color: var(--muted-foreground, #6e6e73); }
.skiapi-pgv-input:disabled { opacity: .5; cursor: not-allowed; }
.skiapi-pgv-prompt { min-height: 88px; max-height: 280px; padding: 8px 10px; resize: vertical; }
.skiapi-pgv-static { display: flex; align-items: center; color: var(--muted-foreground, #6e6e73); }
.skiapi-pgv-keyform { margin: 8px 0 0; }
.skiapi-pgv-advanced {
  border: 1px solid var(--border, #e2e2e7);
  border-radius: var(--radius-lg, var(--radius, 1rem));
  padding: 8px 10px;
  background: color-mix(in oklab, var(--background, #fff) 70%, transparent);
}
.skiapi-pgv-advanced summary {
  color: var(--muted-foreground, #6e6e73);
  font-size: var(--text-xs, 12px);
  cursor: pointer;
}
.skiapi-pgv-authstat, .skiapi-pgv-status {
  color: var(--muted-foreground, #6e6e73);
  font-size: var(--text-xs, 12px);
  overflow-wrap: anywhere;
}
.skiapi-pgv-authstat.err, .skiapi-pgv-status.err { color: var(--destructive, #c4320a); }
.skiapi-pgv-status.ok { color: var(--success, #1a7f37); }
.skiapi-pgv-status.warn { color: var(--warning, #9a6700); }
.skiapi-pgv-status { min-height: 18px; }

/* B4: self-contained ARIA combobox, same popover/list geometry as native. */
.skiapi-pgv-combo { position: relative; min-width: 0; }
.skiapi-pgv-combo-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  cursor: pointer;
}
.skiapi-pgv-combo-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skiapi-pgv-combo-trigger .skiapi-pgv-icon { color: var(--muted-foreground, #6e6e73); }
.skiapi-pgv-combo-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 3;
  max-height: 196px;
  padding: 4px;
  overflow-y: auto;
  border: 1px solid var(--border, #e2e2e7);
  border-radius: var(--radius-lg, var(--radius, 1rem));
  background: var(--popover, #fff);
  color: var(--popover-foreground, #1c1c1e);
  box-shadow: 0 12px 25px rgba(0, 0, 0, .15);
  font-size: var(--text-sm, 14px);
}
.skiapi-pgv-combo-option {
  padding: 7px 10px;
  border-radius: var(--radius-md, calc(var(--radius, 1rem) * .8));
  cursor: pointer;
  overflow-wrap: anywhere;
}
.skiapi-pgv-combo-option:hover, .skiapi-pgv-combo-option:focus,
.skiapi-pgv-combo-option[aria-selected='true'] {
  background: var(--muted, #f5f5f7);
  color: var(--foreground, #1c1c1e);
  outline: none;
}
.skiapi-pgv-combo-option[aria-disabled='true'] {
  opacity: .5;
  cursor: not-allowed;
}

.skiapi-pgv-actions, .skiapi-pgv-result-actions, .skiapi-pgv-history-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.skiapi-pgv-btn, .skiapi-pgv-fab, .skiapi-pgv-hint-btn, .skiapi-pgv-toast-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--border, #e2e2e7);
  border-radius: var(--radius-lg, var(--radius, 1rem));
  background: color-mix(in oklab, var(--input, #e2e2e7) 30%, transparent);
  color: var(--foreground, #1c1c1e);
  font: 500 var(--text-sm, 14px)/1.4 var(--font-body, sans-serif);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 100ms, box-shadow 100ms, transform 100ms;
}
.skiapi-pgv-btn:hover, .skiapi-pgv-fab:hover { background: var(--muted, #f5f5f7); }
.skiapi-pgv-btn:active, .skiapi-pgv-fab:active { transform: translateY(1px); }
.skiapi-pgv-btn:disabled { opacity: .5; cursor: not-allowed; }
.skiapi-pgv-btn-primary, .skiapi-pgv-hint-btn, .skiapi-pgv-toast-open {
  border-color: var(--primary, #3291ff);
  background: var(--primary, #3291ff);
  color: var(--primary-foreground, #fff);
}
.skiapi-pgv-btn-primary:hover:not(:disabled), .skiapi-pgv-hint-btn:hover,
.skiapi-pgv-toast-open:hover {
  background: color-mix(in oklab, var(--primary, #3291ff) 80%, transparent);
}
.skiapi-pgv-btn-small { height: 28px; padding: 0 10px; font-size: var(--text-xs, 12px); }
.skiapi-pgv-dl { color: var(--foreground, #1c1c1e); }
.skiapi-pgv-copy { width: 28px; height: 28px; }
.skiapi-pgv-bar {
  height: 4px;
  flex: none;
  overflow: hidden;
  border-radius: var(--radius-lg, var(--radius, 1rem));
  background: var(--muted, #f5f5f7);
}
.skiapi-pgv-bar > i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--primary, #3291ff);
  transition: width 400ms ease;
}

/* T5/T6: native video and metadata density; black is the media canvas, not UI chrome. */
.skiapi-pgv-out, .skiapi-pgv-history { flex-direction: column; gap: 10px; }
.skiapi-pgv-section-title { font-size: var(--text-sm, 14px); font-weight: 600; }
.skiapi-pgv-video, .skiapi-pgv-preview-video {
  display: block;
  width: 100%;
  max-height: 60vh;
  border-radius: var(--radius-md, calc(var(--radius, 1rem) * .8));
  background: #000;
  object-fit: contain;
}
.skiapi-pgv-metatext {
  color: var(--muted-foreground, #6e6e73);
  font-size: var(--text-xs, 12px);
  overflow-wrap: anywhere;
}
.skiapi-pgv-media-error {
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--destructive, #c4320a);
  border-radius: var(--radius-lg, var(--radius, 1rem));
  background: color-mix(in oklab, var(--destructive, #c4320a) 10%, var(--background, #fff));
  color: var(--destructive, #c4320a);
  font-size: var(--text-xs, 12px);
}
.skiapi-pgv-history {
  display: flex;
  padding-top: 14px;
  border-top: 1px solid var(--border, #e2e2e7);
}
.skiapi-pgv-history-head { display: flex; align-items: center; justify-content: space-between; }
.skiapi-pgv-history-list { display: flex; flex-direction: column; gap: 8px; font-size: var(--text-xs, 12px); }
.skiapi-pgv-history-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--border, #e2e2e7);
  border-radius: var(--radius-lg, var(--radius, 1rem));
  background: color-mix(in oklab, var(--background, #fff) 60%, transparent);
}
.skiapi-pgv-history-item:hover { background: var(--accent, #eef6ff); }
.skiapi-pgv-history-main { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.skiapi-pgv-history-id {
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--text-xs, 12px);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.skiapi-pgv-history-status { flex: none; color: var(--muted-foreground, #6e6e73); }
.skiapi-pgv-history-sub { color: var(--muted-foreground, #6e6e73); overflow-wrap: anywhere; }
.skiapi-pgv-foot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--border, #e2e2e7);
  padding-top: 12px;
  color: var(--muted-foreground, #6e6e73);
  font-size: var(--text-xs, 12px);
}
.skiapi-pgv-foot a { color: var(--primary, #3291ff); text-decoration: none; }
.skiapi-pgv-foot a:hover { text-decoration: underline; }

/* A4/A5/B2/B3/B5: compact native-outline entry and top-centred token-aware notices. */
.skiapi-pgv-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 42;
  background: var(--background, #fff);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}
.skiapi-pgv-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-height: 20px;
  margin-left: 6px;
  padding: 0 8px;
  border: 1px solid var(--border, #e2e2e7);
  border-radius: var(--radius-4xl, calc(var(--radius, 1rem) * 2.6));
  background: var(--secondary, #f5f5f7);
  color: var(--secondary-foreground, #1c1c1e);
  font: 500 var(--text-xs, 12px)/1.4 var(--font-body, sans-serif);
}
.skiapi-pgv-hint, .skiapi-pgv-toast {
  position: fixed;
  left: 50%;
  z-index: 42;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: min(720px, calc(100vw - 32px));
  padding: 10px 12px;
  border: 1px solid var(--border, #e2e2e7);
  border-radius: var(--radius-lg, var(--radius, 1rem));
  background: var(--popover, #fff);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .16);
  color: var(--popover-foreground, #1c1c1e);
  font: 400 var(--text-sm, 14px)/1.5 var(--font-body, sans-serif);
  transform: translateX(-50%);
}
.skiapi-pgv-hint { top: calc(var(--app-header-height, 3rem) + 12px); }
.skiapi-pgv-hint-text, .skiapi-pgv-toast > span { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.skiapi-pgv-hint-btn { flex: none; }
.skiapi-pgv-hint-x {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md, calc(var(--radius, 1rem) * .8));
  background: transparent;
  color: var(--muted-foreground, #6e6e73);
  cursor: pointer;
}
.skiapi-pgv-hint-x:hover { background: var(--muted, #f5f5f7); }
.skiapi-pgv-toast { top: 12px; z-index: 47; animation: skiapi-pgv-fade 100ms ease-out; }
.skiapi-pgv-toast.ok { border-color: var(--success, #1a7f37); }
.skiapi-pgv-toast.err { border-color: var(--destructive, #c4320a); }
.skiapi-pgv-toast.warn { border-color: var(--warning, #9a6700); }
.skiapi-pgv-toast-open { flex: none; }

/* Native dialog-style enlarged playback, still below rc.44 Dialog z-50. */
.skiapi-pgv-preview {
  position: fixed;
  inset: 0;
  z-index: 46;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, .35);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.skiapi-pgv-preview-content {
  width: min(960px, 100%);
  max-height: calc(100dvh - 32px);
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--border, #e2e2e7);
  border-radius: var(--radius-xl, calc(var(--radius, 1rem) * 1.4));
  background: var(--popover, #fff);
  box-shadow: 0 20px 30px rgba(0, 0, 0, .24);
  color: var(--popover-foreground, #1c1c1e);
  font: 500 var(--text-sm, 14px)/1.5 var(--font-body, sans-serif);
  animation: skiapi-pgv-dialog 100ms ease-out;
}
.skiapi-pgv-preview-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.skiapi-pgv-preview-video { max-height: min(70vh, 750px); }

.skiapi-pgv-panel :is(button, a, textarea, input, [role='option']):focus-visible,
.skiapi-pgv-fab:focus-visible, .skiapi-pgv-hint :is(button):focus-visible,
.skiapi-pgv-preview :is(button, video):focus-visible {
  outline: 1px solid var(--ring, #3291ff);
  outline-offset: 0;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring, #3291ff) 50%, transparent);
}

@keyframes skiapi-pgv-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes skiapi-pgv-drawer { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes skiapi-pgv-dialog { from { opacity: 0; scale: .95; } to { opacity: 1; scale: 1; } }

@media (max-width: 640px) {
  .skiapi-pgv-panel {
    top: auto;
    bottom: 0;
    width: 100vw;
    height: 85vh;
    height: 85dvh;
    border: 1px solid var(--border, #e2e2e7);
    border-bottom: 0;
    border-radius: var(--radius-xl, calc(var(--radius, 1rem) * 1.4)) var(--radius-xl, calc(var(--radius, 1rem) * 1.4)) 0 0;
    animation: skiapi-pgv-sheet 100ms ease-out;
  }
  .skiapi-pgv-body { padding: 12px 16px max(16px, env(safe-area-inset-bottom)); }
  .skiapi-pgv-fab { right: 12px; bottom: 24px; }
  .skiapi-pgv-hint { flex-wrap: wrap; top: calc(var(--app-header-height, 3rem) + 8px); }
  .skiapi-pgv-hint-text { flex-basis: 100%; }
  .skiapi-pgv-hint-btn { margin-left: auto; }
  .skiapi-pgv-input { font-size: max(var(--text-sm, 14px), 16px); }
}
@keyframes skiapi-pgv-sheet { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .skiapi-pgv-panel, .skiapi-pgv-veil, .skiapi-pgv-preview-content, .skiapi-pgv-toast { animation: none; }
  .skiapi-pgv-panel *, .skiapi-pgv-bar > i, .skiapi-pgv-fab { transition: none; }
}
