@import './prompt-column-manager.css';

.prompt-column-editor {box-sizing:border-box;width:100%;max-width:1840px;margin:auto;padding:20px 28px 30px;color:var(--ink,#ececef);container-type:inline-size;}
.prompt-column-editor a {color:inherit;text-decoration:none;}
.prompt-column-editor button {font:inherit;color:inherit;padding:9px 12px;border:0;border-radius:9px;background:#8882;cursor:pointer;transition:background 160ms ease,color 160ms ease,transform 160ms ease;}
.prompt-column-editor button:hover:not(:disabled) {background:#8883;}
.prompt-column-editor button.pc-primary {background:var(--accent,#e8cc62);color:#171711;}
.prompt-column-editor button.pc-primary:hover:not(:disabled) {background:var(--accent-hover,#e1c35b);}
.prompt-column-editor button:disabled {background:#8881;color:#85858a;opacity:.5;cursor:default;}
.prompt-column-editor :focus-visible {outline:2px solid var(--accent,#e8cc62);outline-offset:3px;}
.pce-toolbar {display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 0 20px;margin:0;}
.pce-toolbar-title {display:grid;gap:8px;min-width:0;}
.pce-toolbar-title a {font-size:14px;}
.pce-toolbar-title [role=status] {font-size:12px;color:var(--muted,#a6a6ad);line-height:1.5;}
.pce-toolbar > div:last-child {display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end;}
.pce-layout {display:grid;grid-template-columns:200px minmax(0,1fr) 320px;gap:22px;align-items:start;min-height:620px;position:relative;}
.pce-layout[data-preview-open=false],.pce-layout[data-preview-inline=false] {grid-template-columns:200px minmax(0,1fr);}
.pce-directory {position:sticky;top:16px;border-right:1px solid #8882;padding-right:18px;min-width:0;display:flex;flex-direction:column;max-height:calc(100dvh - 150px);gap:12px;}
.pce-directory > header,.pce-preview-pane > header,.pce-upload-queue > header,.pce-example-section > header {display:flex;align-items:center;justify-content:space-between;gap:10px;}
.pce-directory > header strong,.pce-preview-pane > header strong {font-size:13px;font-weight:600;}
.pce-directory-list {overflow-y:auto;overscroll-behavior:contain;min-height:60px;padding:3px 1px;scrollbar-width:thin;}
.pce-directory-count {font-size:11px;color:var(--muted,#8e8e96);}
.pce-directory-row {display:flex;align-items:center;gap:0;margin-bottom:5px;min-width:0;}
.pce-directory-row .pce-row-drag {padding:10px 2px;background:transparent;color:#888;cursor:grab;flex:none;}
.pce-directory-row .pce-row-select {display:flex;align-items:center;gap:8px;min-width:0;width:100%;text-align:left;padding:12px 8px;background:transparent;}
.pce-row-select[aria-current=true],.pce-overview[aria-current=true] {background:color-mix(in srgb,var(--accent,#e8cc62) 15%,transparent)!important;color:var(--accent,#e8cc62)!important;}
.pce-row-number {font-size:11px;color:var(--muted,#888);font-variant-numeric:tabular-nums;}
.pce-row-title {font-size:12px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;flex:1;}
.pce-row-flags {display:flex;gap:3px;font-size:9px;flex-shrink:0;}
.pce-row-flags i,.pce-row-flags b {font-weight:400;font-style:normal;background:#8881;padding:2px 3px;border-radius:4px;}
.pce-row-flags i {color:#bd9174;}
.pce-directory > footer {display:grid;grid-template-columns:1fr;gap:7px;margin-top:8px;}
.prompt-column-editor .pce-overview {text-align:left;padding:12px;font-size:13px;}
.pce-edit-pane {min-width:0;padding:5px 0;}
.pce-section-header {display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin:0 0 24px;}
.pce-section-header p {margin:0 0 8px;color:var(--muted,#93939a);font-size:11px;}
.pce-section-header h2 {font-size:22px;font-weight:550;line-height:1.4;margin:0;overflow-wrap:anywhere;}
.pce-section-header > span {font-size:12px;color:var(--muted,#999);white-space:nowrap;}
.pce-meta {display:grid;grid-template-columns:minmax(140px,190px) minmax(0,1fr);gap:24px;}
.pce-cover {display:flex;flex-direction:column;gap:10px;min-width:0;}
.pce-cover-crop {width:100%;aspect-ratio:4/3;background:#8881;border-radius:12px;overflow:hidden;display:grid;place-items:center;}
.pce-cover-crop img {width:100%;height:100%;object-fit:cover;object-position:center;}
.pce-cover-crop > span {color:var(--muted,#999);font-size:12px;}
.pce-cover > small {font-size:11px;color:var(--muted,#999);}
.pce-fields,.pce-entry {display:grid;gap:18px;min-width:0;}
.prompt-column-editor label {display:grid;gap:8px;color:var(--muted,#a8a8ae);font-size:12px;min-width:0;}
.prompt-column-editor input:not([type=checkbox]),.prompt-column-editor textarea,.prompt-column-editor select {box-sizing:border-box;width:100%;min-width:0;background:var(--panel,#8881);color:var(--ink,#eee);border:1px solid #8883;border-radius:9px;padding:11px;font:inherit;line-height:1.6;}
.prompt-column-editor textarea {resize:vertical;}
.pce-search input {padding:8px 10px!important;font-size:12px!important;}
.pce-inline,.pca-recommendation-fields {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;}
.pce-entry {border:0;padding:0;margin:0;background:none;}
.pce-entry .pce-section-header {margin-bottom:3px;}
.pce-check {display:flex!important;align-items:center;gap:7px!important;white-space:nowrap;}
.pce-check input {accent-color:var(--accent,#e8cc62);}
.pce-details {border-top:1px solid #8882;padding:16px 0 0;}
.pce-details summary {font-size:12px;color:var(--muted,#aaa);cursor:pointer;padding:3px 0;}
.pce-details[open] summary {margin-bottom:16px;color:var(--ink,#eee);}
.pce-entry-tools {display:flex;gap:7px;flex-wrap:wrap;border-top:1px solid #8882;padding-top:18px;}
.pce-entry-tools button {font-size:12px;}
.pce-entry-tools .pce-danger {margin-left:auto;color:#c89b90;}
.pce-upload {border:1px dashed #8885;border-radius:9px;padding:12px;cursor:pointer;display:grid!important;gap:8px!important;text-align:center;}
.pce-upload input {padding:6px!important;font-size:10px!important;}
.pce-example-section {display:grid;gap:14px;}
.pce-example-section h3 {margin:0;font-size:13px;font-weight:500;}
.pce-example-section small {color:var(--muted,#999);font-size:11px;}
.pce-examples {display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:16px;}
.pce-examples figure {margin:0;display:grid;gap:10px;min-width:0;align-content:start;}
.pce-examples img,.pce-examples video {width:100%;max-height:240px;object-fit:contain;border-radius:8px;background:#8881;}
.pce-preview-pane {position:sticky;top:16px;min-width:0;border-left:1px solid #8882;padding-left:20px;display:flex;flex-direction:column;max-height:calc(100dvh - 150px);}
.pce-preview-pane[hidden] {display:none;}
.pce-preview-pane > header {margin-bottom:16px;flex-shrink:0;}
.pce-preview-pane > header button {font-size:16px;line-height:1;padding:6px 9px;}
.pce-preview-pane [data-pce-preview] {overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;font-size:12px;line-height:1.7;}
.pce-preview-pane .pc-tabs {gap:5px;margin:0 0 16px;padding:0;justify-content:flex-start;}
.pce-preview-pane .pc-tabs button {padding:7px 9px;font-size:11px;}
.pce-preview-pane .pc-entry {padding:18px 0;border-top:1px solid #8882;}
.pce-preview-pane h2 {font-size:20px;line-height:1.45;overflow-wrap:anywhere;}
.pce-preview-pane h3 {font-size:13px;}
.pce-preview-pane .pc-entry pre {white-space:pre-wrap;overflow-wrap:anywhere;font-size:11px;}
.pce-preview-pane .pc-entry figure {margin:12px 0;}
.pce-preview-pane .pc-entry img,.pce-preview-pane .pc-entry video {max-width:100%;border-radius:8px;}
.pce-preview-pane .pc-parameters {display:grid;gap:7px;}
.pce-preview-pane .pc-parameters div {display:flex;justify-content:space-between;gap:10px;}
.pce-upload-queue:not(:empty) {margin-top:24px;background:#88808;border:1px solid #8882;border-radius:10px;padding:14px;font-size:12px;}
.pce-upload-queue header {font-size:11px;color:var(--muted,#999);}
.pce-upload-queue ul {list-style:none;margin:10px 0 0;padding:0;}
.pce-upload-queue li {display:flex;justify-content:space-between;gap:12px;padding:6px 0;}
.pce-upload-queue li > span {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.pce-upload-queue small {flex:none;color:var(--muted,#aaa);}
.pce-upload-queue [data-phase=failed],.pce-field-error {color:#ce9c90;}
.pce-notice {padding:14px 16px;border-radius:10px;background:#8881;color:var(--muted,#aaa);font-size:12px;line-height:1.7;}
.pce-notice button {margin-left:10px;}
.pce-empty {font-size:12px;color:var(--muted,#888);padding:14px 6px;}
.pce-mobile-only,.pce-directory-backdrop {display:none!important;}
.pce-sr-only {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}
.pce-review-dialog,.pce-import-dialog,.pce-preview-dialog {box-sizing:border-box;color:var(--ink,#eee);background:var(--bg,#101112);border:1px solid #8883;border-radius:18px;padding:28px;width:min(740px,calc(100vw - 28px));max-height:calc(100dvh - 50px);overflow:auto;}
.pce-review-dialog::backdrop,.pce-import-dialog::backdrop,.pce-preview-dialog::backdrop {background:#0009;backdrop-filter:blur(5px);}
.pce-review-dialog > h2 {font-size:22px;margin:0 0 20px;}
.pce-review-dialog > footer,.pca-import > footer {display:flex;justify-content:flex-end;gap:10px;margin-top:22px;}
.pce-preview-dialog {width:min(740px,calc(100vw - 28px));}
.pce-preview-dialog .pce-preview-pane {position:static;border:0;padding:0;max-height:none;}
.pce-preview-dialog [data-pce-preview] {overflow:visible;}
.pca-model-controls {display:grid;gap:16px;}
.pca-model-controls [hidden] {display:none!important;}
.pca-import {display:grid;gap:16px;}
.pca-import header {display:flex;justify-content:space-between;align-items:center;gap:20px;}
.pca-import header h2 {margin:0;font-size:22px;}
.pca-import textarea {min-height:200px;}
.pca-import ol {padding-left:24px;max-height:280px;overflow:auto;}
.pca-import li {padding:8px 0;line-height:1.7;}
.pca-import pre {white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;max-height:80px;overflow:auto;}
.pcr-section {font-size:13px;line-height:1.7;}
.pcr-section h3 {font-size:15px;}
.pcr-section ul {padding-left:20px;}
.pcr-section table {border-collapse:collapse;width:100%;font-size:12px;}
.pcr-section td,.pcr-section th {text-align:left;vertical-align:top;padding:10px;border-bottom:1px solid #8882;overflow-wrap:anywhere;}
@container (max-width: 1099px) {.pce-layout {grid-template-columns:200px minmax(0,1fr);}.pce-meta {grid-template-columns:1fr;}.pce-cover {max-width:280px;}}
@container (max-width: 1259px) {.pce-meta {grid-template-columns:1fr;}.pce-cover {max-width:280px;}}
@container (max-width: 759px) {
  .pce-layout,.pce-layout[data-preview-open=false],.pce-layout[data-preview-inline=false] {grid-template-columns:minmax(0,1fr);gap:0;min-height:560px;}
  .pce-mobile-only {display:inline-flex!important;}
  .pce-directory {position:absolute;top:0;left:0;z-index:7;width:min(270px,calc(100% - 30px));box-sizing:border-box;background:var(--bg,#101112);border:1px solid #8883;border-radius:12px;padding:18px;max-height:min(680px,calc(100dvh - 180px));box-shadow:0 18px 60px #0006;visibility:hidden;opacity:0;transform:translateX(-8px);transition:opacity 180ms ease,transform 180ms ease;pointer-events:none;}
  .pce-layout[data-directory-open=true] .pce-directory {visibility:visible;opacity:1;transform:none;pointer-events:auto;}
  .pce-layout[data-directory-open=true] .pce-directory-backdrop {display:block!important;position:absolute;inset:0;z-index:6;border:0;border-radius:0;background:#0005;cursor:default;}
  .pce-section-header {gap:10px;}.pce-section-header h2 {font-size:20px;}.pce-section-header > span {white-space:normal;}
  .pce-toolbar {align-items:flex-start;gap:12px;flex-direction:column;position:static;}.pce-toolbar > div:last-child {justify-content:flex-start;gap:6px;}
  .pce-toolbar button {font-size:12px;padding:8px 10px;}.pce-meta {grid-template-columns:1fr;}.pce-cover {max-width:320px;}
  .pce-inline,.pca-recommendation-fields {grid-template-columns:1fr;}.pce-check {font-size:11px!important;}
  .pce-entry-tools .pce-danger {margin-left:0;}.pce-review-dialog,.pce-import-dialog,.pce-preview-dialog {padding:20px;}
}
@media(max-width:740px){.prompt-column-editor{padding:16px;}}
@media(prefers-reduced-motion:reduce){.prompt-column-editor * {transition:none!important;scroll-behavior:auto!important;}}

.pce-media-failed {display:grid;place-items:center;align-content:center;gap:10px;min-height:100px;width:100%;height:100%;background:#8881;border-radius:10px;font-size:12px;color:var(--muted,#999);}
.pce-media-failed button {padding:6px 12px;font-size:11px;}
