#scriptSelectionAssistant {
  position: fixed; z-index: 100010;
  width: min(420px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); overflow-y: auto;
  box-sizing: border-box; padding: 16px; border-radius: 12px;
  background: #20212b; color: #e8eaed; border: 1px solid #727de0;
  box-shadow: 0 8px 40px #0009; font: 13px/1.5 Arial, sans-serif;
}
#scriptSelectionAssistant textarea {
  width: 100%; box-sizing: border-box; margin: 10px 0; padding: 10px;
  background: #14151e; color: #fff; border: 1px solid #747689;
  border-radius: 6px; resize: vertical; font: inherit;
}
.script-selection-excerpt { overflow-wrap: anywhere; max-height: 70px; overflow-y: auto; }
.script-selection-actions { display: flex; gap: 8px; }
#scriptSelectionAssistant button {
  padding: 7px 12px; border-radius: 6px; border: 1px solid #72768d;
  background: #343748; color: #fff; cursor: pointer;
}
#scriptSelectionAssistant button:first-child { background: #545fc4; }
#scriptSelectionAssistant button:disabled { opacity: .6; cursor: wait; }
.script-selection-status { margin-top: 9px; color: #bdc1d8; font-size: 12px; }
#scriptSelectionPlus {
  position: fixed; z-index: 100010; width: 32px; height: 32px;
  border: 1px solid #a7adff; border-radius: 50%; background: #565fc5;
  color: white; font: 24px/1 Arial, sans-serif; cursor: pointer;
  box-shadow: 0 3px 12px #0006;
}
#scriptSelectionPlus:focus-visible { outline: 3px solid #f7d564; outline-offset: 3px; }
.script-ai-proposal {
  flex: none; margin: 16px; padding: 16px; border: 1px solid #d8b646;
  background: #f8df78; color: #302609; border-radius: 8px;
  font: 13px/1.7 Arial, sans-serif; overflow-wrap: anywhere;
}
.script-ai-proposal-text { white-space: pre-wrap; margin: 10px 0 14px; }
.script-ai-proposal button {
  padding: 6px 16px; border: 1px solid #75601c; border-radius: 6px;
  background: #fff3bb; color: #302609; font-weight: 600; cursor: pointer;
}
.script-ai-proposal button:first-child { background: #3e351a; color: #fff4c3; }
.script-proposal-status { margin-top: 9px; font-size: 11px; }
.script-selection-status.is-loading::before {
  content: ''; display: inline-block; width: 12px; height: 12px; margin-right: 8px;
  border: 2px solid #747997; border-top-color: #eef0ff; border-radius: 50%;
  vertical-align: middle; animation: script-ai-spin .8s linear infinite;
}
@keyframes script-ai-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .script-selection-status.is-loading::before { animation: none; }
}