.scene-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:12px 0}.scene-actions input{flex:1;min-width:140px}.scene-card{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px;border:1px solid var(--ui-line);border-radius:6px;background:var(--ui-surface);margin:8px 0}.scene-card strong{overflow-wrap:anywhere}.scene-card small{display:block;color:var(--ui-secondary);font-size:11px;margin-top:5px}.scene-card .scene-actions{flex-shrink:0;margin:0}.scene-preview{display:block;width:100%;height:250px;border:1px solid var(--ui-line);border-radius:6px;background:var(--ui-raised)}.scene-mode{color:var(--ui-accent);font-weight:600}.scene-position{display:flex;gap:10px;flex-wrap:wrap;align-items:center;padding:10px 0;border-bottom:1px solid var(--ui-line)}.scene-position strong{flex:1;min-width:130px;overflow-wrap:anywhere}.scene-position label{margin:0;max-width:120px;font-size:11px}.scene-position input[type=number]{width:90px}.scene-position .checkbox-label{align-self:center}#scene-list{max-height:55vh;overflow:auto}#scene-form details{margin:18px 0}#scene-form summary{cursor:pointer}#scene-form h3{font-size:14px;margin:18px 0 8px}@media(max-width:600px){.scene-preview{height:190px}.scene-card{flex-wrap:wrap}}

dialog.floating-window:has(#scene-list) {height:280px}
.floating-window:not(.window-options-open) .scene-options {display:none}
.floating-window #scene-list {max-height:none;overflow:visible}
.floating-window .scene-card {min-height:52px;margin:0;padding:4px 0;gap:4px;border:0;background:transparent;flex-wrap:nowrap}
.floating-window .scene-card:hover {background:var(--ui-tint)}
.scene-info {display:flex;align-items:center;gap:10px;flex:1;min-width:0;padding:2px;border:0;background:transparent;color:var(--ui-text);text-align:left;cursor:pointer}
.scene-thumb {display:grid;place-items:center;width:40px;height:40px;flex:none;background:var(--ui-raised);overflow:hidden}
.scene-thumb img {width:100%;height:100%;object-fit:contain}
.scene-caption {min-width:0}
.scene-caption strong,.scene-caption small {display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.scene-caption strong {font-size:13px;font-weight:500;text-decoration:underline}
.scene-caption small {margin-top:2px}
.floating-window .scene-card .scene-actions {gap:0;flex-wrap:nowrap}
.floating-window .scene-actions .icon-button {width:26px;min-height:32px;padding:4px}

.scene-card button.scene-thumb {padding:0;border:0;color:var(--ui-secondary)}
.scene-card .scene-caption {flex:1;min-width:0;text-align:left}
.scene-card .scene-caption button,
.scene-card button.scene-caption {
  display:block;
  max-width:100%;
  padding:0;
  overflow:hidden;
  color:var(--ui-text);
  font-size:13px;
  font-weight:500;
  text-align:start;
  text-decoration:underline;
  text-overflow:ellipsis;
  white-space:nowrap;
}

dialog.scene-text-editor {
  position:fixed;
  inset:0;
  width:444px;
  max-width:calc(100vw - 32px);
  max-height:calc(100dvh - 32px);
  margin:auto;
  padding:0;
  border:0;
  border-radius:4px;
  overflow:auto;
  background:var(--ui-surface);
}
dialog.scene-text-editor::backdrop {background:var(--ui-scrim)}
:root[data-theme=dark] dialog.scene-text-editor {background:rgba(44,44,44,.87)}
dialog.scene-text-editor > .dialog-heading {display:none}
.scene-text-fields {
  display:grid;
  gap:1px;
  margin:0;
}
.scene-text-fields label {
  position:relative;
  display:block;
  margin:0;
}
.scene-text-fields label > span {
  position:absolute;
  top:6px;
  left:12px;
  color:var(--ui-secondary);
  font-size:12px;
  line-height:16px;
  pointer-events:none;
}
.scene-text-fields label > :is(input,textarea) {
  display:block;
  width:100%;
  min-height:0;
  margin:0;
  padding:24px 12px 8px;
  border:0;
  border-radius:0;
  background:color-mix(in srgb,var(--ui-surface),var(--ui-text) 6%);
  color:var(--ui-text);
  box-shadow:inset 0 -1px var(--ui-secondary);
  font-size:16px;
  line-height:24px;
}
.scene-text-fields input {height:56px}
.scene-text-fields textarea {height:124px;resize:none}
.scene-text-fields label:focus-within > span {color:var(--ui-accent)}
.scene-text-fields label:has(:is(input,textarea):placeholder-shown):not(:focus-within) > span {
  top:16px;
  font-size:16px;
  line-height:24px;
}
.scene-text-fields label > :is(input,textarea):focus {
  outline:0;
  box-shadow:inset 0 -2px var(--ui-accent);
}

.floating-window .scene-card {touch-action:none;user-select:none}
.floating-window .scene-card.scene-dragging {
  position:relative;
  z-index:1;
  background:var(--ui-surface);
  box-shadow:0 2px 8px var(--ui-shadow);
  cursor:grabbing;
}

@media (any-pointer:coarse) {
  .floating-window .scene-info {padding-block:0}
  .floating-window .scene-card .scene-thumb {width:44px;height:44px}
  .floating-window .scene-card .scene-caption,
  .floating-window .scene-card .scene-actions .icon-button {min-height:44px}
}
