/* TwinMoonTales v1.46.35 – scoped owner theme editor; no game layout selectors. */
.tmt-theme-admin{width:min(1800px,calc(100vw - 32px));height:calc(100vh - 40px);max-width:none;max-height:none;margin:auto;padding:0;border:1px solid rgba(196,171,235,.52);border-radius:14px;background:#171020;color:#eee8f7;box-shadow:0 28px 80px rgba(0,0,0,.68);overflow:hidden;font:14px Arial,sans-serif}
.tmt-theme-admin::backdrop{background:rgba(5,3,9,.78);backdrop-filter:blur(5px)}
.tmt-theme-admin form{display:grid;grid-template-rows:auto minmax(0,1fr) auto;height:100%;min-height:0;margin:0}
.tmt-theme-head,.tmt-theme-footer{display:flex;align-items:center;gap:12px;padding:12px 18px;background:rgba(48,31,66,.8)}
.tmt-theme-head{justify-content:space-between}.tmt-theme-head h2{margin:0;font-size:20px;color:inherit}.tmt-theme-footer p{margin:0 auto 0 0;min-width:0}.tmt-theme-footer button{flex-shrink:0}
.tmt-theme-layout{display:grid;grid-template-columns:minmax(280px,390px) minmax(0,1fr);min-height:0;overflow:hidden}
.tmt-theme-fields,.tmt-theme-preview{min-height:0;min-width:0;overflow:auto;padding:16px}
.tmt-theme-fields{border-right:1px solid rgba(196,171,235,.25)}
.tmt-theme-admin fieldset{min-width:0;margin:0 0 18px;padding:12px;border:1px solid rgba(196,171,235,.25);border-radius:8px}.tmt-theme-admin legend{padding:0 6px;font-weight:700}
.tmt-theme-admin label{display:grid;gap:5px;margin:0 0 10px;color:inherit;font-size:13px}.tmt-theme-admin p{font-size:13px;line-height:1.5}.tmt-theme-admin input,.tmt-theme-admin select,.tmt-theme-admin textarea{box-sizing:border-box;width:100%;max-width:100%;padding:7px;border:1px solid rgba(196,171,235,.4);border-radius:5px;background:#100b17;color:#f2edf7;font:inherit}.tmt-theme-admin textarea{min-height:80px;resize:vertical}.tmt-theme-admin input[type=color]{height:38px;padding:3px}.tmt-theme-admin input[type=file]{font-size:12px}
.tmt-theme-admin button{padding:8px 12px;border:1px solid rgba(196,171,235,.45);border-radius:6px;background:#30213e;color:#eee8f7;font:inherit;cursor:pointer}.tmt-theme-admin button:hover{background:#473154}.tmt-theme-admin button:focus-visible,.tmt-theme-admin input:focus-visible,.tmt-theme-admin select:focus-visible,.tmt-theme-admin textarea:focus-visible{outline:2px solid #b9a1ef;outline-offset:2px}.tmt-theme-admin button[aria-pressed=true]{background:#604576;border-color:#c8a4e5}.tmt-theme-admin :disabled{opacity:.6;cursor:default}
.tmt-theme-admin nav,#tmtThemeTargets{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px}.tmt-theme-asset{padding:10px 0;border-bottom:1px solid rgba(196,171,235,.16)}.tmt-theme-asset>span{display:block;overflow-wrap:anywhere;font-size:12px;margin-bottom:5px}
.tmt-theme-color-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}.tmt-theme-color-sample{padding:16px;border:1px solid rgba(255,255,255,.25);border-radius:5px}
.tmt-theme-stage{position:relative;box-sizing:border-box;width:100%;min-height:250px;overflow:hidden;border:1px solid rgba(196,171,235,.35);border-radius:8px;background:#0c0910 center/cover;touch-action:none;user-select:none}
.tmt-theme-art,.tmt-theme-box{position:absolute;box-sizing:border-box;cursor:move;outline:1px dashed rgba(255,255,255,.5)}.tmt-theme-art img{display:block;width:100%;height:100%;object-fit:fill;pointer-events:none}.tmt-theme-box{outline:1px dashed #e0bc72;background:rgba(224,188,114,.16)}.tmt-theme-box span{display:block;padding:3px;font-size:11px;font-weight:bold;line-height:1.2;color:white;text-shadow:0 1px 3px black;pointer-events:none}.tmt-theme-stage .is-selected{outline:2px solid #bba2ed;z-index:2}.tmt-theme-art.is-selected{z-index:1}.tmt-theme-stage i[data-resize]{display:none;position:absolute;right:-6px;bottom:-6px;width:14px;height:14px;border:1px solid #fff;border-radius:2px;background:#805ba2;cursor:nwse-resize}.tmt-theme-stage .is-selected>i[data-resize]{display:block}
.tmt-theme-geometry{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:12px 0}#tmtThemeValidation{color:#f0ce9c;min-height:20px}
@media(max-width:900px){.tmt-theme-layout{grid-template-columns:minmax(230px,35%) minmax(0,1fr)}.tmt-theme-geometry{grid-template-columns:1fr 1fr}.tmt-theme-fields,.tmt-theme-preview{padding:10px}.tmt-theme-footer{flex-wrap:wrap}.tmt-theme-footer p{flex-basis:100%}}

.tmt-theme-preview{display:flex;flex-direction:column}.tmt-theme-preview>nav,.tmt-theme-preview>p,.tmt-theme-preview>div,.tmt-theme-preview>button{flex-shrink:0}.tmt-theme-stage{align-self:center;flex:0 0 auto;width:min(100%,calc(max(230px,100vh - 500px) * var(--tmt-admin-stage-ratio,1.5)));min-height:0}

.tmt-theme-art{z-index:0}.tmt-theme-box{z-index:2}.tmt-theme-box.is-selected{z-index:3}

/* v1.46.37 – isolated full workspace preview above the draft editor. */
.tmt-theme-workspace-preview{width:calc(100vw - 16px);height:calc(100vh - 16px);max-width:none;max-height:none;padding:0;margin:auto;border:1px solid rgba(196,171,235,.52);border-radius:10px;background:#171020;color:#eee8f7;overflow:hidden;}
.tmt-theme-workspace-preview[open]{display:flex;flex-direction:column;}
.tmt-theme-workspace-preview::backdrop{background:rgba(5,3,9,.84);}
.tmt-theme-workspace-preview>header{display:flex;align-items:center;justify-content:space-between;gap:14px;flex:0 0 auto;padding:10px 16px;background:#30213e;font:14px Arial,sans-serif;}
.tmt-theme-workspace-preview header div{display:grid;gap:3px;}.tmt-theme-workspace-preview header span{font-size:12px;}
.tmt-theme-workspace-preview header button{padding:8px 12px;border:1px solid #9176aa;border-radius:6px;background:#30213e;color:#fff;font:inherit;cursor:pointer;}
#tmtWorkspacePreviewHost{flex:1 1 auto;min-height:0;}#tmtWorkspacePreviewHost iframe{display:block;width:100%;height:100%;border:0;background:#171020;}

/* v1.46.38 – fit the entire inspection workspace inside the available window. */
#tmtWorkspacePreviewHost{position:relative;overflow:hidden;background:#0c0910;}
.tmt-theme-workspace-preview>header{flex-wrap:wrap;}
.tmt-theme-workspace-preview header .tmt-workspace-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px;}
.tmt-workspace-actions label{display:flex;align-items:center;gap:6px;font:13px Arial,sans-serif;}
.tmt-workspace-actions select{padding:7px;border:1px solid #9176aa;border-radius:4px;background:#30213e;color:#fff;font:inherit;max-width:290px;}
.tmt-workspace-actions input[type=checkbox]{width:auto;}

/* Live placement uses the same fixed workspace and renderer as the saved theme. */
.tmt-workspace-live-controls{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:8px 16px;background:#20162b;font:13px Arial,sans-serif;flex-shrink:0;}
.tmt-workspace-live-controls[hidden]{display:none}.tmt-workspace-live-controls>span{flex-basis:100%}.tmt-workspace-live-controls label{display:flex;align-items:center;gap:6px}.tmt-workspace-live-controls input{width:94px;padding:5px;background:#100b17;color:#fff;border:1px solid #9176aa;border-radius:4px}.tmt-workspace-live-controls button{padding:6px;background:#30213e;color:#fff;border:1px solid #9176aa;border-radius:4px;cursor:pointer}

/* v1.46.41 – one editor: settings beside the real workspace. */
.tmt-theme-admin{width:calc(100vw - 16px);height:calc(100vh - 16px);}
.tmt-theme-layout{grid-template-columns:minmax(260px,320px) minmax(0,1fr);}
.tmt-theme-preview{padding:0;overflow:hidden;display:flex;flex-direction:column;}
#tmtThemeLegacyDetails[hidden]{display:none!important;}
#tmtThemeWorkspaceMount{flex:1 1 auto;min-height:0;width:100%;position:relative;}
.tmt-theme-workspace-preview.tmt-theme-workspace-embedded{position:relative;inset:auto;width:100%;height:100%;box-sizing:border-box;border:0;border-radius:0;margin:0;max-width:none;max-height:none;}
.tmt-theme-workspace-embedded[open]{display:flex;flex-direction:column;}
.tmt-theme-workspace-embedded header button[hidden]{display:none;}
.tmt-theme-workspace-embedded>header{padding:8px 10px;gap:6px;}
.tmt-theme-workspace-embedded .tmt-workspace-actions{gap:8px;}
.tmt-theme-workspace-embedded .tmt-workspace-live-controls{padding:8px 10px;gap:8px;}
.tmt-workspace-live-controls input[type=checkbox]{width:auto;}
.tmt-workspace-live-controls select{max-width:200px;padding:5px;background:#100b17;color:#fff;border:1px solid #9176aa;border-radius:4px;}
#tmtThemeValidation:empty{display:none;}#tmtThemeValidation{margin:0;padding:8px 12px;}
@media(max-width:900px){.tmt-theme-layout{grid-template-columns:240px minmax(0,1fr);}}

/* Palette controls stay in the theme settings panel. */
.tmt-theme-admin input[type=range]{padding:0;accent-color:#b9a1ef;cursor:pointer;}
.tmt-theme-admin output{font-variant-numeric:tabular-nums;color:#d7c5ed;}
.tmt-theme-color-actions{display:flex;flex-wrap:wrap;gap:6px;}

/* Native upload controls need room for Firefox's file-selector button. */
.tmt-theme-admin input[type=file]{display:block;width:100%;height:auto;min-height:46px;max-height:none;padding:6px;line-height:1.4;overflow:visible;}
.tmt-theme-admin input[type=file]::file-selector-button{height:auto;min-height:28px;max-height:none;margin:0 8px 0 0;padding:4px 8px;line-height:1.3;font:inherit;vertical-align:middle;}
.tmt-theme-asset>span{white-space:normal;overflow-wrap:anywhere;}

.tmt-theme-admin label[hidden]{display:none;}#tmtThemeOpacityLabel small{font-weight:400;line-height:1.4;color:#d7c5ed;}#tmtThemePickColorArea{width:100%;margin:6px 0 10px;}

/* v1.46.48 – document text options. */
#tmtThemeDocumentText .tmt-theme-text-toggle{display:flex;align-items:center;gap:8px;}
#tmtThemeDocumentText input[type=checkbox]{width:auto;flex:none;margin:0;}

/* v1.46.61 – independent, keyboard-accessible sections in the settings column. */
.tmt-theme-admin .tmt-theme-section{margin:0 0 12px;border:1px solid rgba(196,171,235,.25);border-radius:8px;min-width:0}
.tmt-theme-admin .tmt-theme-section>summary{padding:12px;cursor:pointer;font-weight:bold;color:#d7c5ed}
.tmt-theme-admin .tmt-theme-section>summary:focus-visible{outline:2px solid #b9a1ef;outline-offset:2px;border-radius:6px}
.tmt-theme-admin .tmt-theme-section>fieldset{border:0;margin:0;padding:0 12px 12px}
.tmt-theme-admin .tmt-theme-section-legend{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
