/* A readable authoring workspace layered over the existing F8 controls. */
.worldContentEditorPanel.worldEditorExpanded{left:12px!important;top:12px!important;right:12px!important;bottom:12px!important;transform:none!important}
.worldEditorExpanded #worldEditorSessionToolbar{display:grid;grid-template-columns:1fr 1fr;gap:8px;font-size:11px}.worldEditorExpanded #worldEditorSessionToolbar>label:has(#worldEditorAuthor){display:none}.worldEditorExpanded #worldEditorModeHelp{grid-column:1}.worldEditorExpanded #worldEditorSessionStatus{grid-column:1/-1}.worldEditorExpanded .worldEditorShopDetails{grid-column:1/-1;border:1px solid #506479;border-radius:7px;padding:12px}.worldEditorShopDetails summary{cursor:pointer;font-weight:600}.worldEditorShopDetails[open]>label{display:block;margin:10px 0}.worldEditorExpanded #worldEditorQuestSection{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(300px,1fr);gap:20px}.worldEditorExpanded #worldEditorQuestSection>.worldEditorSectionHead,.worldEditorExpanded #worldEditorSaveQuest,.worldEditorExpanded #worldEditorQuestDeleteBlock{grid-column:1/-1}.worldEditorQuestMain,.worldEditorQuestRewards{display:grid;align-content:start;gap:12px}.worldEditorExpanded .worldEditorQuestRewards{background:#1b2c3e;border:1px solid #516b85;border-radius:9px;padding:16px}.worldEditorFooter>button{justify-self:end;grid-column:2;grid-row:1/3}.worldEditorFooter:has(>button:not([hidden])){grid-template-columns:1fr auto}.worldEditorFooter>button[hidden]{display:none}.worldEditorExpanded #worldEditorVendorStock .worldEditorStockRow input[type=checkbox]{min-height:20px}.worldEditorExpanded .worldEditorWorkspace{scroll-padding-top:15px}.worldEditorExpanded .worldEditorStockHeader{display:none}.worldEditorShopDetails{grid-column:1/-1}@media(max-width:850px){.worldEditorExpanded #worldEditorQuestSection{grid-template-columns:1fr}.worldEditorExpanded #worldEditorSessionToolbar{grid-template-columns:1fr}.worldEditorExpanded #worldEditorModeHelp{display:none}}
.worldContentEditorPanel.worldEditorRefined.worldEditorExpanded{position:fixed;inset:12px;z-index:180;width:calc(100vw - 24px);height:calc(100dvh - 24px);max-height:none;max-width:none;font-size:14px;padding:18px}
.worldEditorExpanded .worldEditorBrowser,.worldEditorExpanded .worldEditorNavigationLegend{display:none}
.worldEditorExpanded .worldEditorWorkspace{flex:1;min-height:0;overflow:auto}
.worldEditorExpanded .worldEditorSection{padding:20px!important}
.worldEditorExpanded .worldEditorSectionHead strong{font-size:17px!important}
.worldEditorExpanded .worldEditorSectionHead small{font-size:13px!important}
.worldEditorExpanded .worldEditorSection :is(input,select,textarea){font-size:14px;min-height:36px}
.worldEditorExpanded .worldEditorSection textarea{min-height:85px}
.worldEditorExpanded #worldEditorVendorSection{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.worldEditorExpanded #worldEditorVendorSection>.worldEditorSectionHead,.worldEditorExpanded #worldEditorVendorStock,.worldEditorExpanded #worldEditorSaveVendor{grid-column:1/-1}
.worldEditorExpanded .worldEditorFooter{padding:10px 15px;background:#172536;border:1px solid #8294a466;border-radius:8px;flex-shrink:0}
.worldEditorExpanded .worldEditorPanelStatus{font-size:14px}
.worldEditorExpanded .worldEditorTaskRow{grid-template-columns:150px minmax(180px,1fr) 90px 40px}
.worldEditorExpanded .worldEditorRewardRow{grid-template-columns:minmax(250px,1fr) 110px 40px}
@media(max-width:750px){.worldContentEditorPanel.worldEditorRefined.worldEditorExpanded{inset:5px;width:calc(100vw - 10px);height:calc(100dvh - 10px);padding:10px}.worldEditorExpanded #worldEditorVendorSection{grid-template-columns:1fr}.worldEditorExpanded .worldEditorTaskRow{grid-template-columns:1fr 1fr}}
.worldContentEditorPanel.worldEditorRefined {
  --editor-border: #354357;
  --editor-muted: #acbdd1;
  --editor-accent: #b7d8f5;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(454px, 47%);
  height: calc(100% - 24px);
  max-height: min(860px, calc(100dvh - 24px));
  min-height: 0;
  overflow: hidden;
  padding: 12px;
  border: 1px solid #657b96;
  border-radius: 15px;
  background: linear-gradient(145deg, #172131fa, #101722fc 68%);
  box-shadow: 0 20px 65px #0009, inset 0 1px #dceaff12;
  color: #eef3fc;
  font: 12px/1.45 system-ui, sans-serif;
  color-scheme: dark;
}
.worldContentEditorPanel.worldEditorRefined.hidden { display: none; }
body:has(#worldContentEditorPanel:not(.hidden)) #wizardAudioControls,
body:has(#worldEditorPasswordDialog[open]) #wizardAudioControls { visibility: hidden; pointer-events: none; }
.worldEditorRefined *, .worldEditorPasswordDialog * { box-sizing: border-box; }
.worldEditorRefined .worldEditorPageHidden { display: none !important; }
.worldEditorRefined .worldContentEditorHeader {
  flex: 0 0 auto;
  gap: 8px;
  padding: 0 0 10px;
  border-color: var(--editor-border);
}
.worldEditorRefined .worldContentEditorHeader .eyebrow { color: #a3bcda; font-size: 9px; letter-spacing: .14em; }
.worldEditorRefined .worldContentEditorHeader strong { font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.worldEditorRefined .worldContentEditorHeader small { color: var(--editor-muted); font-size: 10px; overflow-wrap: anywhere; }
.worldEditorRefined .worldEditorHeaderActions { display: flex; gap: 5px; }
.worldEditorRefined :is(button, input, select, textarea):focus-visible,
#worldEditorPasswordDialog :is(button, input):focus-visible { outline: 2px solid #a4d6ff; outline-offset: 2px; }
.worldEditorRefined :is(button.smallButton, button.primaryButton, .dropEditorOpen) {
  min-height: 33px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid #4c607b;
  border-radius: 8px;
  background: #25374d;
  color: #f2f7ff;
  font: 650 11px/1.35 system-ui, sans-serif;
  text-shadow: none;
  box-shadow: inset 0 1px #ffffff0a;
  cursor: pointer;
}
.worldEditorRefined :is(button.smallButton, .dropEditorOpen):hover { border-color: #a2bedc; background: #30465f; }
.worldEditorRefined button.primaryButton { border-color: #5f8dab; background: #24475d; color: #e4f6ff; }
.worldEditorRefined button.primaryButton:hover { background: #2c5971; }
.worldEditorRefined :is(button, input, select):disabled { opacity: .5; cursor: not-allowed; }
.worldEditorRefined .worldEditorDangerButton { background: #40252f !important; border-color: #9d5967 !important; color: #ffd6dc !important; }
.worldEditorRefined .dropEditorOpen { display: block; width: 100%; text-align: left; background: #283a50; color: #e8f3ff; border-color: #7597bd; }
.worldEditorRefined .dropEditorOpen::after { content: '↗'; float: right; margin-left: 8px; color: #b7d8f5; }
.worldEditorRefined .dropEditorOpen:disabled::after { content: ''; }

#worldEditorSessionToolbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid #625b43;
  border-radius: 10px;
  background: #2d2b235c;
}
#worldEditorSessionToolbar > :is(p, small, label), #worldEditorSessionStatus { grid-column: 1 / -1; margin: 0; }
#worldEditorSessionToolbar > div:has(#worldEditorModeLabel) { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; }
#worldEditorSessionToolbar > .worldEditorActionRow { grid-column: 1 / -1; display: flex; gap: 7px; flex-wrap: wrap; justify-content: stretch; }
#worldEditorSessionToolbar > .worldEditorActionRow #worldEditorDownload { flex: 1 1 auto; }
#worldEditorSessionToolbar > label { display: flex; gap: 6px; align-items: center; }
#worldEditorSessionToolbar :is(strong, label) { color: #f1dfad; font-size: 11px; }
#worldEditorSessionToolbar small, #worldEditorSessionStatus { color: #c5bfad; font-size: 10px; line-height: 1.4; }
#worldEditorChangeCount { color: #ecd6a0; font-size: 11px; font-variant-numeric: tabular-nums; }
#worldEditorSessionToolbar input, #worldEditorSessionToolbar textarea, #worldEditorSessionToolbar select {
  width: 100%; min-width: 0; padding: 6px 8px; margin-top: 4px;
  border: 1px solid #536077; border-radius: 6px; background: #121b27; color: #eef4ff; font: 11px/1.4 system-ui;
}
#worldEditorSessionToolbar > label input { flex: 1 1 0; width: 0; min-height: 29px; margin-top: 0; }
#worldEditorSessionToolbar > label select { flex: 1 1 0; width: 0; min-height: 29px; margin-top: 0; }
#worldEditorSessionToolbar #worldEditorDownload { background: #66532c; border-color: #a88a49; color: #fff0c6; }
#worldEditorSessionToolbar #worldEditorDiscardDraft { background: transparent; color: #d0bbba; border-color: #68565a; }
#worldEditorSessionToolbar button {
  min-height: 33px; margin: 0; padding: 7px 10px; border: 1px solid #627c98; border-radius: 7px;
  background: #263c53; color: #edf5ff; font: 650 11px/1.4 system-ui; text-shadow: none; cursor: pointer;
}
#worldEditorSessionToolbar button:hover { background: #365370; border-color: #aac8e7; }
#worldEditorSessionToolbar button:disabled { opacity: .5; cursor: not-allowed; }
#worldEditorDiscardConfirm {
  grid-column: 1 / -1; display: grid; gap: 8px; padding: 10px; border: 1px solid #98606b; border-radius: 8px;
  background: #3d2731; color: #ffe0e3; font: 11px/1.5 system-ui;
}
#worldEditorDiscardConfirm :is(p, small) { margin: 0; color: #f0cbd1; }
#worldEditorDiscardConfirm button { background: #5b3240; border-color: #b47a88; color: #ffedf0; }
#worldEditorDiscardConfirm[hidden], #worldEditorDiscardConfirm.hidden { display: none !important; }
#worldEditorRecovery {
  position: absolute; left: 14px; bottom: 112px; z-index: 45; max-width: min(360px, calc(100% - 28px));
  display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 10px 14px;
  border: 1px solid #b99c5c; border-radius: 10px; background: #29271df5; color: #fae6b2;
  font: 650 12px/1.4 system-ui; text-align: left; text-shadow: none; box-shadow: 0 7px 26px #0006; cursor: pointer;
}
#worldEditorRecovery:hover { border-color: #f2d190; background: #42391f; }
#worldEditorRecovery:focus-visible { outline: 2px solid #ffe0a2; outline-offset: 3px; }
#worldEditorRecovery[hidden], #worldEditorRecovery.hidden { display: none !important; }
.worldEditorBrowser { flex: 0 0 auto; padding: 0; overflow: hidden; border: 1px solid var(--editor-border); border-radius: 9px; background: #111b28; }
.worldEditorBrowser > summary { padding: 8px 10px; cursor: pointer; color: #c9d9eb; font-size: 11px; user-select: none; }
.worldEditorBrowser > summary strong { margin-left: 3px; font-weight: 650; }
.worldEditorEntityCount { float: right; color: #9bafc7; font-size: 10px; font-variant-numeric: tabular-nums; }
.worldEditorFinder { display: grid; grid-template-columns: minmax(0, 1fr) 113px; gap: 6px; padding: 0 8px 8px; }
.worldEditorFinder :is(input, select) {
  min-width: 0; width: 100%; min-height: 32px; padding: 6px 7px;
  border: 1px solid #41516a; border-radius: 6px; background: #0d1420; color: #edf4ff; font: 11px/1.35 system-ui;
}
.worldEditorFinder input::placeholder { color: #93a8c0; }
.worldEditorEntityList { max-height: 136px; overflow: auto; overscroll-behavior: contain; padding: 0 5px 5px; scrollbar-width: thin; scrollbar-color: #536781 transparent; }
.worldEditorEntityRow {
  display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; margin: 0; padding: 6px;
  border: 1px solid transparent; border-radius: 6px; background: transparent; color: #e4edf8; text-align: left; cursor: pointer;
}
.worldEditorEntityRow:hover { background: #ffffff07; border-color: #546f8c; }
.worldEditorEntityRow[aria-pressed=true] { background: #2a4362; border-color: #81abd2; }
.worldEditorEntityBadge { flex: 0 0 56px; padding: 3px 2px; border-radius: 4px; color: #b7d1ed; background: #253447; font: 650 9px/1.4 system-ui; text-align: center; }
.worldEditorEntityBadge[data-kind=enemy] { color: #efb9be; background: #472e38; }
.worldEditorEntityBadge[data-kind=npc] { color: #b6dcce; background: #254439; }
.worldEditorEntityBadge[data-kind=checkpoint] { color: #b9d7f7; background: #2c4057; }
.worldEditorEntityCopy { display: grid; gap: 1px; min-width: 0; }
.worldEditorEntityCopy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 11px/1.35 system-ui; }
.worldEditorEntityCopy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #a0b4ca; font: 9px/1.35 system-ui; }
.worldEditorSearchEmpty { padding: 4px 7px 7px; margin: 0; color: #b4c1d2; font-size: 11px; }
.worldEditorSectionNav { flex: 0 0 auto; display: flex; gap: 5px; flex-wrap: wrap; }
.worldEditorSectionNav button { margin: 0; padding: 6px 9px; border: 1px solid #3c4b60; border-radius: 6px; background: #152030; color: #bdcce0; font: 650 10px/1.4 system-ui; cursor: pointer; }
.worldEditorSectionNav button:hover { color: #fff; border-color: #829ebf; }
.worldEditorSectionNav button[aria-pressed=true] { border-color: #8eaeca; background: #354e68; color: #f2f7ff; }
.worldEditorSectionNav button[data-page=create] { margin-left: auto; color: #e4d39f; border-color: #796844; }
.worldEditorWorkspace { flex: 1 1 auto; min-height: 90px; overflow: auto; overscroll-behavior: contain; padding-right: 3px; scrollbar-width: thin; scrollbar-color: #536781 transparent; }
.worldEditorRefined .worldEditorBody { gap: 0; padding: 0; }
.worldEditorRefined .worldEditorSection { gap: 10px; padding: 11px; border-color: #34455b; background: #152030; border-radius: 9px; }
.worldEditorRefined .worldEditorSectionHead { align-items: flex-start; gap: 10px; min-height: auto; }
.worldEditorRefined .worldEditorSectionHead strong { color: #e8effa; font-size: 11px; letter-spacing: .025em; }
.worldEditorRefined .worldEditorSectionHead small { max-width: 55%; color: #a5b8ce; font-size: 10px; line-height: 1.4; }
.worldEditorRefined .worldEditorSection label { color: #c5d2e4; font-size: 11px; line-height: 1.4; font-weight: 550; letter-spacing: 0; }
.worldEditorRefined .worldEditorSection label small { color: #a4b6cb; font-size: 10px; }
.worldEditorRefined .worldEditorSection :is(input, textarea, select) { border-color: #475b74; background: #0f1825; color: #f0f5ff; font: 12px/1.4 system-ui; min-height: 34px; padding: 7px 8px; }
.worldEditorRefined .worldEditorSection textarea { min-height: 80px; line-height: 1.55; }
.worldEditorRefined .worldEditorSection :is(input, textarea)::placeholder { color: #8b9fb8; }
.worldEditorRefined .worldEditorCheckRow input[type=checkbox], .worldEditorRefined .worldEditorStockRow input[type=checkbox] { min-height: 18px; accent-color: #98cbe9; }
.worldEditorRefined .worldEditorSection :is(.worldEditorNavigationHint, .worldEditorCreateNpcHint, .worldEditorDeleteNpcHint, .worldEditorDeleteQuestHint) { color: #a5b8ce; font-size: 10px; }
.worldEditorRefined .worldEditorSubhead { gap: 10px; padding-top: 9px; }
.worldEditorRefined .worldEditorSubhead strong { font-size: 11px; }
.worldEditorRefined .worldEditorSubhead small { color: #a3b6ce; font-size: 9px; }
.worldEditorRefined .worldEditorCreateActions { grid-template-columns: 1fr 1fr; }
.worldEditorRefined .worldEditorCreateNpcForm { padding: 9px; }
.worldEditorRefined .worldEditorGrid2, .worldEditorRefined .worldEditorGrid3 { gap: 9px; }
.worldEditorRefined .worldEditorNavigationLegend { margin: 0 0 8px; padding: 6px 8px; border-color: #35465c; }
.worldEditorRefined .worldEditorNavigationLegend span { font-size: 9px; }
.worldEditorRefined .worldEditorTaskRow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 52px auto; gap: 6px; }
.worldEditorRefined .worldEditorTaskRow > * { min-width: 0; }
.worldEditorRefined .worldEditorStockRow { grid-template-columns: 18px minmax(0, 1fr) 75px; }
.worldEditorRefined .worldEditorStockRow span { font-size: 11px; overflow-wrap: anywhere; }
.worldEditorRefined .worldEditorStockHeader { grid-template-columns: 18px minmax(0, 1fr) 75px; }
.worldEditorRefined .worldEditorEnemyScaledPreview { grid-template-columns: 1fr 1fr; }
.worldEditorRefined .worldEditorEnemyScaledPreview span { color: #aac0d8; font-size: 8px; }
.worldEditorRefined .worldEditorEnemyScaledPreview strong { font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
.worldEditorFooter { flex: 0 0 auto; display: grid; gap: 4px; border-top: 1px solid var(--editor-border); padding-top: 8px; }
.worldEditorRefined .worldEditorPanelStatus { position: static; margin: 0; padding: 0; min-height: 0; background: transparent; color: #abdcb9; font: 550 11px/1.45 system-ui; overflow-wrap: anywhere; }
.worldEditorRefined .worldEditorPanelStatus:empty { display: none; }
.worldEditorRefined .worldEditorPanelStatus.error { color: #ffc1c9; }
.worldEditorDirtyHint { color: #97aec9; font-size: 10px; line-height: 1.4; }
.worldEditorDirtyHint.hasChanges { color: #efcf8c; }

#worldEditorPasswordDialog {
  width: min(410px, calc(100vw - 28px)); padding: 24px; border: 1px solid #7995b4; border-radius: 15px;
  background: linear-gradient(145deg, #1b293d, #101923); color: #edf4ff; box-shadow: 0 24px 90px #000a; color-scheme: dark;
}
#worldEditorPasswordDialog::backdrop { background: #060b13ad; backdrop-filter: blur(4px); }
#worldEditorPasswordDialog :is(h2, h3) { margin: 0 0 8px; font: 650 23px/1.2 system-ui; }
#worldEditorPasswordDialog p { color: #b5c6db; font: 12px/1.6 system-ui; }
#worldEditorPasswordForm { display: grid; gap: 12px; }
#worldEditorPasswordForm label { display: grid; gap: 6px; font: 550 12px/1.5 system-ui; color: #c7d5e6; }
#worldEditorPasswordInput { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #5d7896; border-radius: 8px; background: #0b1320; color: #f5f8ff; font: 16px/1.4 system-ui; }
#worldEditorPasswordDialog button { min-height: 37px; margin: 0; padding: 8px 12px; border: 1px solid #6d8eaf; border-radius: 8px; background: #2f4c68; color: #eef5ff; font: 650 12px/1.4 system-ui; cursor: pointer; }
#worldEditorPasswordStatus { margin: 0; min-height: 17px; color: #edc7a7; font: 11px/1.45 system-ui; }

/* Keep the loot table scrollable while its Save / Close actions stay visible. */
.adventurePanel.dropEditorPanel[open] {
  display: flex; flex-direction: column; gap: 10px; overflow: hidden;
  max-height: min(790px, calc(100dvh - 32px)); padding: 18px;
}
.adventurePanel.dropEditorPanel[open]:has(.dropEditorTable) { height: min(790px, calc(100dvh - 32px)); }
.dropEditorPanel > :is(h2, p, .adventureActions) { flex: 0 0 auto; }
.adventurePanel.dropEditorPanel > h2 { margin: 0; font-size: 23px; line-height: 1.25; }
.dropEditorPanel > p { margin: 0; color: #bbcee4; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.dropEditorPanel > div:not(.adventureActions) {
  flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: #7187a5 #111b28;
}
.dropEditorPanel .dropEditorTable th { position: sticky; top: 0; z-index: 1; background: #1b293e; }
.dropEditorPanel > .adventureActions { margin: 0; padding-top: 10px; border-top: 1px solid #4b5e76; }
.dropEditorPanel > p[role=status] { color: #dfd39f; }
.dropEditorPanel > p[role=status]:empty { display: none; }

@media (max-height: 840px) and (min-width: 761px) {
  .worldContentEditorPanel.worldEditorRefined { gap: 7px; padding: 10px; }
  .worldEditorEntityList { max-height: 88px; }
  .worldEditorRefined .worldContentEditorHeader { padding-bottom: 7px; }
}
@media (max-width: 760px) {
  .worldContentEditorPanel.worldEditorRefined {
    position: fixed; inset: 10px 10px 10px auto !important; width: min(454px, calc(100vw - 20px));
    height: calc(100dvh - 20px); max-height: none; padding: 10px; gap: 8px; z-index: 80;
  }
  .worldEditorEntityList { max-height: 100px; }
  .worldEditorRefined .worldEditorSection :is(input, textarea, select) { font-size: 16px; }
  .worldEditorRefined .worldEditorCreateActions { grid-template-columns: 1fr 1fr; }
  .worldEditorRefined .worldEditorGrid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .worldEditorRefined .worldEditorTaskRow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .worldEditorRefined .worldEditorShopBehaviorGrid { grid-template-columns: 1fr; }
  .worldEditorRefined .worldEditorBehaviorGrid { grid-template-columns: 1fr 1fr; }
}
@media (max-height: 570px) {
  .worldEditorEntityList { max-height: 60px; }
  .worldEditorRefined .worldContentEditorHeader small { display: none; }
  .worldEditorWorkspace { min-height: 65px; }
}
