/* v19 studio controls: deliberately reuse v18 collapsible panel appearance. */
.rw19-editor-head {display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;flex-wrap:wrap;margin-bottom:1rem}
.rw19-editor-head .section-head {margin-bottom:0;flex:1 1 260px}
.rw19-read-link {white-space:nowrap}
.rw19-editor-head .rw19-read-link {margin-left:auto}
/* Match the top Read chapter button against the outer Studio edge; no surrounding card. */
.rw19-editor-footer {display:flex;align-items:center;justify-content:flex-end;margin-top:1.2rem;padding:0;border:0;background:transparent;box-shadow:none}
.rw19-studio-details {border:1px solid var(--border,#455063);border-radius:10px;margin:.3rem 0 1.2rem;background:var(--surface,#222832);min-width:0}
.rw19-studio-details>summary {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.5rem;padding:1rem 1.2rem;cursor:pointer;color:var(--accent,#d6b5eb);list-style:none}
.rw19-studio-details>summary::-webkit-details-marker{display:none}
.rw19-studio-details>summary strong::before {content:'▸';display:inline-block;margin-right:.65rem}
.rw19-studio-details[open]>summary strong::before {content:'▾'}
.rw19-studio-details>summary span{color:var(--muted,#aeb4bf);font-size:.85rem}
.rw19-panel-body{padding:0 1.2rem 1.2rem}
.rw19-poll-grid {display:flex;flex-direction:column;gap:1rem}
.rw19-poll-grid label{font-weight:500}
.rw19-poll-grid label>input:not([type=checkbox]):not([type=radio]):not(.rw19-number) {display:block;width:100%;margin-top:.3rem}
.rw19-poll-grid .rw19-label{font-weight:650}
.rw19-choices{display:flex;flex-direction:column;gap:.55rem;margin-top:-.55rem}
.rw19-choice{display:flex;gap:.5rem;align-items:center}
.rw19-choice input{flex:1;min-width:0}
.rw19-choice button {flex:0 0 40px;font-size:1.2rem;line-height:1}
.rw19-poll-grid fieldset{border:1px solid var(--border,#4a5462);border-radius:9px;padding:.9rem 1rem;min-width:0;margin:0}
.rw19-poll-grid legend{color:var(--text,#e7e8e8);font-weight:650;padding:0 .35rem}
.rw19-poll-grid fieldset label{display:flex;align-items:center;flex-wrap:wrap;gap:.6rem;margin:.45rem 0;cursor:pointer}
.rw19-poll-grid input[type=radio],.rw19-poll-grid input[type=checkbox]{width:17px;height:17px;flex:0 0 17px;margin:0;accent-color:#bc91e8}
.rw19-number{width:76px!important;min-width:62px;padding:.4rem .5rem;text-align:center}
.rw19-poll-grid input[type=date]{width:185px;max-width:100%;padding:.4rem .5rem}
.rw19-poll-actions{display:flex;align-items:center;gap:.8rem;flex-wrap:wrap;margin-top:.35rem}
.rw19-poll-actions button:disabled{opacity:.55;cursor:not-allowed}
.rw19-warning{padding:.8rem 1rem;border:1px solid #af8b4c;background:rgba(185,137,38,.1);border-radius:7px}
.rw19-revision{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 0;border-top:1px solid var(--border)}
.rw19-revision>div{min-width:0;overflow-wrap:anywhere}
.rw19-revision small{display:block;font-size:.85rem;margin-top:.25rem}
.rw19-revision .btn{flex-shrink:0}
#rw19-poll-form,form[id^="rw19-revision-"]{display:none}
@media (max-width:640px){.rw19-editor-head .rw19-read-link{margin-left:auto}.rw19-panel-body{padding:0 .7rem .8rem}.rw19-studio-details>summary{padding:.85rem}.rw19-revision{align-items:flex-start;flex-wrap:wrap}}

.rw19-poll-grid fieldset label input[type=date]{display:inline-block;width:185px;max-width:100%;margin:0}

/* v23: compact horizontal poll options. Override general vertical form labels. */
.editor-form .rw19-poll-grid fieldset {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  column-gap:1.15rem;
  row-gap:.65rem;
  align-items:start;
}
.editor-form .rw19-poll-grid fieldset legend {float:none;margin-bottom:.35rem}
.editor-form .rw19-poll-grid fieldset label {
  display:flex;flex-direction:row;align-items:center;justify-content:flex-start;
  width:auto;min-width:0;gap:.5rem;flex-wrap:nowrap;
  margin:0;padding:.35rem 0;line-height:1.45;
}
.editor-form .rw19-poll-grid fieldset label>input[type=radio],
.editor-form .rw19-poll-grid fieldset label>input[type=checkbox] {
  display:inline-block;width:18px;height:18px;flex:0 0 18px;
}
.editor-form .rw19-poll-grid fieldset label>input[type=date] {display:inline-block!important;flex:0 1 170px;width:170px!important;min-width:130px;max-width:100%;margin:0!important}
.editor-form .rw19-poll-grid fieldset:last-of-type {grid-template-columns:repeat(2,minmax(0,1fr))}
/* Avoid generic editor-form labels stretching the radio selectors into portrait stacks. */
.editor-form .rw19-poll-grid fieldset label:has(input[type=radio]) {align-self:start}
/* Keep the publication controls at identical heights and baseline. */
.editor-form .rw23-publish-grid {align-items:stretch}
.editor-form .rw23-publish-grid>label {display:flex;flex-direction:column;align-self:stretch;gap:.45rem}
.editor-form .rw23-publish-grid>label>select,
.editor-form .rw23-publish-grid>label>input[type=date] {
  box-sizing:border-box;width:100%;height:52px;min-height:52px;
  margin-top:auto;line-height:normal;
}
.editor-form .rw23-back-to-studio {margin-right:auto;color:inherit;text-decoration:none}
.editor-form .image-upload-widget .rw23-import-chapter {
  margin-top:1.15rem;padding-top:1.15rem;border-top:1px solid var(--border,#454a58);
}
.editor-form .image-upload-widget .rw23-import-chapter label {display:flex;flex-direction:column;gap:.4rem}
.editor-form .image-upload-widget .rw23-import-chapter small {display:block;font-weight:400;color:var(--muted,#9fa9bc)}
@media(max-width:980px){
  .editor-form .rw19-poll-grid fieldset{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:620px){
  .editor-form .rw19-poll-grid fieldset,
  .editor-form .rw19-poll-grid fieldset:last-of-type{grid-template-columns:minmax(0,1fr)}
  .editor-form .rw23-publish-grid {grid-template-columns:1fr}
}

/* v25: optional poll on the first chapter save */
.rw19-panel-body .rw25-opt-in{display:flex;align-items:center;justify-content:flex-start;gap:.65rem;max-width:100%;border:1px solid var(--border);background:var(--raised);padding:.8rem 1rem;border-radius:9px;margin:0 0 1rem;cursor:pointer;font-weight:600}
.rw19-panel-body .rw25-opt-in input{width:1.15rem;height:1.15rem;flex:0 0 auto;margin:0}
