#moodboard-template-preview { border: 0; background: transparent; color: inherit; text-align: left; padding: 0; cursor: pointer; }
.picart-template-dialog { width: min(960px, calc(100vw - 64px)); max-height: calc(100vh - 64px); padding: 24px; border: 1px solid #ffffff24; border-radius: 24px; color: #f4f1fa; background: #211e2b; box-shadow: 0 20px 60px #0004; overflow-x: hidden; overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.picart-template-dialog.is-previewing { box-sizing: border-box; display: flex; flex-direction: column; height: min(760px, calc(100dvh - 64px)); overflow: hidden; }
.picart-template-dialog::-webkit-scrollbar, .picart-template-grid::-webkit-scrollbar { display: none; width: 0; height: 0; }
.picart-template-dialog::backdrop { background: #0008; }
.picart-template-dialog header { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 20px; }
.picart-template-dialog h2 { margin: 0; font-size: 22px; }
.picart-template-summary { margin: -8px 0 20px; color: #b8b0c4; font-size: 13px; }
.picart-template-dialog button { color: inherit; cursor: pointer; }
.picart-template-dialog header button { border: 0; border-radius: 20px; padding: 10px 18px; background: #9d78ed33; }
.picart-template-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 20px; }
.picart-template-grid > button { min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; }
.picart-template-reference-card { min-width: 0; }
.picart-template-reference-card > button:first-child { display: block; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; }
.picart-template-reference-card > button:first-child strong,.picart-template-reference-card > button:first-child span { display: block; margin-top: 8px; }
.picart-template-reference-card > button:first-child span { color: #b8b0c4; font-size: 12px; line-height: 1.4; }
.picart-template-card-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.picart-template-reference-card .picart-template-favorite { flex: none; min-height: 32px; padding: 5px 0; border: 0; background: transparent; font-size: 12px; }
.picart-template-reference-card .picart-template-open-editor { flex: none; min-height: 32px; padding: 6px 14px; border: 1px solid #b984ed88; border-radius: 10px; background: #8152b844; text-align: center; font-size: 12px; }
.picart-template-grid img { display: block; width: 100%; height: 190px; object-fit: contain; border-radius: 12px; background: #ffffff08; }
.picart-template-editable-card { display: grid!important; place-items: center; width: 100%; height: 190px; margin: 0!important; border: 1px solid #bd75ff66; border-radius: 12px; color: #fff; background: radial-gradient(circle at 42% 30%, #da66ff, transparent 52%), linear-gradient(145deg, #5d3b92, #211c35); font-size: 42px!important; opacity: 1!important; }
.picart-template-grid strong, .picart-template-grid span { display: block; margin-top: 8px; }
.picart-template-grid span { font-size: 12px; opacity: .7; }
.picart-template-grid.is-expanded { display: block; flex: 1; min-height: 0; }
.picart-template-grid.is-expanded .picart-template-reference-card > button:first-child { display: block; }
.picart-template-grid.is-expanded .picart-template-reference-card img { height: min(50dvh, 500px); }
.picart-template-grid.is-expanded .picart-template-card-actions { justify-content: flex-end; }
.picart-template-grid > [hidden] { display: none; }
.picart-template-grid.is-expanded > [hidden] { display: none; }
.picart-template-dialog.is-assigning { box-sizing: border-box; display: flex; flex-direction: column; width: min(1080px, calc(100vw - 48px)); height: min(800px, calc(100dvh - 48px)); overflow: hidden; }
.picart-template-dialog.is-assigning .picart-template-summary { flex: none; }
.picart-template-dialog.is-assigning .picart-template-grid[hidden] { display: none; }
.picart-template-assignment { display: grid; grid-template-columns: minmax(260px, 0.86fr) minmax(340px, 1.14fr); gap: 18px; min-height: 0; flex: 1; overflow: hidden; }
.picart-template-assignment[hidden] { display: none; }
.picart-template-assignment-list { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: none; }
.picart-template-assignment-list::-webkit-scrollbar, .picart-template-assignment-assets::-webkit-scrollbar { display: none; }
.picart-template-assignment-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 82px; margin-bottom: 8px; padding: 8px; border: 1px solid #a68cb34d; border-radius: 14px; background: #ffffff0a; text-align: left; }
.picart-template-assignment-row.is-active { border-color: #b984ed; }
.picart-template-assignment-row.is-selected { background: #a276d433; }
.picart-template-assignment-row img { width: 56px; height: 66px; flex: none; object-fit: contain; border-radius: 7px; background: #ffffff1a; }
.picart-template-assignment-row > span:nth-child(2) { min-width: 0; flex: 1; }
.picart-template-assignment-row strong, .picart-template-assignment-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picart-template-assignment-row strong { font-size: 13px; }
.picart-template-assignment-row small { margin-top: 5px; color: #b8b0c4; font-size: 11px; }
.picart-template-assignment-check { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border: 1px solid currentColor; border-radius: 50%; }
.picart-template-assignment-preview { display: grid; grid-template-rows: minmax(0, 1fr) 43px auto 40px; align-items: stretch; min-width: 0; min-height: 0; overflow: hidden; padding: 12px; border: 1px solid #a68cb34d; border-radius: 16px; background: #ffffff08; }
.picart-template-assignment-stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; contain: strict; color: #b8b0c4; text-align: center; }
.picart-template-assignment-stage canvas { position: absolute; left: 50%; top: 50%; display: block; width: 1px; height: 1px; max-width: calc(100% - 24px); max-height: calc(100% - 24px); transform: translate(-50%, -50%); box-shadow: 0 8px 30px #0004; }
.picart-template-assignment-assets { display: flex; gap: 5px; height: 43px; flex: none; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.picart-template-assignment-assets img { width: 38px; height: 38px; flex: none; object-fit: cover; border-radius: 5px; }
.picart-template-assignment-note { min-height: 32px; margin: 7px 0; color: #b8b0c4; font-size: 11px; line-height: 1.35; }
.picart-template-assignment-actions { display: flex; align-items: stretch; justify-content: flex-end; gap: 8px; min-width: 0; }
.picart-template-assignment-actions button { min-height: 40px; padding: 7px 14px; border-radius: 10px; white-space: nowrap; }
.picart-template-assignment-edit { border: 1px solid #b984ed88; background: #8152b844; }
.picart-template-assignment-apply { border: 0; background: #a86bea; color: #fff!important; }
.picart-template-assignment-actions button:disabled { opacity: .5; cursor: not-allowed; }
.picart-template-assignment-actions button:focus-visible { outline: 2px solid #b984ed; outline-offset: 2px; }
.picart-template-dialog.is-created-preview { box-sizing: border-box; display: flex; flex-direction: column; width: min(800px, calc(100vw - 48px)); height: min(660px, calc(100dvh - 48px)); overflow: hidden; }
.picart-template-dialog.is-created-preview .picart-template-grid[hidden],.picart-template-created[hidden] { display: none; }
.picart-template-created { display: flex; flex: 1 1 0; min-width: 0; min-height: 0; flex-direction: column; gap: 14px; overflow: hidden; }
.picart-template-created-stage { position: relative; flex: 1 1 0; min-width: 0; min-height: 0; overflow: hidden; contain: strict; border-radius: 14px; background: #ffffff0a; }
.picart-template-created-stage img { position: absolute; inset: 0; display: block; box-sizing: border-box; width: 100%; height: 100%; padding: 12px; object-fit: contain; object-position: center; }
.picart-template-created footer { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 16px; color: #b8b0c4; font-size: 13px; }
.picart-template-created-edit { min-width: 88px; min-height: 40px; padding: 8px 18px; border: 1px solid #b984ed88; border-radius: 10px; background: #8152b8; color: #fff!important; }
.picart-template-created-edit:focus-visible,.picart-template-dialog header button:focus-visible { outline: 2px solid #b984ed; outline-offset: 3px; }
@media (max-width: 720px) { .picart-template-assignment { grid-template-columns: minmax(130px, .8fr) minmax(180px, 1.2fr); gap: 8px; } .picart-template-assignment-row { gap: 6px; } .picart-template-assignment-row img { width: 38px; height: 48px; } }
body[data-appearance="light"] .picart-template-dialog, body.light .picart-template-dialog { color: #27232e; background: #faf9fc; }
body[data-appearance="light"] .picart-template-summary, body.light .picart-template-summary { color: #706879; }
body[data-appearance="light"] .picart-template-reference-card > button:first-child span, body.light .picart-template-reference-card > button:first-child span { color: #706879; }
body[data-appearance="light"] .picart-template-assignment-row small, body.light .picart-template-assignment-row small,
body[data-appearance="light"] .picart-template-assignment-stage, body.light .picart-template-assignment-stage,
body[data-appearance="light"] .picart-template-assignment-note, body.light .picart-template-assignment-note { color: #706879; }
@media (prefers-color-scheme: light) { .picart-template-dialog { color: #27232e; background: #faf9fc; } }
