.drama-bar[hidden], .drama-dialog [hidden], .drama-bar [hidden] { display: none !important; }
.gemini-main.drama-mode, .gemini-main.drama-mode.empty { display: flex; flex-direction: column; }
.gemini-main.drama-mode > .gemini-chat-header { flex: 0 0 auto; }
.gemini-main.drama-mode > .gemini-messages { flex: 1 1 0; min-height: 0; padding-bottom: 20px; }
.gemini-main.drama-mode.empty > .gemini-welcome { flex: 1 1 0; width: min(760px, calc(100% - 32px)); min-height: 0; align-self: center; overflow: auto; padding: 20px 0; transform: none; }
.gemini-main.drama-mode > .gemini-composer, .gemini-main.drama-mode.empty > .gemini-composer { flex: 0 0 auto; position: relative; inset: auto; align-self: center; transform: none; margin: 0 0 max(14px, env(safe-area-inset-bottom, 0px)); }
.drama-bar { flex: 0 0 auto; padding: 12px clamp(14px, 4vw, 40px); background: #f5f8ff; border-bottom: 1px solid #dce6f7; max-height: 35dvh; overflow-y: auto; }
.drama-bar-heading, .drama-bar-actions, .drama-setup-fields, .drama-reader-tools, .drama-downloads { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.drama-bar-heading { justify-content: space-between; margin-bottom: 9px; }
.drama-step { color: #224ca1; font-weight: 650; font-size: 14px; }
.drama-muted { font-size: 12px; color: #626c7d; line-height: 1.6; }
.drama-bar button, .drama-dialog button, .drama-dialog select, .drama-bar input { min-height: 36px; border-radius: 8px; border: 1px solid #cdd7e5; background: #fff; color: #263549; padding: 7px 11px; font: inherit; font-size: 13px; cursor: pointer; }
.drama-bar button:hover, .drama-dialog button:hover { background: #edf3ff; }
.drama-bar .drama-primary { background: #2459b9; border-color: #2459b9; color: #fff; }
.drama-bar button:disabled, .drama-dialog button:disabled { opacity: .45; cursor: default; }
.drama-bar button:focus-visible, .drama-dialog button:focus-visible, .drama-dialog select:focus-visible { outline: 3px solid #92b8fb; outline-offset: 2px; }
.drama-bar details { margin-top: 9px; font-size: 12px; }
.drama-bar summary { cursor: pointer; width: fit-content; padding: 3px 0; }
.drama-setup-fields { padding-top: 7px; }
.drama-setup-fields input { width: 76px; margin-left: 5px; }
.drama-error { padding: 10px 12px; background: #fff2ef; color: #9a3425; border: 1px solid #f5d1c9; border-radius: 8px; font-size: 13px; line-height: 1.6; margin: 8px 0 0; overflow-wrap: anywhere; }
.drama-error button { margin: 5px 5px 0 0; }
.drama-target { font-size: 12px; color: #2459b9; margin-top: 8px; }
.drama-dialog { width: min(1240px, calc(100vw - 48px)); height: min(850px, calc(100dvh - 48px)); max-width: none; max-height: none; padding: 0; border: 1px solid #d8e1ee; border-radius: 18px; background: #fff; color: #172238; box-shadow: 0 24px 90px #142a4c38; overflow: hidden; }
.drama-dialog[open] { display: flex; flex-direction: column; }
.drama-dialog::backdrop { background: #18243a66; }
.drama-dialog-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 12px; gap: 14px; }
.drama-dialog h2 { margin: 0 0 3px; font-size: 19px; }
.drama-tabs { display: flex; gap: 8px; padding: 0 22px 12px; overflow-x: auto; flex-shrink: 0; }
.drama-tabs button { white-space: nowrap; border-color: transparent; }
.drama-tabs button[aria-pressed="true"] { background: #eaf1ff; border-color: #b7cef3; color: #2156af; }
.drama-downloads { background: #f6f8fc; padding: 10px 22px; border-block: 1px solid #e2e8f0; flex-shrink: 0; }
.drama-downloads label { font-size: 12px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex-shrink: 0; }
.drama-dialog #dramaDrafts { width: 17px; height: 17px; min-height: 0; margin: 0; padding: 0; flex: 0 0 17px; }
.drama-title-choice { display: flex; align-items: center; gap: 8px; padding: 10px 22px; border-bottom: 1px solid #e2e8f0; flex-wrap: wrap; }
.drama-title-choice label { font-size: 12px; }
.drama-title-choice input { flex: 1; min-width: 150px; min-height: 36px; border: 1px solid #cdd7e5; border-radius: 8px; padding: 7px 10px; }
.drama-dialog > .drama-error { margin: 8px 16px; flex-shrink: 0; }
.drama-library { flex: 1; min-height: 0; display: grid; grid-template-columns: 245px minmax(0, 1fr); }
.drama-catalog { background: #fafbfd; border-right: 1px solid #e2e8f0; padding: 14px 12px; overflow-y: auto; min-height: 0; }
.drama-catalog h3 { font-size: 12px; color: #626c7d; margin: 0 0 10px 4px; }
.drama-catalog .drama-document { display: block; width: 100%; text-align: left; margin-bottom: 7px; line-height: 1.6; }
.drama-document[aria-current="true"] { background: #eaf1ff; border-color: #b7cef3; }
#dramaDocumentSelect { display: none; }
.drama-reader { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.drama-reader-tools { padding: 12px 18px; border-bottom: 1px solid #e2e8f0; flex-shrink: 0; }
.drama-reader-tools strong { width: 100%; font-size: 14px; overflow-wrap: anywhere; }
.drama-reader-tools label { font-size: 12px; }
#dramaContent { flex: 1; min-height: 0; margin: 0; padding: 24px clamp(18px, 3vw, 44px); overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: #fff; color: #273349; font: 15px/1.95 "Microsoft YaHei", sans-serif; border: 0; border-radius: 0; }
@media (max-width: 640px) {
    .drama-bar { padding: 9px 12px; }
    .drama-bar-heading { gap: 3px; margin-bottom: 6px; }
    .drama-bar-heading .drama-muted { font-size: 11px; }
    .drama-bar-actions { gap: 7px; }
    .drama-bar-actions > .drama-muted { width: 100%; }
    .drama-dialog { width: calc(100vw - 12px); height: calc(100dvh - 12px); border-radius: 12px; }
    .drama-dialog-header { padding: 12px; }
    .drama-tabs { padding: 0 12px 8px; gap: 3px; }
    .drama-tabs button { padding: 7px 9px; }
    .drama-downloads { padding: 8px 12px; gap: 6px; }
    .drama-dialog button { min-height: 40px; }
    .drama-library { display: flex; flex-direction: column; }
    .drama-catalog { flex-shrink: 0; border-right: 0; border-bottom: 1px solid #e2e8f0; padding: 8px 12px; }
    .drama-catalog h3, #dramaDocumentList { display: none; }
    #dramaDocumentSelect { display: block; width: 100%; min-width: 0; }
    .drama-reader { flex: 1; }
    .drama-reader-tools { padding: 8px 12px; gap: 6px; }
    #dramaContent { padding: 16px; font-size: 14px; line-height: 1.85; }
}
