.modal.character-editor-modal { width: min(1080px,100%); max-width: 1080px; height: min(820px,92dvh); max-height: 92dvh; display: flex; flex-direction: column; overflow: hidden; }
.character-editor-modal>.modal-head { flex: none; padding: 18px 24px; }
.character-editor-modal>.modal-body { flex: 1; min-height: 0; padding: 0; overflow: hidden; }
#card-form[data-character-editor] { height: 100%; display: flex; flex-direction: column; }
.card-editor-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 280px minmax(0,1fr); }
.card-editor-preview-side { min-height: 0; overflow: auto; padding: 24px 22px; background: rgba(8,7,14,.4); border-right: 1px solid var(--border-subtle); }
.card-editor-preview-side>.eyebrow { display: block; font-size: 8px; letter-spacing: 1.7px; color: #8e719f; margin-bottom: 16px; }
.card-live-preview { position: relative; aspect-ratio: 3/4; overflow: hidden; border: 1px solid color-mix(in srgb,var(--editor-tint,#a855f7) 40%,transparent); border-radius: 16px; background: #15121e; box-shadow: 0 10px 35px #0004; }
.editor-portrait { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.editor-symbol { position: absolute; inset: 0 0 35%; display: grid; place-items: center; color: color-mix(in srgb,var(--editor-tint,#a855f7) 65%,#d8b4fe); }
.editor-symbol .icon { width: 50px; height: 50px; stroke-width: 1; }
.editor-symbol .custom-symbol { font-size: 42px; }
.editor-preview-shade { position: absolute; inset: 0; background: linear-gradient(180deg,transparent 18%,#08070e30 40%,#08070eea 85%,#08070e); }
.editor-preview-tags { position: absolute; left: 13px; right: 13px; top: 13px; display: flex; gap: 5px; flex-wrap: wrap; }
.editor-preview-tags span { border: 1px solid #ffffff1c; border-radius: 8px; background: #08070e8c; color: #d8c3e8; font-size: 9px; padding: 3px 7px; max-width: 100%; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.editor-preview-copy { position: absolute; inset: auto 0 0; padding: 17px; }
.editor-preview-copy h3 { font-size: 23px; color: #f3f4f6; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; white-space: normal; overflow-wrap: anywhere; margin: 0 0 5px; }
.editor-preview-subtitle { color: #c8b5d6; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.editor-preview-summary { font-size: 11px; line-height: 1.75; color: #aaa0b5; margin-top: 9px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.editor-preview-credit { display: block; color: #86728f; font-size: 9px; border-top: 1px solid #ffffff12; padding-top: 10px; margin-top: 14px; }
.editor-cover-actions { display: flex; justify-content: space-between; gap: 7px; margin-top: 16px; }
.editor-cover-actions .btn { font-size: 11px; padding: 7px 10px; }
.editor-cover-note { color: #8d819e; font-size: 10px; line-height: 1.8; margin-top: 12px; }
.card-editor-fields { min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.card-editor-tabs { flex: none; display: flex; padding: 13px 20px; gap: 7px; border-bottom: 1px solid var(--border-subtle); background: #11101a; }
.card-editor-tabs button { flex: 1; border-radius: 12px; min-height: 38px; padding: 7px 10px; font-size: 12px; color: #a99bb9; white-space: nowrap; }
.card-editor-tabs button>span { font-size: 9px; color: #7f698f; margin-right: 7px; }
.card-editor-tabs button.active { color: #f3e8ff; background: #a855f71c; box-shadow: inset 0 0 0 1px #a855f733; }
.card-editor-tabs button.active>span { color: #c084fc; }
.card-editor-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 25px; }
.card-editor-panel[hidden] { display: none!important; }
.editor-section-title { margin-bottom: 22px; }
.editor-section-title h3 { font-size: 19px; margin: 0 0 7px; }
.editor-section-title p { font-size: 11px; color: #9e8caf; line-height: 1.8; }
.card-editor-panel .form-grid { gap: 18px; }
.card-editor-panel .stack { gap: 21px; }
.card-editor-panel textarea { min-height: 95px; max-height: 350px; }
.card-editor-panel textarea[name="opening_narrative"] { color: var(--text-narrative); font-style: italic; border-left: 2px solid #a855f780; }
.editor-publish { margin-top: 22px; }
.editor-basic-info { margin-top: 22px; }
.modal.text-import-modal { width: min(1100px,100%); max-width: 1100px; }
.text-import-pane { min-width: 0; color: var(--text-main); }
.text-import-pane>details,.text-import-pane>[data-ti-history],.text-import-pane>[data-ti-progress] { margin-bottom: 20px; }
.text-import-pane summary { cursor: pointer; padding-block: 10px; font-weight: 600; }
.text-import-pane textarea,.text-import-pane input,.text-import-pane select { max-width: 100%; min-width: 0; }
.text-import-pane textarea { font-family: inherit; line-height: 1.7; resize: vertical; }
.text-import-pane input[type=file] { width: 100%; white-space: normal; overflow: hidden; }
.text-import-targets { display: flex; flex-wrap: wrap; gap: 16px; margin-block: 14px; }
.text-import-targets label { display: flex; align-items: center; gap: 6px; }
.text-import-targets input,.text-import-draft-row>input { width: auto; }
.text-import-heading { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.text-import-heading strong { overflow-wrap: anywhere; }
.text-import-pane progress { display: block; width: 100%; height: 12px; margin-top: 12px; accent-color: var(--brand-primary); }
.text-import-pane [hidden] { display: none!important; }
.text-import-drafts { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 20px; min-width: 0; }
.text-import-draft-list { min-width: 0; }
.text-import-draft-row { display: flex; align-items: flex-start; gap: 8px; border: 1px solid var(--border-subtle); border-radius: 10px; margin-bottom: 8px; padding: 10px; }
.text-import-draft-row button { min-width: 0; flex: 1; text-align: left; padding: 0; }
.text-import-draft-row strong,.text-import-draft-row small { display: block; overflow-wrap: anywhere; }
.text-import-draft-row button[aria-pressed=true] { color: var(--theme-accent); }
.text-import-editor { min-width: 0; }
.text-import-editor fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 15px; }
.text-import-editor .field { display: flex; flex-direction: column; min-width: 0; gap: 7px; }
.text-import-editor textarea { width: 100%; }
.text-import-sources section { padding: 10px 12px; background: var(--theme-muted-surface); border: 1px solid var(--border-subtle); border-radius: 10px; margin-bottom: 10px; }
.text-import-sources p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.text-import-warnings { color: var(--theme-warning-text); padding-left: 22px; overflow-wrap: anywhere; }
.text-import-events { padding-left: 22px; font-size: 13px; color: var(--text-sub); }
.text-import-pane .row { align-items: flex-start; }
@media(max-width:767px) {
 .text-import-drafts { grid-template-columns: minmax(0,1fr); gap: 12px; }
 .text-import-draft-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 5px; max-width: 100%; }
 .text-import-draft-row { flex: 0 0 190px; }
 .text-import-pane .form-grid { grid-template-columns: minmax(0,1fr); }
 .text-import-pane .btn { white-space: normal; min-height: 38px; }
}
.editor-inspiration { border: 1px solid #a855f729; background: #a855f708; padding: 13px 15px; border-radius: 12px; margin-bottom: 24px; }
.editor-inspiration summary { color: #d8b4fe; font-size: 12px; cursor: pointer; }
.editor-inspiration summary .icon { width: 14px; height: 14px; vertical-align: -2px; margin: 0 5px; }
.editor-inspiration p { color: #9b89ab; font-size: 11px; line-height: 1.8; margin: 12px 0; }
.editor-inspiration>div { display: flex; gap: 7px; flex-wrap: wrap; }
.editor-inspiration .btn { font-size: 11px; }
#editor-preset-status { display: block; margin-top: 9px; color: #c2a4d9; font-size: 10px; }
.editor-world-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 13px; }
.editor-world-heading h3 { font-size: 14px; margin: 0; }
.editor-world-heading small { font-size: 10px; }
.editor-world-list { display: grid; gap: 9px; }
.editor-world-option { display: flex; gap: 11px; align-items: center; border: 1px solid var(--border-subtle); padding: 12px; border-radius: 12px; background: #08070e44; cursor: pointer; }
.editor-world-option:has(input:checked) { border-color: var(--border-glow); background: #a855f70d; }
.editor-world-option input { margin: 0; }
.editor-world-option .avatar { width: 32px; height: 32px; }
.editor-world-option strong { display: block; font-size: 12px; font-weight: 550; }
.editor-world-option small { display: block; font-size: 10px; color: #9586a5; margin-top: 4px; line-height: 1.7; }
.editor-world-option.unavailable { opacity: .7; }
.editor-world-empty { color: #9b89ab; font-size: 12px; line-height: 1.9; border: 1px dashed #ffffff14; border-radius: 12px; padding: 22px; }
.card-editor-footer { display: flex; align-items: center; gap: 10px; padding: 15px 24px; flex: none; border-top: 1px solid var(--border-subtle); background: #11101a; }
.card-editor-footer small { font-size: 10px; color: #9582a5; }
.card-editor-footer .form-error { font-size: 11px; margin-top: 4px; }
.card-editor-footer .btn { flex: none; font-size: 12px; }
@media(max-width:760px){
 .modal.character-editor-modal { height: 94dvh; max-height: 94dvh; }
 .character-editor-modal>.modal-head { padding: 13px 16px; }
 .card-editor-layout { grid-template-columns: minmax(0,1fr); overflow: auto; display: block; }
 .card-editor-preview-side { overflow: visible; padding: 17px; border-right: 0; border-bottom: 1px solid var(--border-subtle); display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 10px 16px; align-items: start; }
 .card-editor-preview-side>.eyebrow { grid-column: 2; margin: 3px 0 0; font-size: 8px; line-height: 1.7; }
 .card-live-preview { grid-column: 1; grid-row: 1/4; width: 120px; }
 .editor-preview-copy { padding: 10px; }
 .editor-preview-copy h3 { font-size: 16px; }
 .editor-preview-subtitle { font-size: 8px; }
 .editor-preview-summary { font-size: 8px; line-height: 1.5; -webkit-line-clamp: 1; line-clamp: 1; margin-top: 5px; }
 .editor-preview-credit { display: none; }
 .editor-preview-tags { left: 8px; top: 8px; gap: 3px; }
 .editor-preview-tags span { padding: 2px 4px; font-size: 7px; }
 .editor-symbol .icon { width: 30px; height: 30px; }
 .editor-cover-actions { grid-column: 2; margin: 0; flex-wrap: wrap; justify-content: flex-start; }
 .editor-cover-actions .btn { min-height: 31px; font-size: 10px; padding: 6px 8px; }
 .editor-cover-note { grid-column: 2; margin: 0; font-size: 9px; line-height: 1.7; }
 .card-editor-fields { display: block; }
 .card-editor-tabs { position: sticky; top: 0; z-index: 3; padding: 10px 12px; gap: 5px; }
 .card-editor-tabs button { font-size: 11px; padding: 7px 5px; min-height: 35px; }
 .card-editor-tabs button>span { margin-right: 4px; font-size: 8px; }
 .card-editor-scroll { overflow: visible; padding: 18px 16px 24px; }
 .card-editor-panel .form-grid { grid-template-columns: minmax(0,1fr); gap: 17px; }
 .editor-section-title h3 { font-size: 17px; }
 .card-editor-footer { padding: 12px 14px; gap: 7px; flex-wrap: wrap; }
 .card-editor-footer>.grow { flex-basis: 100%; }
 .card-editor-footer>.btn { min-height: 35px; padding: 7px 12px; font-size: 11px; }
 .card-editor-footer>.btn.ghost { margin-left: auto; }
}
@media(max-width:760px) and (max-height:700px){
 .card-editor-preview-side { padding: 12px 16px; grid-template-columns: 90px minmax(0,1fr); }
 .card-live-preview { width: 90px; }
 .editor-preview-copy h3 { font-size: 13px; }
 .editor-preview-subtitle { display: none; }
 .card-editor-footer { padding: 8px 12px; }
 .card-editor-tabs { padding-block: 7px; }
}
.card-classification-fields { display:grid; gap:14px; min-width:0; }
.card-classification-group { border:0; padding:0; margin:0; min-width:0; }
.card-classification-group legend { padding:0; margin-bottom:8px; color:var(--text-main); font-size:12px; font-weight:600; }
.card-classification-options { display:flex; flex-wrap:wrap; gap:8px; }
.card-classification-option { display:inline-flex; align-items:center; gap:6px; min-height:36px; max-width:100%; padding:7px 10px; border:1px solid var(--control-border); border-radius:9px; background:var(--bg-card); color:var(--text-muted); font-size:12px; line-height:1.4; cursor:pointer; transition:background .16s,border-color .16s,color .16s; }
.card-classification-option input[type="checkbox"] { width:14px; height:14px; min-width:14px; margin:0; accent-color:var(--accent-readable); cursor:pointer; }
.card-classification-option:hover, .card-classification-option:has(input:checked) { background:var(--accent-soft); border-color:var(--accent-border); color:var(--accent-readable); }
.card-classification-option:focus-within { outline:2px solid var(--focus-ring); outline-offset:2px; }
.editor-preview-tags .editor-preview-classification { border-color:var(--accent-border); background:var(--accent-soft); color:var(--accent-readable); }
