/* Unified Fablun Studio Playground Kit stylesheet (monochrome light & dark) */

/* Global Playground mode tab strip: keep 3 modes cleanly on one line */
#root .p-console.p-customer .pg-page .pg-mode-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
}

#root .p-console.p-customer main .pg-page .pg-mode-tabs button {
  min-width: 0;
  min-height: 32px;
  padding: 0 7px;
  gap: 5px;
  font-size: 12px !important;
  white-space: nowrap;
}

#root .p-console.p-customer main .pg-page :is(.pg-h3ref-form, .pgk-form) .field :is(input, select) {
  height: 38px;
  min-height: 38px;
}

/* Shared form layout: strict vertical flex column prevents grid collision bugs */
#root .p-console.p-customer .pg-page :is(.pg-h3ref-form, .pgk-form) {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  gap: 0 !important;
  overflow: hidden !important;
}

#root .p-console.p-customer .pg-page :is(.pg-h3ref-form, .pgk-form) > .pg-editor-fields {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 0 !important;
  min-height: 0 !important;
  gap: 11px !important;
  padding: 15px 20px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(128, 130, 140, 0.35) transparent;
}

#root .p-console.p-customer .pg-page :is(.pg-h3ref-form, .pgk-form) .generation-main {
  display: flex !important;
  flex-direction: column !important;
  flex: none !important;
  gap: 11px !important;
  min-height: auto !important;
  height: auto !important;
  overflow: visible !important;
  padding: 0 !important;
  width: 100% !important;
}

#root .p-console.p-customer .pg-page :is(.pg-h3ref-form, .pgk-form) .generation-main > * {
  flex: none;
  min-width: 0;
  width: 100%;
  margin: 0;
}

#root .p-console.p-customer .pg-page :is(.pg-h3ref-form, .pgk-form) .generation-settings {
  display: flex !important;
  flex-direction: column !important;
  flex: none !important;
  gap: 11px !important;
  min-height: auto !important;
  height: auto !important;
  padding: 12px 0 0 !important;
  border-top: 1px solid var(--night-border, #e8e8e8) !important;
  width: 100% !important;
}

#root .p-console.p-customer .pg-page :is(.pg-h3ref-form, .pgk-form) .generation-settings > .field {
  min-width: 0;
  margin: 0;
}

/* Monochrome sub-mode pill switcher (精准替换 | 自由参考) */
#root .p-console.p-customer .pgk-subtabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--night-border, #e6e7e9);
  border-radius: 7px;
  background: var(--night-inset, #f4f4f5);
}

#root .p-console.p-customer .pgk-subtab {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--night-muted, #6b7280);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

#root .p-console.p-customer .pgk-subtab:hover:not(:disabled) {
  color: var(--night-text, #161822);
}

#root .p-console.p-customer .pgk-subtab.is-active {
  background: var(--night-surface, #ffffff);
  color: var(--night-text, #161822);
  box-shadow: 0 1px 3px rgba(17, 18, 22, 0.08);
}

#root .p-console.p-customer .pgk-subtab:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Paired Swap slots: [ 原视频 ] -> [ 替换图 ] */
#root .p-console.p-customer .pgk-swap-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

#root .p-console.p-customer .pgk-swap-arrow {
  display: grid;
  place-items: center;
  color: var(--night-subtle, #9ca3af);
}

#root .p-console.p-customer .pgk-swap-slot {
  position: relative;
  height: 106px;
  border: 1px dashed var(--night-border, #d4d6dc);
  border-radius: 8px;
  background: var(--night-raised, #fafafa);
  overflow: hidden;
  transition: border-color .15s ease, background .15s ease;
}

#root .p-console.p-customer .pgk-swap-slot.is-filled {
  border-style: solid;
  border-color: var(--night-border, #e2e4e8);
  background: #101114;
}

#root .p-console.p-customer .pgk-swap-slot.is-dragging,
#root .p-console.p-customer .pgk-swap-slot:not(.is-filled):hover {
  border-color: var(--night-muted, #8c919b);
  background: var(--night-inset, #f3f4f6);
}

#root .p-console.p-customer .pgk-slot-drop {
  width: 100%;
  height: 100%;
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--night-muted, #5d636e);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  cursor: pointer;
}

#root .p-console.p-customer .pgk-slot-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--night-surface, #ffffff);
  border: 1px solid var(--night-border, #e5e7eb);
  color: var(--night-muted, #525866);
}

#root .p-console.p-customer .pgk-slot-drop strong {
  font-size: 12px;
  font-weight: 500;
  color: var(--night-text, #2f333c);
}

#root .p-console.p-customer .pgk-slot-filled {
  position: relative;
  width: 100%;
  height: 100%;
}

#root .p-console.p-customer .pgk-slot-filled :is(video, img) {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#root .p-console.p-customer .pgk-corner-pill {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(15, 16, 20, 0.72);
  color: #ffffff;
  font-size: 10px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

#root .p-console.p-customer .pgk-remove-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 16, 20, 0.72);
  color: #ffffff;
  cursor: pointer;
}

#root .p-console.p-customer .pgk-remove-btn:hover:not(:disabled) {
  background: rgba(15, 16, 20, 0.92);
}

#root .p-console.p-customer .pgk-remove-btn.is-mini {
  top: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
}

#root .p-console.p-customer .pgk-add-corner-btn {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 5px;
  background: rgba(15, 16, 20, 0.72);
  color: #ffffff;
  cursor: pointer;
}

#root .p-console.p-customer .pgk-swap-img-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 2px;
  width: 100%;
  height: 100%;
  background: var(--night-border, #e5e7eb);
}

#root .p-console.p-customer .pgk-swap-cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #101114;
}

#root .p-console.p-customer .pgk-swap-cell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#root .p-console.p-customer .pgk-swap-cell-add {
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: var(--night-raised, #f3f4f6);
  color: var(--night-muted, #4b5563);
  cursor: pointer;
}

/* Unified Reference Dock (自由参考) */
#root .p-console.p-customer .pgk-ref-dock {
  border-radius: 8px;
}

#root .p-console.p-customer .pgk-ref-empty {
  width: 100%;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px dashed var(--night-border, #d4d6dc);
  border-radius: 8px;
  background: var(--night-raised, #fafafa);
  color: var(--night-muted, #525866);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

#root .p-console.p-customer .pgk-ref-dock.is-dragging .pgk-ref-empty,
#root .p-console.p-customer .pgk-ref-empty:hover:not(:disabled) {
  border-color: var(--night-muted, #8c919b);
  background: var(--night-inset, #f3f4f6);
}

#root .p-console.p-customer .pgk-ref-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#root .p-console.p-customer .pgk-ref-tile {
  position: relative;
  width: 74px;
  height: 74px;
  border: 1px solid var(--night-border, #e2e4e8);
  border-radius: 7px;
  overflow: hidden;
  background: #101114;
  flex: none;
}

#root .p-console.p-customer .pgk-ref-tile :is(img, video) {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#root .p-console.p-customer .pgk-tile-tag {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 1px 5px;
  border: 0;
  border-radius: 4px;
  background: rgba(15, 16, 20, 0.78);
  color: #ffffff;
  font: inherit;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
}

#root .p-console.p-customer .pgk-tile-tag.is-clickable {
  cursor: pointer;
}

#root .p-console.p-customer .pgk-tile-tag.is-clickable:hover:not(:disabled) {
  background: rgba(15, 16, 20, 0.96);
}

#root .p-console.p-customer .pgk-ref-add-tile {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--night-border, #d4d6dc);
  border-radius: 7px;
  background: var(--night-raised, #fafafa);
  color: var(--night-muted, #5d636e);
  cursor: pointer;
  flex: none;
}

#root .p-console.p-customer .pgk-ref-dock.is-dragging .pgk-ref-add-tile,
#root .p-console.p-customer .pgk-ref-add-tile:hover:not(:disabled) {
  border-color: var(--night-muted, #8c919b);
  background: var(--night-inset, #f3f4f6);
}

/* Prompt field & inline @token chips */
#root .p-console.p-customer .pgk-field-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#root .p-console.p-customer .pgk-form .generation-main > .pgk-prompt-field textarea {
  height: 92px !important;
  min-height: 84px !important;
  max-height: 220px;
  padding: 10px 12px !important;
  line-height: 1.65 !important;
  resize: vertical;
}

#root .p-console.p-customer .pgk-form .generation-main > .pgk-prompt-field.is-tall textarea {
  height: 132px !important;
  min-height: 112px !important;
}

#root .p-console.p-customer .pgk-token-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#root .p-console.p-customer .pgk-token-chip {
  padding: 2px 8px;
  border: 1px solid var(--night-border, #e2e4e8);
  border-radius: 5px;
  background: var(--night-inset, #f6f7f9);
  color: var(--night-text, #2f333c);
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}

#root .p-console.p-customer .pgk-token-chip:hover:not(:disabled) {
  border-color: var(--night-muted, #9ca3af);
}

/* Spec row + ratio pills + advanced */
#root .p-console.p-customer .pgk-spec-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px 12px;
  width: 100%;
}

#root .p-console.p-customer .pgk-spec-row.is-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#root .p-console.p-customer .pgk-spec-row > .field {
  min-width: 0;
  margin: 0;
}

#root .p-console.p-customer .pg-page .generation-settings .segmented.pg-ratio-options {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  border: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}

#root .p-console.p-customer .pg-page .pgk-ratio-field .pg-ratio-options > button {
  min-height: 32px !important;
  padding: 0 11px !important;
  border: 1px solid var(--night-border, #e2e4e8);
  border-radius: 6px;
  background: var(--night-inset, #f4f4f5);
  color: var(--night-muted, #6b7280);
}

#root .p-console.p-customer .pg-page .pgk-ratio-field .pg-ratio-options > button.selected {
  background: var(--night-surface, #ffffff);
  color: var(--night-text, #161822);
  border-color: var(--night-text, #161822);
  font-weight: 500;
}

#root .p-console.p-customer .pg-page :is(.pg-h3ref-form, .pgk-form) .pgk-advanced[open] {
  display: grid;
  gap: 10px;
}

#root .p-console.p-customer .pgk-advanced-body {
  display: grid;
  gap: 10px;
}

#root .p-console.p-customer .pgk-advanced-body .pg-compress-option {
  margin: 2px 0;
}

/* Sticky footer + conditional alert + router meta header */
#root .p-console.p-customer .pg-page :is(.pg-h3ref-form, .pgk-form) .pgk-footer {
  flex: none;
  gap: 8px;
  margin: 0;
  padding: 10px 20px max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--night-border, #e8e8e8);
  background: var(--night-surface, #ffffff);
}

/* Unified Generate CTA states: unmistakable disabled vs clickable hierarchy */
#root .p-console.p-customer .pg-page .pg-create-footer button.pg-create-button {
  height: 46px;
  min-height: 46px;
  border-radius: 8px;
  font-size: 14px;
  letter-spacing: -0.01em;
  transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .1s ease;
}

#root .p-console.p-customer .pg-page .pg-create-footer button.pg-create-button .pg-create-label {
  font-weight: 600;
}

#root .p-console.p-customer .pg-page .pg-create-footer button.pg-create-button:not(:disabled) {
  background: #14161a !important;
  border: 1px solid #14161a !important;
  color: #ffffff !important;
  opacity: 1 !important;
  cursor: pointer !important;
  box-shadow: 0 1px 2px rgba(14, 16, 22, 0.16), 0 4px 12px rgba(14, 16, 22, 0.08) !important;
}

#root .p-console.p-customer .pg-page .pg-create-footer button.pg-create-button:hover:not(:disabled) {
  background: #000000 !important;
  border-color: #000000 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22), 0 8px 18px rgba(0, 0, 0, 0.10) !important;
}

#root .p-console.p-customer .pg-page .pg-create-footer button.pg-create-button:active:not(:disabled) {
  background: #1e2128 !important;
  border-color: #1e2128 !important;
  transform: translateY(0.5px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14) !important;
}

#root .p-console.p-customer .pg-page .pg-create-footer button.pg-create-button:focus-visible:not(:disabled) {
  outline: 2px solid #14161a !important;
  outline-offset: 2px !important;
}

#root .p-console.p-customer .pg-page .pg-create-footer button.pg-create-button:not(:disabled) .pg-create-cost {
  border-left: 1px solid rgba(255, 255, 255, 0.22) !important;
  color: rgba(255, 255, 255, 0.88) !important;
}

#root .p-console.p-customer .pg-page .pg-create-footer button.pg-create-button:disabled,
#root .p-console.p-customer .pg-page .pg-create-footer button.pg-create-button:disabled:hover,
#root .p-console.p-customer .pg-page .pg-create-footer button.pg-create-button:disabled:focus {
  background: #eff0f3 !important;
  border: 1px solid #e2e4ea !important;
  color: #989da8 !important;
  opacity: 1 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
}

#root .p-console.p-customer .pg-page .pg-create-footer button.pg-create-button:disabled .pg-create-cost {
  border-left: 1px solid #d9dce3 !important;
  color: #a3a8b3 !important;
}

#root .p-console.p-customer .pgk-footer-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid #f59e0b66;
  border-radius: 6px;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
  line-height: 1.4;
}

#root .p-console.p-customer .pgk-footer-alert.is-error {
  border-color: rgba(220, 38, 38, 0.35);
  background: #fef2f2;
  color: #b91c1c;
}

#root .p-console.p-customer .pgk-footer-alert-btn {
  flex: none;
  padding: 3px 9px;
  border: 1px solid currentColor;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

#root .p-console.p-customer .pgk-router-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--night-border, #eceef2);
  border-radius: 6px;
  background: var(--night-inset, #f8f9fa);
  font-size: 12px;
  color: var(--night-muted, #62666d);
}

#root .p-console.p-customer .pgk-router-meta strong {
  color: var(--night-text, #22252b);
  font-weight: 500;
}

/* Router OutputStage extensions (balance chip, image preview, recent list) */
#root .p-console.p-customer .pgk-output-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#root .p-console.p-customer .pgk-balance-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--night-border, #e2e4e8);
  border-radius: 999px;
  background: var(--night-surface, #ffffff);
  color: var(--night-text, #2f333c);
  font: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

#root .p-console.p-customer .pgk-balance-chip span {
  color: var(--night-muted, #6b7280);
}

#root .p-console.p-customer .pgk-balance-chip:hover {
  border-color: var(--night-muted, #8c919b);
}

#root .p-console.p-customer .pgk-output-notice {
  margin: 14px 26px 0;
}

#root .p-console.p-customer .pg-video-stage.has-media {
  background: #0f1014 !important;
}

#root .p-console.p-customer .pg-video-stage.has-media::after {
  display: none !important;
}

#root .p-console.p-customer .pgk-stage-image {
  display: block;
  width: 100%;
  height: 100%;
  max-height: calc(100dvh - 140px);
  object-fit: contain;
  background: #0f1014;
}

#root .p-console.p-customer .pgk-cancel-inline {
  margin-top: 10px;
  min-height: 32px;
}

#root .p-console.p-customer .pgk-result-body {
  padding: 0 26px 18px;
}

#root .p-console.p-customer .pgk-recent {
  padding: 4px 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#root .p-console.p-customer .pgk-recent-head {
  font-size: 12px;
  font-weight: 500;
  color: var(--night-muted, #6b7280);
}

#root .p-console.p-customer .pgk-recent-list {
  display: grid;
  gap: 6px;
}

#root .p-console.p-customer .pgk-recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--night-border, #e5e7eb);
  border-radius: 7px;
  background: var(--night-surface, #ffffff);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

#root .p-console.p-customer .pgk-recent-item:hover,
#root .p-console.p-customer .pgk-recent-item.is-active {
  border-color: var(--night-text, #22252b);
}

#root .p-console.p-customer .pgk-recent-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

#root .p-console.p-customer .pgk-recent-main strong {
  font-size: 12px;
  font-weight: 500;
}

#root .p-console.p-customer .pgk-recent-main span {
  font-size: 11px;
  color: var(--night-muted, #6b7280);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#root .p-console.p-customer .pgk-recent-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font-size: 11px;
  color: var(--night-muted, #6b7280);
  font-variant-numeric: tabular-nums;
}

#root .p-console.p-customer .pgk-recent-status.is-succeeded { color: #16a34a; }
#root .p-console.p-customer .pgk-recent-status.is-failed,
#root .p-console.p-customer .pgk-recent-status.is-expired { color: #dc2626; }
#root .p-console.p-customer .pgk-recent-status.is-running,
#root .p-console.p-customer .pgk-recent-status.is-queued { color: #525866; }

#root .p-console.p-customer .pgk-router-state {
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--night-muted, #6b7280);
  font-size: 13px;
}

/* Dark theme monochrome parity */
html[data-preview-theme="dark"] #root .p-console.p-customer .pgk-subtabs {
  background: #111113;
  border-color: var(--night-border, #2b2b30);
}

html[data-preview-theme="dark"] #root .p-console.p-customer .pgk-subtab {
  color: var(--night-muted, #a5a5ae);
}

html[data-preview-theme="dark"] #root .p-console.p-customer .pgk-subtab.is-active {
  background: #2c2c33;
  color: #ffffff;
  box-shadow: none;
}

html[data-preview-theme="dark"] #root .p-console.p-customer .pgk-swap-slot,
html[data-preview-theme="dark"] #root .p-console.p-customer .pgk-ref-empty,
html[data-preview-theme="dark"] #root .p-console.p-customer .pgk-ref-add-tile,
html[data-preview-theme="dark"] #root .p-console.p-customer .pgk-swap-cell-add {
  background: var(--night-raised, #202023);
  border-color: #3a3a42;
}

html[data-preview-theme="dark"] #root .p-console.p-customer .pgk-swap-slot.is-filled,
html[data-preview-theme="dark"] #root .p-console.p-customer .pgk-ref-tile {
  border-color: var(--night-border, #2b2b30);
}

html[data-preview-theme="dark"] #root .p-console.p-customer .pgk-swap-slot.is-dragging,
html[data-preview-theme="dark"] #root .p-console.p-customer .pgk-swap-slot:not(.is-filled):hover,
html[data-preview-theme="dark"] #root .p-console.p-customer .pgk-ref-empty:hover:not(:disabled),
html[data-preview-theme="dark"] #root .p-console.p-customer .pgk-ref-add-tile:hover:not(:disabled) {
  background: #27272d;
  border-color: #555562;
}

html[data-preview-theme="dark"] #root .p-console.p-customer .pgk-slot-icon {
  background: #2c2c33;
  border-color: #3f3f48;
  color: #c7c7d1;
}

html[data-preview-theme="dark"] #root .p-console.p-customer .pgk-slot-drop strong,
html[data-preview-theme="dark"] #root .p-console.p-customer .pgk-router-meta strong {
  color: var(--night-text, #ededf0);
}

html[data-preview-theme="dark"] #root .p-console.p-customer .pgk-token-chip,
html[data-preview-theme="dark"] #root .p-console.p-customer .pgk-router-meta,
html[data-preview-theme="dark"] #root .p-console.p-customer .pgk-balance-chip,
html[data-preview-theme="dark"] #root .p-console.p-customer .pgk-recent-item {
  background: var(--night-raised, #202023);
  border-color: var(--night-border, #2b2b30);
  color: var(--night-text, #ededf0);
}

html[data-preview-theme="dark"] #root .p-console.p-customer .pg-page :is(.pg-h3ref-form, .pgk-form) .pgk-footer {
  background: var(--night-surface, #171719);
  border-color: var(--night-border, #2b2b30);
}

html[data-preview-theme="dark"] #root .p-console.p-customer .pg-page .pg-create-footer button.pg-create-button:not(:disabled) {
  background: #f2f2f5 !important;
  border: 1px solid #f2f2f5 !important;
  color: #111215 !important;
  opacity: 1 !important;
  cursor: pointer !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.36), 0 4px 12px rgba(0, 0, 0, 0.22) !important;
}

html[data-preview-theme="dark"] #root .p-console.p-customer .pg-page .pg-create-footer button.pg-create-button:hover:not(:disabled) {
  background: #ffffff !important;
  border-color: #ffffff !important;
  color: #09090b !important;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.12), 0 6px 16px rgba(0, 0, 0, 0.32) !important;
}

html[data-preview-theme="dark"] #root .p-console.p-customer .pg-page .pg-create-footer button.pg-create-button:active:not(:disabled) {
  background: #e2e3e8 !important;
  border-color: #e2e3e8 !important;
  transform: translateY(0.5px);
  box-shadow: none !important;
}

html[data-preview-theme="dark"] #root .p-console.p-customer .pg-page .pg-create-footer button.pg-create-button:focus-visible:not(:disabled) {
  outline: 2px solid #f2f2f5 !important;
  outline-offset: 2px !important;
}

html[data-preview-theme="dark"] #root .p-console.p-customer .pg-page .pg-create-footer button.pg-create-button:not(:disabled) .pg-create-cost {
  border-left: 1px solid rgba(17, 18, 21, 0.16) !important;
  color: rgba(17, 18, 21, 0.78) !important;
}

html[data-preview-theme="dark"] #root .p-console.p-customer .pg-page .pg-create-footer button.pg-create-button:disabled,
html[data-preview-theme="dark"] #root .p-console.p-customer .pg-page .pg-create-footer button.pg-create-button:disabled:hover,
html[data-preview-theme="dark"] #root .p-console.p-customer .pg-page .pg-create-footer button.pg-create-button:disabled:focus {
  background: #222227 !important;
  border: 1px solid #2e2e36 !important;
  color: #676975 !important;
  opacity: 1 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
}

html[data-preview-theme="dark"] #root .p-console.p-customer .pg-page .pg-create-footer button.pg-create-button:disabled .pg-create-cost {
  border-left: 1px solid #32323b !important;
  color: #5e606b !important;
}

html[data-preview-theme="dark"] #root .p-console.p-customer .pgk-footer-alert {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

html[data-preview-theme="dark"] #root .p-console.p-customer .pgk-footer-alert.is-error {
  background: rgba(220, 38, 38, 0.14);
  border-color: rgba(220, 38, 38, 0.45);
  color: #fca5a5;
}

/* Short viewports stay comfortable without crowding */
@media (max-height: 760px) {
  #root .p-console.p-customer .pgk-swap-slot {
    height: 92px;
  }
  #root .p-console.p-customer .pgk-form .generation-main > .pgk-prompt-field textarea {
    height: 80px !important;
    min-height: 72px !important;
  }
}

/* === Batch 1 Console UX, Billing Skeleton & Global Disabled Button Polish === */

/* Global monochrome disabled primary buttons (Light & Dark parity) */
#root .p-console.p-customer :is(button.button.primary, button.button.ink, button.pa-button.pa-primary):disabled,
#root .p-console.p-customer :is(button.button.primary, button.button.ink, button.pa-button.pa-primary):disabled:hover,
#root .p-console.p-customer :is(button.button.primary, button.button.ink, button.pa-button.pa-primary):disabled:focus {
  background: #eff0f3 !important;
  border-color: #e2e4ea !important;
  color: #989da8 !important;
  opacity: 1 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
}

html[data-preview-theme="dark"] #root .p-console.p-customer :is(button.button.primary, button.button.ink, button.pa-button.pa-primary):disabled,
html[data-preview-theme="dark"] #root .p-console.p-customer :is(button.button.primary, button.button.ink, button.pa-button.pa-primary):disabled:hover,
html[data-preview-theme="dark"] #root .p-console.p-customer :is(button.button.primary, button.button.ink, button.pa-button.pa-primary):disabled:focus {
  background: #222227 !important;
  border-color: #2e2e36 !important;
  color: #676975 !important;
  opacity: 1 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
}

/* Billing top-up selector: monochrome selected state & responsive layout */
#root .p-console.p-customer .customer-integrated-billing .ib-topup-options > button,
#root .p-console.p-customer .customer-integrated-billing .ib-custom-topup {
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

#root .p-console.p-customer .customer-integrated-billing .ib-topup-options > button.selected,
#root .p-console.p-customer .customer-integrated-billing .ib-custom-topup.selected,
#root .p-console.p-customer .customer-integrated-billing .ib-custom-topup:focus-within {
  background: #f8f9fb !important;
  border: 1px solid #14161a !important;
  box-shadow: inset 0 0 0 1px #14161a !important;
  color: #14161a !important;
}

#root .p-console.p-customer .customer-integrated-billing .ib-custom-topup > input {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0 !important;
  color: #14161a !important;
}

#root .p-console.p-customer .customer-integrated-billing .ib-custom-topup > input::placeholder {
  color: #9ca1ac;
}

#root .p-console.p-customer .customer-integrated-billing :is(.ib-tabs, .ib-overview-tabs, .preview-billing-tabs) > button.active {
  color: #14161a !important;
  border-bottom-color: #14161a !important;
}

html[data-preview-theme="dark"] #root .p-console.p-customer .customer-integrated-billing .ib-topup-options > button.selected,
html[data-preview-theme="dark"] #root .p-console.p-customer .customer-integrated-billing .ib-custom-topup.selected,
html[data-preview-theme="dark"] #root .p-console.p-customer .customer-integrated-billing .ib-custom-topup:focus-within {
  background: #2b2c33 !important;
  border: 1px solid #e6e7ec !important;
  box-shadow: inset 0 0 0 1px #e6e7ec !important;
  color: #f4f4f6 !important;
}

html[data-preview-theme="dark"] #root .p-console.p-customer .customer-integrated-billing .ib-custom-topup > input {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0 !important;
  color: #f4f4f6 !important;
}

html[data-preview-theme="dark"] #root .p-console.p-customer .customer-integrated-billing .ib-custom-topup > input::placeholder {
  color: #777a86;
}

html[data-preview-theme="dark"] #root .p-console.p-customer .customer-integrated-billing :is(.ib-tabs, .ib-overview-tabs, .preview-billing-tabs) > button.active {
  color: #f4f4f6 !important;
  border-bottom-color: #f4f4f6 !important;
  background: transparent !important;
}

html[data-preview-theme="dark"] #root .p-console.p-customer .customer-integrated-billing .ib-rate-cell.selected {
  background: #2b2c33 !important;
  border-color: #e6e7ec !important;
}

@media (max-width: 1120px) {
  #root .p-console.p-customer .customer-integrated-billing .ib-topup-options {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  #root .p-console.p-customer .customer-integrated-billing .ib-custom-topup {
    grid-column: 1 / -1;
    min-width: 0;
  }
}

@media (max-width: 600px) {
  #root .p-console.p-customer .customer-integrated-billing .ib-topup-options {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Billing progressive loading skeletons */
@keyframes ibSkelPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

#root .p-console.p-customer .ib-skeleton-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#root .p-console.p-customer .ib-skeleton-card {
  padding: 18px 20px;
  border: 1px solid var(--night-border, #e6e8ec);
  border-radius: 10px;
  background: var(--night-surface, #ffffff);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#root .p-console.p-customer .ib-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 1120px) {
  #root .p-console.p-customer .ib-skeleton-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

#root .p-console.p-customer .ib-skeleton-bar,
#root .p-console.p-customer .ib-skeleton-tile {
  border-radius: 6px;
  background: #eceef2;
  animation: ibSkelPulse 1.35s ease-in-out infinite;
}

#root .p-console.p-customer .ib-skeleton-bar {
  height: 14px;
}

#root .p-console.p-customer .ib-skeleton-tile {
  height: 52px;
}

#root .p-console.p-customer .ib-skeleton-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

html[data-preview-theme="dark"] #root .p-console.p-customer .ib-skeleton-card {
  background: var(--night-surface, #171719);
  border-color: var(--night-border, #2b2b30);
}

html[data-preview-theme="dark"] #root .p-console.p-customer .ib-skeleton-bar,
html[data-preview-theme="dark"] #root .p-console.p-customer .ib-skeleton-tile {
  background: #25262d;
}

@media (prefers-reduced-motion: reduce) {
  #root .p-console.p-customer .ib-skeleton-bar,
  #root .p-console.p-customer .ib-skeleton-tile {
    animation: none;
  }
}

#root .p-console.p-customer .pv-api-step-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
