
.chapter-editor.card {
  border: 0;
  border-radius: 0;
  background: #eef2f7;
  box-shadow: none;
}

.chapter-editor > .card-body {
  display: grid;
  grid-template-columns: minmax(286px, 340px) minmax(0, 1fr);
  grid-auto-flow: row dense;
  gap: 14px 18px;
  align-items: start;
  padding: clamp(10px, 1.4vw, 18px);
}
.chapter-editor .editor-topbar,
.chapter-editor .publish-notice,
.chapter-editor .conflict-recovery-notice,
.chapter-editor .guest-write-banner,
.chapter-editor .editorial-nav-banner,
.chapter-editor .guest-auth-modal-backdrop,
.chapter-editor > .card-body > small.text-muted {
  grid-column: 1 / -1;
}
.chapter-editor .editor-workbench-tabs,
.chapter-editor .poetry-card,
.chapter-editor .editor-metrics,
.chapter-editor .character-reference-panel,
.chapter-editor .chapter-poll-panel,
.chapter-editor .document-studio-panel,
.chapter-editor .editor-toolbar,
.chapter-editor .document-insert-strip,
.chapter-editor .layout-board-panel,
.chapter-editor .document-preview-panel {
  grid-column: 1;
  min-width: 0;
}
.chapter-editor .editor-workbench-tabs {
  position: sticky;
  top: 10px;
  z-index: 20;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d6deea;
  border-radius: 16px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 12px 30px rgba(15,23,42,.08);
}
.chapter-editor .editor-workbench-tabs__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.chapter-editor .editor-workbench-tabs__head strong {
  color: #0f172a;
  font-size: .92rem;
}
.chapter-editor .editor-workbench-tabs__nav {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}
.chapter-editor .editor-workbench-tabs__tab {
  display: grid;
  gap: 2px;
  justify-items: start;
  width: 100%;
  min-height: 46px;
  padding: 9px 10px;
  border: 1px solid #d9e2ec;
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
  text-align: left;
  font: inherit;
}
.chapter-editor .editor-workbench-tabs__tab strong {
  font-size: .82rem;
  color: #102033;
  line-height: 1.2;
}
.chapter-editor .editor-workbench-tabs__tab span {
  color: #64748b;
  font-size: .72rem;
  line-height: 1.25;
}
.chapter-editor .editor-workbench-tabs__tab.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: inset 3px 0 0 #2563eb;
}
.chapter-editor .document-stage {
  grid-column: 2;
  grid-row: 3 / span 80;
  min-height: calc(100vh - 190px);
  max-height: none;
}
.chapter-editor .writer-entry-panel {
  grid-column: 2;
  grid-row: 2;
}
.chapter-editor .d-flex.justify-content-end.mt-2 {
  grid-column: 2;
}
.chapter-editor .editor-tools-collapsed .editor-workbench-tabs {
  align-self: start;
}
.chapter-editor.editor-tools-collapsed > .card-body {
  grid-template-columns: minmax(148px, 180px) minmax(0, 1fr);
}
.chapter-editor.editor-tools-collapsed .editor-workbench-tabs__nav,
.chapter-editor.editor-tools-collapsed .poetry-card,
.chapter-editor.editor-tools-collapsed .editor-metrics,
.chapter-editor.editor-tools-collapsed .character-reference-panel,
.chapter-editor.editor-tools-collapsed .chapter-poll-panel,
.chapter-editor.editor-tools-collapsed .document-studio-panel,
.chapter-editor.editor-tools-collapsed .editor-toolbar,
.chapter-editor.editor-tools-collapsed .document-insert-strip,
.chapter-editor.editor-tools-collapsed .layout-board-panel,
.chapter-editor.editor-tools-collapsed .document-preview-panel {
  display: none !important;
}
.chapter-editor .editor-metrics,
.chapter-editor .character-reference-panel,
.chapter-editor .chapter-poll-panel,
.chapter-editor .document-studio-panel,
.chapter-editor .editor-toolbar,
.chapter-editor .document-insert-strip,
.chapter-editor .layout-board-panel,
.chapter-editor .document-preview-panel {
  display: none;
}
.chapter-editor.editor-tool-tab-setup .editor-metrics {
  display: grid;
}
.chapter-editor.editor-tool-tab-setup .character-reference-panel,
.chapter-editor.editor-tool-tab-setup .chapter-poll-panel,
.chapter-editor.editor-tool-tab-studio .document-studio-panel,
.chapter-editor.editor-tool-tab-layout .layout-board-panel,
.chapter-editor.editor-tool-tab-preview .document-preview-panel {
  display: grid;
}
.chapter-editor.editor-tool-tab-format .editor-toolbar,
.chapter-editor.editor-tool-tab-format .document-insert-strip {
  display: flex;
}
.chapter-editor.editor-tool-tab-format .document-insert-strip {
  align-items: center;
}
.chapter-editor.editor-tool-tab-studio .document-studio-panel__hero,
.chapter-editor.editor-tool-tab-studio .document-studio-panel__hint,
.chapter-editor.editor-tool-tab-studio .document-studio-panel__flow,
.chapter-editor.editor-tool-tab-studio .document-studio-panel__finish-grid,
.chapter-editor.editor-tool-tab-studio .document-studio-panel__readiness {
  display: none;
}
.chapter-editor .document-studio-panel,
.chapter-editor .layout-board-panel,
.chapter-editor .document-preview-panel,
.chapter-editor .character-reference-panel,
.chapter-editor .chapter-poll-panel {
  max-height: calc(100vh - 170px);
  overflow: auto;
}
.chapter-editor .document-studio-panel__controls,
.chapter-editor .document-studio-panel__controls-margins,
.chapter-editor .document-studio-panel__presets,
.chapter-editor .document-studio-panel__metrics {
  grid-template-columns: 1fr;
}
.chapter-editor .document-studio-panel__actions,
.chapter-editor .document-studio-panel__toggles,
.chapter-editor .editor-toolbar,
.chapter-editor .document-insert-strip {
  gap: 7px;
}
.chapter-editor .document-stage__sheet-wrap {
  width: 100%;
}
.chapter-editor .document-editor-paper {
  width: min(100%, var(--editor-paper-width, 920px));
}
.chapter-editor .editor-topbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px minmax(170px, 260px) 240px auto auto;
  gap: 10px;
}
.chapter-editor .publish-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}
.chapter-editor .publish-controls--scheduled {
  grid-template-columns: minmax(118px, .7fr) minmax(170px, 1fr);
}
.chapter-editor .publish-controls .form-control,
.chapter-editor .publish-controls .form-select {
  min-height: 38px;
}
.chapter-editor .publish-controls__explore {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  min-height: 32px;
  color: #dbeafe;
  font-size: .8rem;
  line-height: 1;
  white-space: nowrap;
}
.chapter-editor .publish-controls__explore input {
  width: 14px;
  height: 14px;
  margin: 0;
}
.chapter-editor .publish-notice {
  border-radius: 12px;
  padding: 11px 14px;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.chapter-editor .publish-notice strong {
  font-size: .95rem;
  line-height: 1.2;
}
.chapter-editor .publish-notice span {
  font-size: .84rem;
  opacity: .92;
}
.chapter-editor .publish-notice-success {
  background: #ebfff3;
  border-color: #98e0b6;
  color: #0f5132;
}
.chapter-editor .publish-notice-error {
  background: #fff0f1;
  border-color: #f2b2b8;
  color: #842029;
}
.chapter-editor .conflict-recovery-notice {
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid #c9ccd8;
  background: linear-gradient(135deg, #f9fafc 0%, #eef3ff 100%);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}
.chapter-editor .conflict-recovery-notice__copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chapter-editor .conflict-recovery-notice__copy strong {
  font-size: .95rem;
  color: #182230;
}
.chapter-editor .conflict-recovery-notice__copy span {
  font-size: .84rem;
  color: #43506a;
}
.chapter-editor .conflict-recovery-notice__summary {
  margin-top: 4px;
}
.chapter-editor .conflict-recovery-notice__summary .btn-link {
  font-size: .8rem;
  color: #274c9a;
  text-decoration: none;
}
.chapter-editor .conflict-recovery-notice__summary-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #334155;
  font-size: .82rem;
}
.chapter-editor .conflict-recovery-notice__summary-list li + li {
  margin-top: 4px;
}
.chapter-editor .conflict-recovery-notice__comparison {
  margin-top: 8px;
}
.chapter-editor .conflict-recovery-notice__comparison-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.chapter-editor .conflict-recovery-notice__comparison-column {
  border: 1px solid #d7deef;
  border-radius: 10px;
  background: rgba(255, 255, 255, .72);
  padding: 10px 12px;
}
.chapter-editor .conflict-recovery-notice__comparison-column > strong {
  display: block;
  font-size: .86rem;
  color: #24324a;
  margin-bottom: 8px;
}
.chapter-editor .conflict-recovery-notice__comparison-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chapter-editor .conflict-recovery-notice__comparison-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: .81rem;
  color: #475569;
}
.chapter-editor .conflict-recovery-notice__comparison-list li strong {
  color: #1e293b;
  text-align: right;
}
.chapter-editor .conflict-recovery-notice__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.chapter-editor .guest-write-banner {
  border-radius: 14px;
  border: 1px solid #c7d2fe;
  background: linear-gradient(135deg, #eef2ff 0%, #f8fbff 100%);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}
.chapter-editor .guest-write-banner strong {
  display: block;
  color: #312e81;
  margin-bottom: 4px;
}
.chapter-editor .guest-write-banner span {
  display: block;
  color: #4338ca;
  font-size: .9rem;
  line-height: 1.5;
}
.chapter-editor .guest-write-banner__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chapter-editor .editorial-nav-banner {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #f5c88f;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.16), rgba(255, 255, 255, 0.92));
}
.chapter-editor .editorial-nav-banner__copy {
  display: grid;
  gap: 4px;
}
.chapter-editor .editorial-nav-banner__copy strong {
  color: #7c2d12;
  font-size: .96rem;
}
.chapter-editor .editorial-nav-banner__copy span {
  color: #7c3a13;
  font-size: .84rem;
  line-height: 1.45;
}
.chapter-editor .editorial-nav-banner__actions {
  display: grid;
  gap: 10px;
}
.chapter-editor .editorial-nav-banner__queue {
  display: grid;
  gap: 8px;
}
.chapter-editor .editorial-nav-banner__queue-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 12px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(249, 115, 22, 0.18);
}
.chapter-editor .editorial-nav-banner__queue-link strong {
  color: #1f2937;
  font-size: .83rem;
}
.chapter-editor .editorial-nav-banner__queue-link span {
  color: #9a3412;
  font-size: .74rem;
}
.chapter-editor .guest-auth-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.chapter-editor .guest-auth-modal {
  width: min(560px, 100%);
  background: #ffffff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  border: 1px solid #dbe4f0;
}
.chapter-editor .guest-auth-modal h3 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 1.25rem;
}
.chapter-editor .guest-auth-modal p {
  margin: 0;
  color: #475569;
  line-height: 1.6;
}
.chapter-editor .guest-auth-modal__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.chapter-editor .editor-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.chapter-editor .metric-card {
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 88px;
}
.chapter-editor .metric-card small {
  line-height: 1.15;
  opacity: 0.88;
  color: inherit !important;
}
.chapter-editor .metric-card strong {
  font-size: 1.2rem;
  line-height: 1.1;
  color: inherit !important;
}
.chapter-editor .metric-card span {
  font-size: 0.83rem;
  opacity: 0.9;
  color: inherit !important;
}
.chapter-editor .metric-card-primary {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #0f172a;
  border: 1px solid #bfdbfe;
}
.chapter-editor .metric-card-dark {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #f8fafc;
  border: 1px solid #1d4ed8;
}
.chapter-editor .metric-card-stopwatch {
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  color: #ecfeff;
  border: 1px solid #14b8a6;
}
.chapter-editor .metric-card .metric-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.chapter-editor .metric-card-stopwatch .stopwatch-value {
  color: #ffffff !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  letter-spacing: 0.02em;
}
.chapter-editor .metric-card-stopwatch .stopwatch-state {
  color: #ccfbf1 !important;
  font-weight: 600;
}
.chapter-editor .metric-card-stopwatch .stopwatch-value.running {
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.45);
}
.chapter-editor .editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.chapter-editor .editor-help-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.chapter-editor .editor-help-trigger {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #c7d2fe;
  background: #ffffff;
  color: #1d4ed8;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  box-shadow: 0 6px 18px rgba(30, 64, 175, 0.10);
}
.chapter-editor .editor-help-trigger:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}
.chapter-editor .editor-help-popover {
  border-radius: 14px;
  border: 1px solid #dbe4f0;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}
.chapter-editor .editor-help-popover strong {
  color: #0f172a;
  font-size: .92rem;
}
.chapter-editor .editor-help-popover span {
  color: #475569;
  font-size: .84rem;
  line-height: 1.5;
}
.chapter-editor .editor-help-popover-compact {
  margin-bottom: 8px;
}
.chapter-editor .editor-action-feedback {
  margin: 8px 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: .82rem;
  line-height: 1.45;
  border: 1px solid transparent;
}
.chapter-editor .editor-action-feedback--success {
  background: #ecfdf3;
  border-color: #a7f3d0;
  color: #166534;
}
.chapter-editor .editor-action-feedback--info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}
.chapter-editor .editor-action-feedback--error {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}
.chapter-editor .document-studio-panel {
  border: 1px solid #d7e0ea;
  border-radius: 18px;
  padding: 16px;
  background: radial-gradient(circle at top left, #fdf7ec 0%, #f8fbff 40%, #eef4ff 100%);
  display: grid;
  gap: 14px;
}
.chapter-editor .document-studio-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.chapter-editor .document-studio-panel__header strong {
  display: block;
  font-size: 1rem;
  color: #102033;
}
.chapter-editor .document-studio-panel__header small {
  display: block;
  color: #516074;
  margin-top: 4px;
  max-width: 720px;
}
.chapter-editor .document-studio-panel__hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid #d8e3ef;
  background: linear-gradient(135deg, #fffef8 0%, #f8fbff 65%, #eef4ff 100%);
}
.chapter-editor .document-studio-panel__hero--ready {
  border-color: #86efac;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%);
}
.chapter-editor .document-studio-panel__hero--attention {
  border-color: #fde68a;
  background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 100%);
}
.chapter-editor .document-studio-panel__hero--missing {
  border-color: #fecdd3;
  background: linear-gradient(135deg, #fff1f2 0%, #fff7ed 100%);
}
.chapter-editor .document-studio-panel__hero-badge {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
  font-size: .74rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: .02em;
}
.chapter-editor .document-studio-panel__hero-copy {
  display: grid;
  gap: 4px;
}
.chapter-editor .document-studio-panel__hero-copy strong {
  color: #102033;
  font-size: .98rem;
}
.chapter-editor .document-studio-panel__hero-copy span {
  color: #475569;
  font-size: .84rem;
  line-height: 1.45;
}
.chapter-editor .document-studio-panel__modes,
.chapter-editor .document-studio-panel__presets,
.chapter-editor .document-studio-panel__toggles,
.chapter-editor .document-studio-panel__actions,
.chapter-editor .document-insert-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.chapter-editor .document-studio-panel__hint {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid #d6deea;
  padding: 12px 14px;
}
.chapter-editor .document-studio-panel__hint strong {
  display: block;
  color: #14243a;
  font-size: .92rem;
}
.chapter-editor .document-studio-panel__hint span {
  display: block;
  margin-top: 3px;
  color: #526277;
  font-size: .86rem;
}
.chapter-editor .document-studio-panel__hint-mode {
  background: rgba(255, 255, 255, 0.88);
  border-style: dashed;
}
.chapter-editor .document-studio-panel__flow {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background:
    linear-gradient(135deg, rgba(239, 246, 255, 0.92), rgba(255, 255, 255, 0.78)),
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.18), transparent 34%);
}
.chapter-editor .document-studio-panel__flow-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.chapter-editor .document-studio-panel__flow-header strong {
  color: #102033;
  font-size: .94rem;
}
.chapter-editor .document-studio-panel__flow-header > span {
  color: #475569;
  font-size: .8rem;
  text-align: right;
}
.chapter-editor .document-studio-panel__flow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.chapter-editor .document-studio-panel__flow-step {
  width: 100%;
  border: 1px solid #dbe4f0;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  text-align: left;
  align-items: start;
  color: #1e293b;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.chapter-editor .document-studio-panel__flow-step:not(:disabled):hover {
  transform: translateY(-1px);
  border-color: #93c5fd;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.11);
}
.chapter-editor .document-studio-panel__flow-step:disabled {
  opacity: 1;
  cursor: default;
}
.chapter-editor .document-studio-panel__flow-step--ready {
  border-color: #86efac;
  background: #f0fdf4;
}
.chapter-editor .document-studio-panel__flow-step--attention {
  border-color: #fde68a;
  background: #fffbeb;
}
.chapter-editor .document-studio-panel__flow-step--missing {
  border-color: #fecdd3;
  background: #fff7f8;
}
.chapter-editor .document-studio-panel__flow-step-index {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  color: #fff;
  font-size: .74rem;
  font-weight: 800;
}
.chapter-editor .document-studio-panel__flow-step-copy {
  display: grid;
  gap: 3px;
}
.chapter-editor .document-studio-panel__flow-step-copy strong {
  font-size: .84rem;
  color: #102033;
}
.chapter-editor .document-studio-panel__flow-step-copy small {
  color: #475569;
  font-size: .74rem;
  line-height: 1.35;
}
.chapter-editor .document-studio-panel__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.chapter-editor .document-studio-panel__finish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.chapter-editor .document-studio-panel__finish-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid #d9e3f4;
  background: linear-gradient(180deg, #fffef8 0%, #f8fbff 100%);
}
.chapter-editor .document-studio-panel__finish-card strong {
  color: #102a43;
  font-size: .92rem;
}
.chapter-editor .document-studio-panel__finish-card span {
  color: #475569;
  font-size: .82rem;
  line-height: 1.45;
}
.chapter-editor .document-studio-panel__finish-card .btn {
  justify-self: start;
}
.chapter-editor .document-studio-panel__readiness {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid #d6e0ec;
  background: rgba(255, 255, 255, 0.86);
}
.chapter-editor .document-studio-panel__readiness-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.chapter-editor .document-studio-panel__readiness-header strong {
  color: #102033;
  font-size: .95rem;
}
.chapter-editor .document-studio-panel__readiness-header span {
  color: #64748b;
  font-size: .8rem;
}
.chapter-editor .document-studio-panel__readiness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.chapter-editor .document-studio-panel__readiness-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 12px;
  align-items: start;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #d9e2ec;
  background: #fff;
}
.chapter-editor .document-studio-panel__readiness-item--ready {
  border-color: #86efac;
  background: #f0fdf4;
}
.chapter-editor .document-studio-panel__readiness-item--attention {
  border-color: #fde68a;
  background: #fffbeb;
}
.chapter-editor .document-studio-panel__readiness-item--missing {
  border-color: #fecdd3;
  background: #fff1f2;
}
.chapter-editor .document-studio-panel__readiness-badge {
  min-width: 68px;
  padding: 5px 8px;
  border-radius: 999px;
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}
.chapter-editor .document-studio-panel__readiness-copy {
  display: grid;
  gap: 4px;
}
.chapter-editor .document-studio-panel__readiness-copy strong {
  color: #102033;
  font-size: .88rem;
}
.chapter-editor .document-studio-panel__readiness-copy span {
  color: #475569;
  font-size: .81rem;
  line-height: 1.45;
}
.chapter-editor .document-studio-panel__readiness-item .btn {
  grid-column: 2;
  justify-self: start;
}
.chapter-editor .document-studio-panel__metric {
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #d9e2ec;
  display: grid;
  gap: 3px;
}
.chapter-editor .document-studio-panel__metric small {
  color: #64748b;
  font-size: .76rem;
}
.chapter-editor .document-studio-panel__metric strong {
  color: #0f172a;
  font-size: .98rem;
}
.chapter-editor .document-studio-panel__controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.chapter-editor .document-studio-panel__field {
  display: grid;
  gap: 6px;
}
.chapter-editor .document-studio-panel__field-help {
  align-self: end;
  margin-bottom: 6px;
}
.chapter-editor .document-studio-panel__field span,
.chapter-editor .document-studio-panel__toggles label,
.chapter-editor .document-studio-panel__print-helper {
  color: #516074;
  font-size: .84rem;
}
.chapter-editor .writer-entry-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #dbe5f0;
  border-radius: 24px;
  padding: 18px 20px;
  background:
    radial-gradient(circle at 12% 20%, rgba(14, 165, 233, 0.14), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #eef6ff 100%);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}
.chapter-editor .writer-entry-panel__copy {
  display: grid;
  gap: 4px;
}
.chapter-editor .writer-entry-panel__copy span {
  color: #0f766e;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.chapter-editor .writer-entry-panel__copy strong {
  color: #102033;
  font-size: 1.04rem;
}
.chapter-editor .writer-entry-panel__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
.chapter-editor .document-stage {
  position: relative;
  border: 1px solid #d9e2ec;
  border-radius: 20px;
  padding: 28px 18px 18px 18px;
  background: linear-gradient(180deg, #e9eef5 0%, #f6f8fc 100%);
  overflow: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.chapter-editor .document-stage-rulers {
  padding-top: 44px;
  padding-left: 44px;
}
.chapter-editor .document-stage__top-ruler {
  position: absolute;
  left: 44px;
  right: 18px;
  top: 12px;
  height: 20px;
  border-radius: 999px;
  background: repeating-linear-gradient(to right, rgba(15, 23, 42, 0.08) 0 1px, transparent 1px 24px);
}
.chapter-editor .document-stage__side-ruler {
  position: absolute;
  top: 44px;
  bottom: 18px;
  left: 12px;
  width: 20px;
  border-radius: 999px;
  background: repeating-linear-gradient(to bottom, rgba(15, 23, 42, 0.08) 0 1px, transparent 1px 24px);
}
.chapter-editor .document-stage__sheet-wrap {
  min-width: -moz-fit-content;
  min-width: fit-content;
  display: grid;
  justify-content: center;
  gap: 10px;
}
.chapter-editor .document-outline-panel {
  position: sticky;
  top: 12px;
  border-radius: 18px;
  border: 1px solid #d6deea;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  padding: 14px;
  display: grid;
  gap: 10px;
}
.chapter-editor .document-outline-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.chapter-editor .document-outline-panel__header strong {
  color: #0f172a;
  font-size: .95rem;
}
.chapter-editor .document-outline-panel__header span {
  color: #64748b;
  font-size: .76rem;
}
.chapter-editor .document-outline-panel__item {
  display: grid;
  justify-items: start;
  gap: 2px;
  border: 1px solid #d9e2ec;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  text-align: left;
}
.chapter-editor .document-outline-panel__item span {
  color: #64748b;
  font-size: .72rem;
  font-weight: 700;
}
.chapter-editor .document-outline-panel__item strong {
  color: #1e293b;
  font-size: .85rem;
  line-height: 1.35;
}
.chapter-editor .document-outline-panel__item-level-2 {
  margin-left: 10px;
}
.chapter-editor .document-outline-panel__item-level-3 {
  margin-left: 20px;
}
.chapter-editor .document-outline-panel__notes {
  display: grid;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}
.chapter-editor .document-outline-panel__notes-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.chapter-editor .document-outline-panel__notes-header strong {
  color: #0f172a;
  font-size: .9rem;
}
.chapter-editor .document-outline-panel__notes-header span {
  color: #64748b;
  font-size: .76rem;
}
.chapter-editor .document-outline-panel__notes-compose {
  display: grid;
  gap: 8px;
}
.chapter-editor .document-outline-panel__notes-empty {
  color: #64748b;
  font-size: .82rem;
}
.chapter-editor .document-outline-panel__note-item {
  display: grid;
  gap: 8px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 10px;
  background: #fffdf7;
}
.chapter-editor .document-outline-panel__note-item span {
  color: #334155;
  font-size: .82rem;
  line-height: 1.45;
}
.chapter-editor .document-outline-panel__note-item-guide {
  background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
  border-style: solid;
  border-color: #c7d8f8;
}
.chapter-editor .document-outline-panel__note-item-guide strong {
  color: #102a43;
}
.chapter-editor .document-outline-panel__note-item-guide .btn {
  justify-self: start;
}
.chapter-editor .document-outline-panel__comment-item {
  display: grid;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
  background: #f8fbff;
}
.chapter-editor .document-outline-panel__comment-item strong {
  color: #1d4ed8;
  font-size: .76rem;
  text-transform: uppercase;
}
.chapter-editor .document-outline-panel__comment-item blockquote {
  margin: 0;
  padding-left: 10px;
  border-left: 3px solid #cbd5e1;
  color: #0f172a;
  font-size: .82rem;
}
.chapter-editor .document-outline-panel__comment-item span {
  color: #334155;
  font-size: .82rem;
}
.chapter-editor .document-outline-panel__comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chapter-editor .layout-board-panel__grid-help {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px dashed #cbd5e1;
  background: rgba(255, 255, 255, 0.78);
}
.chapter-editor .layout-board-panel__grid-help strong {
  display: block;
  color: #0f172a;
  font-size: .9rem;
}
.chapter-editor .layout-board-panel__grid-help span {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: .82rem;
  line-height: 1.45;
}
.chapter-editor .document-stage__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.chapter-editor .document-stage__meta span {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #d5dde8;
  padding: 6px 10px;
  color: #304255;
  font-size: .76rem;
  font-weight: 600;
}
.chapter-editor .document-studio-panel__margin-summary {
  color: #516074;
  font-size: .82rem;
  font-weight: 600;
}
.chapter-editor .layout-visual-panel {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid #d8dee8;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(248, 250, 252, .92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85);
}
.chapter-editor .layout-visual-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.chapter-editor .layout-visual-panel__header strong {
  color: #102033;
  font-size: .92rem;
}
.chapter-editor .layout-visual-panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}
.chapter-editor .layout-visual-panel__grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
}
.chapter-editor .layout-visual-tool {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 9px;
  min-height: 62px;
  padding: 9px 10px;
  border: 1px solid #d2dce9;
  border-radius: 10px;
  background: #fff;
  text-align: left;
  color: #102033;
  box-shadow: 0 8px 16px rgba(15, 23, 42, .06);
}
.chapter-editor .layout-visual-tool:hover {
  transform: translateY(-1px);
  border-color: #9fb4d0;
  box-shadow: 0 12px 22px rgba(15, 23, 42, .1);
}
.chapter-editor .layout-visual-tool__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 1.05rem;
}
.chapter-editor .layout-visual-tool__copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.chapter-editor .layout-visual-tool__copy strong {
  overflow-wrap: anywhere;
  font-size: .82rem;
  line-height: 1.15;
}
.chapter-editor .layout-visual-tool__copy small {
  color: #64748b;
  font-size: .68rem;
  line-height: 1.15;
}
.chapter-editor .layout-visual-tool--compact {
  min-height: 54px;
  grid-template-columns: 30px 1fr;
}
.chapter-editor .layout-visual-tool--compact .layout-visual-tool__icon {
  width: 30px;
  height: 30px;
  font-size: .95rem;
}
.chapter-editor .layout-visual-tool--shape .layout-visual-tool__icon,
.chapter-editor .layout-visual-tool--editorial .layout-visual-tool__icon {
  background: #fef3c7;
  color: #92400e;
}
.chapter-editor .layout-visual-tool--icon .layout-visual-tool__icon,
.chapter-editor .layout-visual-tool--smartart .layout-visual-tool__icon {
  background: #ede9fe;
  color: #6d28d9;
}
.chapter-editor .layout-visual-tool--chart .layout-visual-tool__icon,
.chapter-editor .layout-visual-tool--snapshot .layout-visual-tool__icon {
  background: #dcfce7;
  color: #166534;
}
.chapter-editor .layout-visual-tool--model .layout-visual-tool__icon {
  background: #f1f5f9;
  color: #334155;
}
.chapter-editor .document-editor-paper {
  min-height: 620px;
  background: #fffefc;
  border-radius: 22px;
  margin: 0 auto;
  border: 1px solid #d8dee8;
}
.chapter-editor .document-paper-chrome {
  color: #64748b;
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.chapter-editor .document-paper-chrome-header {
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}
.chapter-editor .document-editor-paper__comment-helper {
  color: #64748b;
  font-size: .78rem;
  line-height: 1.45;
}
.chapter-editor .document-editor-paper .ProseMirror {
  min-height: 440px;
  outline: none;
}
.chapter-editor .document-editor-paper .ProseMirror p:first-child:empty::before {
  content: 'Comece a escrever aqui...';
  color: #94a3b8;
  pointer-events: none;
  float: left;
}
.chapter-editor .document-editor-paper .ProseMirror table.editor-content-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1rem;
}
.chapter-editor .document-editor-paper .ProseMirror table.editor-content-table td,
.chapter-editor .document-editor-paper .ProseMirror table.editor-content-table th {
  min-width: 72px;
  border: 1px solid #cbd5e1;
  padding: 8px 10px;
  vertical-align: top;
}
.chapter-editor .document-editor-paper .ProseMirror table.editor-content-table th {
  background: #f1f5f9;
  font-weight: 800;
}
.chapter-editor .document-editor-paper .ProseMirror table.editor-content-table p {
  margin: 0;
}
.chapter-editor .document-paper-chrome-footer {
  margin-top: 1.25rem;
  padding-top: .75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.chapter-editor .document-editor-paper-printframe {
  outline: 1px dashed rgba(71, 85, 105, 0.28);
  outline-offset: -14px;
}
.chapter-editor .document-editor-paper__comment-compose {
  display: grid;
  gap: 8px;
  margin-top: 1.25rem;
  margin-bottom: 0;
  padding: 10px;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid #e2e8f0;
}
.chapter-editor .layout-board-panel,
.chapter-editor .document-preview-panel {
  border: 1px solid #d7e0ea;
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
  display: grid;
  gap: 14px;
}
.chapter-editor .layout-board-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.chapter-editor .layout-board-panel__header strong {
  color: #102033;
}
.chapter-editor .layout-board-panel__header span,
.chapter-editor .layout-board-panel__empty {
  color: #64748b;
  font-size: .84rem;
}
.chapter-editor .layout-vector-ribbon {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.05fr) minmax(0, .82fr) minmax(0, 1fr) minmax(0, .72fr) minmax(0, .9fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid #d6deea;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 251, 255, .96));
  box-shadow: 0 10px 22px rgba(15, 23, 42, .06);
}
.chapter-editor .layout-vector-ribbon__group {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 6px;
  min-width: 0;
  padding: 0 10px 0 0;
  border-right: 1px solid #d8dee8;
}
.chapter-editor .layout-vector-ribbon__group:last-child {
  padding-right: 0;
  border-right: 0;
}
.chapter-editor .layout-vector-ribbon__tools {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.chapter-editor .layout-vector-ribbon__tools--tools,
.chapter-editor .layout-vector-ribbon__tools--layers {
  grid-template-columns: minmax(72px, .8fr) minmax(112px, 1.2fr);
}
.chapter-editor .layout-vector-ribbon__tools--guides {
  grid-template-columns: repeat(3, minmax(48px, 1fr));
}
.chapter-editor .layout-vector-ribbon__tools--align {
  grid-template-columns: repeat(4, minmax(32px, 1fr));
}
.chapter-editor .layout-vector-ribbon__tools--transform {
  grid-template-columns: repeat(2, minmax(36px, 1fr));
}
.chapter-editor .layout-vector-ribbon__tools--color {
  grid-template-columns: repeat(4, minmax(28px, 1fr));
  align-content: start;
}
.chapter-editor .layout-vector-ribbon__label {
  overflow: hidden;
  color: #475569;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chapter-editor .layout-vector-tool,
.chapter-editor .layout-vector-row-command,
.chapter-editor .layout-vector-icon {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #0f172a;
  font: inherit;
  cursor: pointer;
}
.chapter-editor .layout-vector-tool {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  min-height: 70px;
  min-width: 0;
  padding: 7px 5px;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1.08;
  text-align: center;
}
.chapter-editor .layout-vector-tool--large {
  min-height: 86px;
}
.chapter-editor .layout-vector-tool:hover,
.chapter-editor .layout-vector-tool.active,
.chapter-editor .layout-vector-row-command:hover,
.chapter-editor .layout-vector-icon:hover {
  border-color: #cbd5e1;
  background: #eff6ff;
  color: #1d4ed8;
}
.chapter-editor .layout-vector-tool:disabled,
.chapter-editor .layout-vector-row-command:disabled,
.chapter-editor .layout-vector-icon:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.chapter-editor .layout-vector-tool__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 1.08rem;
}
.chapter-editor .layout-vector-stack {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
}
.chapter-editor .layout-vector-row-command {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 28px;
  min-width: 0;
  padding: 4px 6px;
  font-size: .68rem;
  font-weight: 700;
  text-align: left;
}
.chapter-editor .layout-vector-row-command--wide {
  grid-column: span 2;
}
.chapter-editor .layout-vector-row-command strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chapter-editor .layout-vector-icon {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 30px;
  padding: 0;
  color: #334155;
  font-size: .98rem;
}
.chapter-editor .layout-vector-color-picker {
  grid-column: span 4;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  color: #475569;
  font-size: .68rem;
  font-weight: 800;
}
.chapter-editor .layout-vector-color-picker input {
  width: 100%;
  min-width: 0;
  height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 2px;
}
.chapter-editor .layout-vector-swatch {
  width: 100%;
  min-height: 26px;
  border: 1px solid rgba(15, 23, 42, .18);
  border-radius: 7px;
  cursor: pointer;
}
.chapter-editor .layout-object-workbench {
  display: grid;
  grid-template-columns: minmax(220px, .9fr) minmax(280px, 1.1fr);
  gap: 10px;
}
.chapter-editor .layout-object-manager,
.chapter-editor .layout-object-properties {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #d8dee8;
  border-radius: 12px;
  background: rgba(255, 255, 255, .84);
}
.chapter-editor .layout-object-manager header,
.chapter-editor .layout-object-properties header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.chapter-editor .layout-object-manager header strong,
.chapter-editor .layout-object-properties header strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0f172a;
  font-size: .82rem;
}
.chapter-editor .layout-object-manager header span,
.chapter-editor .layout-object-properties header span {
  color: #64748b;
  font-size: .72rem;
  font-weight: 700;
}
.chapter-editor .layout-object-manager__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px 28px;
  gap: 6px;
  align-items: center;
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #fff;
  padding: 4px;
}
.chapter-editor .layout-object-manager__item.active {
  border-color: #2563eb;
  background: #eff6ff;
}
.chapter-editor .layout-object-manager__item.hidden {
  opacity: .66;
}
.chapter-editor .layout-object-manager__select {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #0f172a;
  font: inherit;
  text-align: left;
}
.chapter-editor .layout-object-manager__select strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .74rem;
}
.chapter-editor .layout-object-manager__select em {
  color: #64748b;
  font-size: .66rem;
  font-style: normal;
  font-weight: 800;
}
.chapter-editor .layout-object-manager__icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #2563eb;
}
.chapter-editor .layout-object-manager__item > button:not(.layout-object-manager__select) {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #475569;
}
.chapter-editor .layout-object-manager__item > button:not(.layout-object-manager__select):hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #1d4ed8;
}
.chapter-editor .layout-object-properties__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.chapter-editor .layout-object-properties__grid label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: #475569;
  font-size: .68rem;
  font-weight: 800;
}
.chapter-editor .layout-object-properties__grid input {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 3px 6px;
  font: inherit;
  font-size: .72rem;
}
@media (max-width: 760px) {
.chapter-editor .layout-vector-ribbon,
  .chapter-editor .layout-object-workbench {
    grid-template-columns: 1fr;
}
.chapter-editor .layout-vector-ribbon__group {
    padding: 0 0 8px;
    border-right: 0;
    border-bottom: 1px solid #d8dee8;
}
.chapter-editor .layout-vector-ribbon__group:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
.chapter-editor .layout-vector-ribbon__tools--tools,
  .chapter-editor .layout-vector-ribbon__tools--layers,
  .chapter-editor .layout-vector-ribbon__tools--guides,
  .chapter-editor .layout-vector-ribbon__tools--align,
  .chapter-editor .layout-vector-ribbon__tools--transform,
  .chapter-editor .layout-vector-ribbon__tools--color {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.chapter-editor .layout-vector-stack,
  .chapter-editor .layout-vector-color-picker {
    grid-column: 1 / -1;
}
}
.chapter-editor .layout-board-panel__canvas-stack {
  display: grid;
  gap: 18px;
}
.chapter-editor .layout-board-panel__canvas-page-wrap {
  display: grid;
  gap: 8px;
}
.chapter-editor .layout-board-panel__canvas-page-header {
  color: #1d4ed8;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  text-align: center;
}
.chapter-editor .layout-board-panel__canvas {
  position: relative;
  width: min(100%, 780px);
  margin: 0 auto;
  border-radius: 22px;
  border: 1px solid #d8dee8;
  background: linear-gradient(180deg, #fffefc 0%, #f8fafc 100%);
  overflow: hidden;
  box-shadow: inset 0 0 0 18px rgba(255, 255, 255, 0.82);
}
.chapter-editor .layout-board-panel__canvas-guides::before {
  content: '';
  position: absolute;
  inset: 28px;
  border: 1px dashed rgba(59, 130, 246, 0.28);
  border-radius: 16px;
}
.chapter-editor .layout-board-panel__canvas-grid::after {
  content: '';
  position: absolute;
  inset: 28px;
  background-image: linear-gradient(to right, rgba(37, 99, 235, 0.08) 1px, transparent 1px), linear-gradient(to bottom, rgba(37, 99, 235, 0.08) 1px, transparent 1px);
  background-size: 10% 10%;
  pointer-events: none;
}
.chapter-editor .layout-board-panel__canvas-module {
  position: absolute;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid #bfdbfe;
  background: rgba(239, 246, 255, 0.96);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.1);
  text-align: left;
  cursor: grab;
  z-index: 1;
  overflow: visible;
}
.chapter-editor .layout-board-panel__canvas-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7);
}
.chapter-editor .layout-board-panel__canvas-module--image {
  border-color: #7dd3fc;
  background: linear-gradient(180deg, rgba(224, 242, 254, .98), rgba(240, 249, 255, .94));
}
.chapter-editor .layout-board-panel__canvas-module--shape,
.chapter-editor .layout-board-panel__canvas-module--cover,
.chapter-editor .layout-board-panel__canvas-module--scene,
.chapter-editor .layout-board-panel__canvas-module--quote,
.chapter-editor .layout-board-panel__canvas-module--note,
.chapter-editor .layout-board-panel__canvas-module--page-break {
  border-color: #facc15;
  background: linear-gradient(180deg, rgba(254, 243, 199, .98), rgba(255, 251, 235, .94));
}
.chapter-editor .layout-board-panel__canvas-module--icon,
.chapter-editor .layout-board-panel__canvas-module--smartart {
  border-color: #c4b5fd;
  background: linear-gradient(180deg, rgba(237, 233, 254, .98), rgba(245, 243, 255, .94));
}
.chapter-editor .layout-board-panel__canvas-module--chart,
.chapter-editor .layout-board-panel__canvas-module--snapshot {
  border-color: #86efac;
  background: linear-gradient(180deg, rgba(220, 252, 231, .98), rgba(240, 253, 244, .94));
}
.chapter-editor .layout-board-panel__canvas-module--model-3d {
  border-color: #cbd5e1;
  background: linear-gradient(180deg, rgba(241, 245, 249, .98), rgba(248, 250, 252, .94));
}
.chapter-editor .layout-board-panel__canvas-module strong {
  color: #102033;
  font-size: .88rem;
}
.chapter-editor .layout-board-panel__canvas-module em {
  color: #1d4ed8;
  font-size: .68rem;
  font-style: normal;
  font-weight: 700;
}
.chapter-editor .layout-board-panel__canvas-module span {
  color: #475569;
  font-size: .78rem;
  line-height: 1.35;
}
.chapter-editor .layout-board-panel__canvas-module-active {
  border-color: #2563eb;
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.16);
}
.chapter-editor .layout-board-panel__canvas-module-locked {
  cursor: default;
  outline: 2px dashed rgba(100, 116, 139, .32);
}
.chapter-editor .layout-board-panel__canvas-module-grouped {
  box-shadow: 0 0 0 4px rgba(168, 85, 247, .12), 0 14px 26px rgba(15, 23, 42, 0.1);
}
.chapter-editor .layout-board-panel__canvas-badge {
  justify-self: start;
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(15, 23, 42, .08);
  color: #334155 !important;
  font-size: .62rem !important;
  font-weight: 800;
  line-height: 1.2;
}
.chapter-editor .layout-board-panel__canvas-resize {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #2563eb;
  border: 2px solid #fff;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.32);
  cursor: nwse-resize;
}
.chapter-editor .layout-board-panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.chapter-editor .layout-board-panel__item {
  border-radius: 16px;
  border: 1px solid #d8dee8;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 10px;
  cursor: pointer;
}
.chapter-editor .layout-board-panel__item-active {
  border-color: #2563eb;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.12);
}
.chapter-editor .layout-board-panel__item header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}
.chapter-editor .layout-board-panel__item header strong {
  color: #102033;
}
.chapter-editor .layout-board-panel__item header span,
.chapter-editor .layout-board-panel__item p {
  color: #64748b;
  font-size: .82rem;
}
.chapter-editor .layout-board-panel__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.chapter-editor .layout-board-panel__metrics label {
  display: grid;
  gap: 4px;
  color: #475569;
  font-size: .78rem;
}
.chapter-editor .layout-board-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chapter-editor .document-preview-panel {
  border: 1px solid #d7e0ea;
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
  display: grid;
  gap: 14px;
}
.chapter-editor .document-preview-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.chapter-editor .document-preview-panel__header strong {
  color: #102033;
}
.chapter-editor .document-preview-panel__header span,
.chapter-editor .document-preview-panel__empty {
  color: #64748b;
  font-size: .84rem;
}
.chapter-editor .document-preview-panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.chapter-editor .document-preview-panel__page {
  border-radius: 16px;
  border: 1px solid #d8dee8;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
.chapter-editor .document-preview-panel__page header {
  padding: 10px 12px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: .78rem;
  font-weight: 700;
}
.chapter-editor .document-preview-panel__page-body {
  position: relative;
  padding: 16px 14px;
  max-height: 280px;
  overflow: hidden;
  font-family: Georgia, serif;
  font-size: 12px;
  line-height: 1.55;
  color: #111827;
}
.chapter-editor .document-preview-panel__layout-layer {
  position: absolute;
  inset: 12px;
  pointer-events: none;
  opacity: .92;
}
.chapter-editor .document-preview-layout-canvas {
  position: relative;
  width: 100%;
  min-height: 100%;
}
.chapter-editor .document-preview-layout-module {
  position: absolute;
  display: grid;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(37, 99, 235, 0.28);
  background: rgba(219, 234, 254, 0.6);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}
.chapter-editor .document-preview-layout-module--image {
  border-color: rgba(14, 165, 233, .34);
  background: rgba(224, 242, 254, .66);
}
.chapter-editor .document-preview-layout-module--shape,
.chapter-editor .document-preview-layout-module--cover,
.chapter-editor .document-preview-layout-module--scene,
.chapter-editor .document-preview-layout-module--quote,
.chapter-editor .document-preview-layout-module--note,
.chapter-editor .document-preview-layout-module--page-break {
  border-color: rgba(245, 158, 11, .34);
  background: rgba(254, 243, 199, .66);
}
.chapter-editor .document-preview-layout-module--icon,
.chapter-editor .document-preview-layout-module--smartart {
  border-color: rgba(124, 58, 237, .3);
  background: rgba(237, 233, 254, .66);
}
.chapter-editor .document-preview-layout-module--chart,
.chapter-editor .document-preview-layout-module--snapshot {
  border-color: rgba(22, 163, 74, .3);
  background: rgba(220, 252, 231, .66);
}
.chapter-editor .document-preview-layout-module--model-3d {
  border-color: rgba(100, 116, 139, .3);
  background: rgba(241, 245, 249, .72);
}
.chapter-editor .document-preview-layout-module strong {
  color: #1e3a8a;
  font-size: .72rem;
  line-height: 1.2;
}
.chapter-editor .document-preview-layout-module em {
  color: #2563eb;
  font-size: .62rem;
  font-style: normal;
  font-weight: 700;
}
.chapter-editor .document-preview-layout-module span {
  color: #334155;
  font-size: .64rem;
  line-height: 1.2;
}
.chapter-editor .document-preview-panel__page-body p {
  margin: 0 0 .65rem;
}
.chapter-editor .document-preview-panel__page-body h1,
.chapter-editor .document-preview-panel__page-body h2,
.chapter-editor .document-preview-panel__page-body h3 {
  font-size: 1em;
  margin: 0 0 .55rem;
}
.comment-anchor-mark {
  background: rgba(251, 191, 36, 0.28);
  border-bottom: 2px solid rgba(245, 158, 11, 0.7);
}
.comment-anchor-mark-active {
  background: rgba(59, 130, 246, 0.24) !important;
  border-bottom-color: rgba(37, 99, 235, 0.9) !important;
}
.smart-dropcap-mark {
  float: left;
  font-size: 3.2em;
  line-height: .86;
  padding-right: .12em;
  font-weight: 700;
  color: #7c2d12;
}
.chapter-editor .document-paper-chrome-pagecount {
  font-weight: 700;
}
@media print {
body * {
    visibility: hidden;
}
.document-editor-paper,
  .document-editor-paper * {
    visibility: visible;
}
.document-editor-paper {
    position: static;
    width: 100% !important;
    min-height: auto !important;
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    background: #fff !important;
}
.document-stage,
  .document-stage__sheet-wrap {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
}
.document-outline-panel,
  .document-stage__meta,
  .document-stage__top-ruler,
  .document-stage__side-ruler,
  .document-studio-panel,
  .editor-toolbar,
  .document-insert-strip,
  .metric-card,
  .chapter-poll-panel,
  .character-reference-panel,
  .poetry-card,
  .guest-write-banner,
  .publish-notice,
  .conflict-recovery-notice,
  .btn,
  small.text-muted {
    display: none !important;
}
.document-editor-paper .ProseMirror hr {
    -moz-column-break-after: page;
         break-after: page;
    page-break-after: always;
    border-top-style: solid;
    border-top-color: transparent;
    margin: 0;
    height: 0;
}
.document-editor-paper .ProseMirror hr::after {
    display: none !important;
}
}
.chapter-editor .document-stage:not(.document-stage-shadowless) .document-editor-paper {
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}
.chapter-editor .document-stage-grid .document-editor-paper {
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
}
.chapter-editor .character-reference-panel {
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%);
}
.chapter-editor .character-reference-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.chapter-editor .character-reference-panel__title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chapter-editor .character-reference-panel__title strong {
  color: #0f172a;
  font-size: .98rem;
}
.chapter-editor .character-reference-panel__title small {
  color: #475569;
  line-height: 1.45;
}
.chapter-editor .character-reference-panel__count {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: .76rem;
  font-weight: 700;
  white-space: nowrap;
}
.chapter-editor .character-reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}
.chapter-editor .character-reference-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  padding: 11px 12px;
  cursor: pointer;
}
.chapter-editor .character-reference-option input {
  margin-top: 3px;
}
.chapter-editor .character-reference-option__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.chapter-editor .character-reference-option__body strong {
  color: #0f172a;
  font-size: .92rem;
  line-height: 1.3;
}
.chapter-editor .character-reference-option__body span {
  color: #2563eb;
  font-size: .76rem;
  font-weight: 600;
}
.chapter-editor .character-reference-option__body small {
  color: #64748b;
  font-size: .76rem;
  line-height: 1.45;
}
.chapter-editor .chapter-poll-panel {
  border: 1px solid #d9e0ec;
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(180deg, #fbfdff 0%, #f3f7fb 100%);
  display: grid;
  gap: 12px;
}
.chapter-editor .chapter-poll-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.chapter-editor .chapter-poll-panel__header strong {
  display: block;
  font-size: 1rem;
  color: #102033;
}
.chapter-editor .chapter-poll-panel__header small {
  display: block;
  color: #516074;
  margin-top: 3px;
}
.chapter-editor .chapter-poll-panel__title-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.chapter-editor .chapter-poll-panel__help {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #b8c7dc;
  background: #ffffff;
  color: #1d4ed8;
  font-size: .76rem;
  font-weight: 800;
  line-height: 1;
}
.chapter-editor .chapter-poll-panel__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: #475569;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}
.chapter-editor .chapter-poll-panel__status--active {
  border-color: #99f6e4;
  background: #ccfbf1;
  color: #115e59;
}
.chapter-editor .chapter-poll-panel__toggle-button {
  min-height: 30px;
  padding: 5px 13px;
  border: 1px solid #2563eb;
  border-radius: 999px;
  background: #0d6efd;
  color: #ffffff;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}
.chapter-editor .chapter-poll-panel__toggle-button--danger {
  border-color: #fca5a5;
  background: #fff1f2;
  color: #be123c;
}
.chapter-editor .chapter-poll-panel__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  color: #314155;
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 999px;
  background: #e8eef7;
  border: 1px solid #cad7e6;
}
.chapter-editor .chapter-poll-panel__empty {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px dashed #b7c7db;
  background: rgba(255, 255, 255, .82);
}
.chapter-editor .chapter-poll-panel__empty strong {
  display: block;
  color: #102033;
  font-size: .95rem;
}
.chapter-editor .chapter-poll-panel__empty small {
  display: block;
  color: #516074;
  margin-top: 4px;
}
.chapter-editor .chapter-poll-panel__body {
  display: grid;
  gap: 12px;
}
.chapter-editor .chapter-poll-panel__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.chapter-editor .chapter-poll-panel__field {
  display: grid;
  gap: 6px;
}
.chapter-editor .chapter-poll-panel__field span,
.chapter-editor .chapter-poll-panel__checkbox,
.chapter-editor .chapter-poll-panel__actions small {
  color: #516074;
  font-size: .85rem;
}
.chapter-editor .chapter-poll-panel__checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.chapter-editor .chapter-poll-panel__options {
  display: grid;
  gap: 10px;
}
.chapter-editor .chapter-poll-panel__option-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.chapter-editor .chapter-poll-panel__option-index {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #dbe7f5;
  color: #213047;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.chapter-editor .chapter-poll-panel__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.chapter-editor .editor-toolbar .form-select {
  width: auto;
}
.chapter-editor .editor-surface {
  min-height: 380px;
  background: #fff;
}
.chapter-editor .poetry-card {
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
}
.chapter-editor .mode-switch {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.chapter-editor .poetry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chapter-editor .poetry-preview {
  position: relative;
  width: 100%;
  height: 0;
  padding-top: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #d1d5db;
  background: #ffffff;
}
.chapter-editor .poetry-pages {
  display: grid;
  gap: 10px;
}
.chapter-editor .poetry-page-item {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px;
}
.chapter-editor .poetry-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}
.chapter-editor .poetry-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  -o-object-fit: contain;
     object-fit: contain;
  background: #ffffff;
}
.chapter-editor .editor-surface:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  border-radius: 0;
  border: 0;
  padding: 18px;
}
.chapter-editor .editor-surface:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  border-radius: 0;
  border: 0;
  padding: 18px;
}
.chapter-editor .editor-toolbar .btn.active {
  background: #212529;
  color: #fff;
}
.ProseMirror {
  min-height: 340px;
  cursor: text;
  outline: none;
  color: #111827;
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-family: var(--editor-font-family, Georgia);
  font-size: var(--editor-font-size, 18px);
  line-height: var(--editor-line-height, 1.75);
}
.chapter-editor .editor-surface:fullscreen .ProseMirror {
  min-height: calc(100vh - 36px);
}
.chapter-editor .editor-surface:-webkit-full-screen .ProseMirror {
  min-height: calc(100vh - 36px);
}
.ProseMirror:focus {
  box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.35);
}
.ProseMirror p {
  margin: 0 0 var(--editor-paragraph-gap, 0.9rem);
}
.document-editor-paper .ProseMirror hr {
  border: 0;
  border-top: 2px dashed #94a3b8;
  margin: 1.6rem 0;
  position: relative;
}
.document-editor-paper .ProseMirror hr::after {
  content: 'quebra de página';
  position: absolute;
  top: -11px;
  right: 0;
  background: #fffefc;
  padding-left: 8px;
  color: #64748b;
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ProseMirror h2 {
  margin: 1rem 0 0.7rem;
}
.ProseMirror img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 12px auto;
}
@media (max-width: 991px) {
.chapter-editor .editor-topbar {
    grid-template-columns: 1fr;
}
.chapter-editor .guest-write-banner {
    flex-direction: column;
    align-items: flex-start;
}
.chapter-editor .document-studio-panel__header {
    flex-direction: column;
}
.chapter-editor .document-studio-panel__flow-header {
    align-items: flex-start;
    flex-direction: column;
}
.chapter-editor .document-studio-panel__flow-header > span {
    text-align: left;
}
.chapter-editor .document-studio-panel__flow-steps {
    grid-template-columns: 1fr;
}
.chapter-editor .document-stage,
  .chapter-editor .document-stage-rulers {
    padding: 14px;
    grid-template-columns: 1fr;
}
.chapter-editor .document-stage__top-ruler,
  .chapter-editor .document-stage__side-ruler {
    display: none;
}
.chapter-editor .document-outline-panel {
    position: static;
    order: -1;
}
.chapter-editor .character-reference-panel__header {
    flex-direction: column;
}
.chapter-editor .chapter-poll-panel__header,
  .chapter-editor .chapter-poll-panel__actions,
  .chapter-editor .chapter-poll-panel__option-row,
  .chapter-editor .chapter-poll-panel__empty {
    display: grid;
    grid-template-columns: 1fr;
}
.chapter-editor .chapter-poll-panel__empty {
    align-items: stretch;
}
.chapter-editor .chapter-poll-panel__grid {
    grid-template-columns: 1fr;
}
}
@media (max-width: 575.98px) {
.chapter-editor .layout-visual-panel {
    padding: 10px;
}
.chapter-editor .layout-visual-panel__grid,
  .chapter-editor .layout-visual-panel__grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.chapter-editor .layout-visual-tool {
    grid-template-columns: 30px 1fr;
    min-height: 58px;
    padding: 8px;
}
.chapter-editor .layout-visual-tool__icon {
    width: 30px;
    height: 30px;
}
}

/* Workspace sidebar overrides: kept at the end so legacy editor panel rules cannot override the tab state. */
.chapter-editor > .card-body {
  display: grid !important;
  grid-template-columns: minmax(286px, 340px) minmax(0, 1fr) !important;
  grid-auto-flow: row dense;
  gap: 14px 18px !important;
  align-items: start;
}
.chapter-editor .editor-topbar,
.chapter-editor .publish-notice,
.chapter-editor .conflict-recovery-notice,
.chapter-editor .guest-write-banner,
.chapter-editor .editorial-nav-banner,
.chapter-editor > .card-body > small.text-muted {
  grid-column: 1 / -1 !important;
}
.chapter-editor .editor-workbench-tabs,
.chapter-editor .poetry-card,
.chapter-editor .editor-metrics,
.chapter-editor .character-reference-panel,
.chapter-editor .chapter-poll-panel,
.chapter-editor .document-studio-panel,
.chapter-editor .editor-toolbar,
.chapter-editor .document-insert-strip,
.chapter-editor .layout-board-panel,
.chapter-editor .document-preview-panel {
  grid-column: 1 !important;
  min-width: 0;
}
.chapter-editor .writer-entry-panel {
  grid-column: 2 !important;
  grid-row: 2 !important;
}
.chapter-editor .document-stage {
  grid-column: 2 !important;
  grid-row: 3 / span 80 !important;
  min-height: calc(100vh - 190px) !important;
}
.chapter-editor .d-flex.justify-content-end.mt-2 {
  grid-column: 2 !important;
}
.chapter-editor .editor-metrics,
.chapter-editor .character-reference-panel,
.chapter-editor .chapter-poll-panel,
.chapter-editor .document-studio-panel,
.chapter-editor .editor-toolbar,
.chapter-editor .document-insert-strip,
.chapter-editor .layout-board-panel,
.chapter-editor .document-preview-panel {
  display: none !important;
}
.chapter-editor.editor-tool-tab-setup .editor-metrics {
  display: grid !important;
}
.chapter-editor.editor-tool-tab-setup .character-reference-panel,
.chapter-editor.editor-tool-tab-setup .chapter-poll-panel,
.chapter-editor.editor-tool-tab-studio .document-studio-panel,
.chapter-editor.editor-tool-tab-layout .layout-board-panel,
.chapter-editor.editor-tool-tab-preview .document-preview-panel {
  display: grid !important;
}
.chapter-editor.editor-tool-tab-format .editor-toolbar,
.chapter-editor.editor-tool-tab-format .document-insert-strip {
  display: flex !important;
}
.chapter-editor.editor-tools-collapsed > .card-body {
  grid-template-columns: minmax(148px, 180px) minmax(0, 1fr) !important;
}
.chapter-editor.editor-tools-collapsed .editor-workbench-tabs__nav,
.chapter-editor.editor-tools-collapsed .poetry-card,
.chapter-editor.editor-tools-collapsed .editor-metrics,
.chapter-editor.editor-tools-collapsed .character-reference-panel,
.chapter-editor.editor-tools-collapsed .chapter-poll-panel,
.chapter-editor.editor-tools-collapsed .document-studio-panel,
.chapter-editor.editor-tools-collapsed .editor-toolbar,
.chapter-editor.editor-tools-collapsed .document-insert-strip,
.chapter-editor.editor-tools-collapsed .layout-board-panel,
.chapter-editor.editor-tools-collapsed .document-preview-panel {
  display: none !important;
}
@media (max-width: 1180px) {
.chapter-editor > .card-body,
  .chapter-editor.editor-tools-collapsed > .card-body {
    grid-template-columns: 1fr !important;
}
.chapter-editor .editor-workbench-tabs,
  .chapter-editor .poetry-card,
  .chapter-editor .editor-metrics,
  .chapter-editor .character-reference-panel,
  .chapter-editor .chapter-poll-panel,
  .chapter-editor .document-studio-panel,
  .chapter-editor .editor-toolbar,
  .chapter-editor .document-insert-strip,
  .chapter-editor .writer-entry-panel,
  .chapter-editor .document-stage,
  .chapter-editor .layout-board-panel,
  .chapter-editor .document-preview-panel,
  .chapter-editor .d-flex.justify-content-end.mt-2 {
    grid-column: 1 !important;
    grid-row: auto !important;
}
.chapter-editor .document-stage {
    min-height: 65vh !important;
}
}
.chapter-editor .editor-workbench-tabs {
  gap: 8px !important;
}
.chapter-editor .editor-workbench-tabs__head {
  display: grid !important;
  grid-template-columns: 1fr !important;
  align-items: start !important;
  justify-items: stretch !important;
}
.chapter-editor .editor-workbench-tabs__head .btn {
  width: 100%;
  margin-top: 4px;
}
.chapter-editor .writer-entry-panel {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  min-height: 0 !important;
  padding: 7px 10px !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.82) !important;
  box-shadow: none !important;
  gap: 10px !important;
}
.chapter-editor .writer-entry-panel__copy {
  display: block !important;
  flex: 0 0 auto !important;
  min-width: 138px !important;
}
.chapter-editor .writer-entry-panel__copy span {
  display: inline-flex !important;
  color: #047857 !important;
  font-size: .72rem !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
  line-height: 1.2 !important;
  text-transform: uppercase !important;
}
.chapter-editor .writer-entry-panel__copy strong {
  display: none !important;
}
.chapter-editor .writer-entry-panel__actions {
  width: auto !important;
  flex: 1 1 auto !important;
  justify-content: flex-end !important;
  gap: 8px !important;
}
.chapter-editor .writer-entry-panel__actions .btn {
  min-height: 32px;
  padding: 5px 12px;
  font-size: .85rem;
}
.chapter-editor .document-stage {
  grid-row: 3 / span 80 !important;
  margin-top: -12px !important;
  padding-top: 12px !important;
}
.chapter-editor .document-stage-rulers {
  padding-top: 26px !important;
}
.chapter-editor .document-stage__top-ruler {
  top: 6px !important;
}
.chapter-editor.editor-tools-collapsed .document-stage {
  grid-row: 3 / span 80 !important;
}
.chapter-editor.editor-tool-tab-setup .editor-metrics,
.chapter-editor.editor-tool-tab-setup .character-reference-panel,
.chapter-editor.editor-tool-tab-setup .chapter-poll-panel,
.chapter-editor.editor-tool-tab-studio .document-studio-panel,
.chapter-editor.editor-tool-tab-format .editor-toolbar,
.chapter-editor.editor-tool-tab-format .document-insert-strip,
.chapter-editor.editor-tool-tab-layout .layout-board-panel,
.chapter-editor.editor-tool-tab-preview .document-preview-panel {
  position: sticky !important;
  top: 204px !important;
  z-index: 18 !important;
  max-height: calc(100vh - 220px) !important;
  overflow: auto !important;
}
.chapter-editor .document-stage {
  margin-top: -22px !important;
}
@media (max-width: 760px) {
.chapter-editor .writer-entry-panel {
    align-items: stretch !important;
    flex-direction: column !important;
}
.chapter-editor .writer-entry-panel__actions {
    width: 100% !important;
    justify-content: stretch !important;
}
.chapter-editor .writer-entry-panel__actions .btn {
    flex: 1 1 0 !important;
}
}
.chapter-editor .editor-workbench-tabs__nav {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 5px !important;
}
.chapter-editor .editor-workbench-tabs__tab {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 34px !important;
  padding: 6px 7px !important;
  text-align: center !important;
}
.chapter-editor .editor-workbench-tabs__tab strong {
  font-size: .78rem !important;
  line-height: 1 !important;
}
.chapter-editor .editor-workbench-tabs__tab span {
  display: none !important;
}
.chapter-editor .editor-workbench-tabs__tab.active {
  box-shadow: inset 0 -3px 0 #2563eb !important;
}
.chapter-editor.editor-tool-tab-setup .editor-metrics,
.chapter-editor.editor-tool-tab-setup .character-reference-panel,
.chapter-editor.editor-tool-tab-setup .chapter-poll-panel,
.chapter-editor.editor-tool-tab-studio .document-studio-panel,
.chapter-editor.editor-tool-tab-format .editor-toolbar,
.chapter-editor.editor-tool-tab-format .document-insert-strip,
.chapter-editor.editor-tool-tab-layout .layout-board-panel,
.chapter-editor.editor-tool-tab-preview .document-preview-panel {
  top: 126px !important;
  z-index: 18 !important;
  margin-top: 0 !important;
}
.chapter-editor .editor-workbench-tabs {
  z-index: 30 !important;
}
@media (max-width: 1180px) {
.chapter-editor .editor-workbench-tabs__nav {
    grid-template-columns: repeat(5, minmax(56px, 1fr)) !important;
    overflow-x: auto !important;
}
}


/* Keep the active left-side cards in normal flow. Multiple sticky cards shared the
   same top offset and could slide over each other below the tab bar. */
.chapter-editor.editor-tool-tab-setup .editor-metrics,
.chapter-editor.editor-tool-tab-setup .character-reference-panel,
.chapter-editor.editor-tool-tab-setup .chapter-poll-panel,
.chapter-editor.editor-tool-tab-studio .document-studio-panel,
.chapter-editor.editor-tool-tab-format .editor-toolbar,
.chapter-editor.editor-tool-tab-format .document-insert-strip,
.chapter-editor.editor-tool-tab-layout .layout-board-panel,
.chapter-editor.editor-tool-tab-preview .document-preview-panel {
  position: relative !important;
  top: auto !important;
  z-index: 12 !important;
  max-height: none !important;
  overflow: visible !important;
  margin-top: 0 !important;
}
.chapter-editor .editor-workbench-tabs {
  margin-bottom: 10px !important;
  background: rgba(255, 255, 255, 0.98) !important;
}
.chapter-editor > .card-body {
  grid-auto-flow: row !important;
}
.chapter-editor.editor-tool-tab-setup .editor-metrics {
  margin-top: 0 !important;
}
.chapter-editor.editor-tool-tab-setup .character-reference-panel,
.chapter-editor.editor-tool-tab-setup .chapter-poll-panel,
.chapter-editor.editor-tool-tab-format .document-insert-strip {
  margin-top: -2px !important;
}
.chapter-editor .editor-tools-rail {
  grid-column: 1 !important;
  grid-row: 2 / span 80 !important;
  position: sticky !important;
  top: 10px !important;
  z-index: 40 !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  max-height: calc(100vh - 24px) !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
.chapter-editor .editor-tools-rail__body {
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 10px 4px 32px 0 !important;
  scrollbar-gutter: stable !important;
}
.chapter-editor .editor-tools-rail__body > * {
  grid-column: auto !important;
}
.chapter-editor .editor-tools-rail .editor-workbench-tabs {
  position: relative !important;
  top: auto !important;
  margin-bottom: 0 !important;
  background: #fff !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .1) !important;
}
.chapter-editor .editor-tools-rail__body .editor-metrics,
.chapter-editor .editor-tools-rail__body .character-reference-panel,
.chapter-editor .editor-tools-rail__body .chapter-poll-panel,
.chapter-editor .editor-tools-rail__body .document-studio-panel,
.chapter-editor .editor-tools-rail__body .editor-toolbar,
.chapter-editor .editor-tools-rail__body .document-insert-strip,
.chapter-editor .editor-tools-rail__body .layout-board-panel,
.chapter-editor .editor-tools-rail__body .document-preview-panel {
  position: relative !important;
  top: auto !important;
  z-index: 1 !important;
  max-height: none !important;
  overflow: visible !important;
}
.chapter-editor.editor-tools-collapsed .editor-tools-rail {
  max-height: none !important;
}
.chapter-editor.editor-tools-collapsed .editor-tools-rail__body {
  display: none !important;
}
@media (max-width: 1180px) {
.chapter-editor .editor-tools-rail {
    grid-column: 1 !important;
    grid-row: auto !important;
    position: relative !important;
    top: auto !important;
    max-height: none !important;
    overflow: visible !important;
}
.chapter-editor .editor-tools-rail__body {
    max-height: 48vh !important;
}
}
.chapter-editor .document-review-panels {
  grid-column: 2 !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin-top: 4px !important;
}
.chapter-editor .document-review-panels .document-outline-panel__notes {
  margin: 0 !important;
  background: #fff !important;
}
@media (max-width: 1180px) {
.chapter-editor .document-review-panels {
    grid-column: 1 !important;
    grid-template-columns: 1fr !important;
}
}
.chapter-editor .document-preview-panel .reader-preview-mode-switch {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 6px !important;
}
.chapter-editor .document-preview-panel__mode-note {
  color: #475569 !important;
  font-size: .75rem !important;
  line-height: 1.35 !important;
}
.chapter-editor .document-preview-physical-shell {
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: 16px;
  background: #dfe7f1;
  border: 1px solid #cbd5e1;
}
.chapter-editor .document-preview-physical-pages {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}
.chapter-editor .document-preview-panel-movement-vertical .document-preview-physical-pages {
  flex-direction: column;
  align-items: center;
}
.chapter-editor .document-preview-panel-movement-side .document-preview-physical-page {
  transform-origin: top center;
}
.chapter-editor .document-preview-physical-page {
  position: relative;
  width: min(100%, 260px);
  box-sizing: border-box;
  overflow: hidden;
  color: #111827 !important;
  background: #fffefc;
  border: 1px solid rgba(100, 116, 139, .26);
  box-shadow: 0 16px 34px rgba(15, 23, 42, .16);
  font-family: var(--physical-preview-font), Georgia, serif;
  font-size: var(--physical-preview-font-size);
  line-height: var(--physical-preview-line-height);
}
.chapter-editor .document-preview-physical-content,
.chapter-editor .document-preview-physical-content * {
  color: #111827 !important;
  background: transparent !important;
  font-family: inherit !important;
}
.chapter-editor .document-preview-physical-content p {
  margin: 0 0 .7em;
}
.chapter-editor .document-preview-physical-content h1,
.chapter-editor .document-preview-physical-content h2,
.chapter-editor .document-preview-physical-content h3 {
  color: #0f172a !important;
  font-size: 1.22em;
  line-height: 1.18;
  margin: 0 0 .65em;
}
.chapter-editor .document-preview-physical-chrome {
  position: absolute;
  left: 8%;
  right: 8%;
  display: flex;
  justify-content: space-between;
  color: #64748b;
  font-size: .62rem;
  line-height: 1;
  pointer-events: none;
}
.chapter-editor .document-preview-physical-chrome-header {
  top: 3.5%;
}
.chapter-editor .document-preview-physical-chrome-footer {
  bottom: 3.5%;
}
.chapter-editor .reader-mode-preview {
  display: grid !important;
  gap: 12px !important;
}
.chapter-editor .reader-mode-preview-fluid {
  grid-template-columns: minmax(108px, .72fr) minmax(150px, 1fr) !important;
  align-items: start !important;
}
.chapter-editor .reader-mode-preview__phone,
.chapter-editor .reader-mode-preview__tablet,
.chapter-editor .reader-mode-preview__blog-page {
  border: 1px solid #cbd5e1 !important;
  border-radius: 16px !important;
  background: #fffefc !important;
  overflow: hidden !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08) !important;
}
.chapter-editor .reader-mode-preview__phone {
  max-width: 156px !important;
  aspect-ratio: 9 / 16 !important;
}
.chapter-editor .reader-mode-preview__tablet {
  min-height: 260px !important;
  aspect-ratio: 3 / 4 !important;
}
.chapter-editor .reader-mode-preview__blog-page {
  max-height: 420px !important;
  overflow-y: auto !important;
  border-radius: 8px !important;
}
.chapter-editor .reader-mode-preview__bar {
  padding: 8px 10px !important;
  background: #e0f2fe !important;
  color: #075985 !important;
  font-size: .68rem !important;
  font-weight: 800 !important;
}
.chapter-editor .reader-mode-preview__content {
  padding: 13px 12px !important;
  max-height: 360px !important;
  overflow: hidden !important;
  color: #111827 !important;
  background: #fffefc !important;
  font-family: Georgia, serif !important;
  font-size: 11px !important;
  line-height: 1.58 !important;
}
.chapter-editor .reader-mode-preview__content * {
  color: #111827 !important;
  background: transparent !important;
  font-family: inherit !important;
}
.chapter-editor .reader-mode-preview__phone .reader-mode-preview__content {
  font-size: 8px !important;
  line-height: 1.45 !important;
}
.chapter-editor .reader-mode-preview__blog-page .reader-mode-preview__content {
  max-height: none !important;
  overflow: visible !important;
  font-size: 12px !important;
  line-height: 1.72 !important;
  padding: 16px 14px 28px !important;
}
.chapter-editor .reader-mode-preview__content p {
  margin: 0 0 .7em !important;
}
.chapter-editor .reader-mode-preview__content h1,
.chapter-editor .reader-mode-preview__content h2,
.chapter-editor .reader-mode-preview__content h3 {
  color: #0f172a !important;
  font-size: 1.15em !important;
  margin: 0 0 .65em !important;
}
@media (max-width: 760px) {
.chapter-editor .reader-mode-preview-fluid,
  .chapter-editor .document-preview-panel .reader-preview-mode-switch {
    grid-template-columns: 1fr !important;
}
.chapter-editor .reader-mode-preview__phone {
    max-width: none !important;
}
}
.chapter-editor .document-preview-panel .reader-preview-mode-switch .btn {
  min-height: 30px !important;
  padding: 5px 6px !important;
  font-size: .68rem !important;
  line-height: 1.05 !important;
  white-space: nowrap !important;
}
.chapter-editor .document-preview-physical-shell {
  min-height: 270px !important;
  max-height: 360px !important;
  overflow: hidden !important;
}
.chapter-editor .document-preview-physical-page {
  width: auto !important;
  height: min(330px, calc(100vh - 260px)) !important;
  max-width: 100% !important;
  min-height: 0 !important;
}
.chapter-editor .reader-mode-preview__bar {
  display: flex !important;
  justify-content: space-between !important;
  gap: 8px !important;
}
.chapter-editor .reader-mode-preview__phone,
.chapter-editor .reader-mode-preview__tablet {
  display: flex !important;
  flex-direction: column !important;
}
.chapter-editor .reader-mode-preview__phone .reader-mode-preview__content,
.chapter-editor .reader-mode-preview__tablet .reader-mode-preview__content {
  height: calc(100% - 33px) !important;
  max-height: none !important;
  overflow: hidden !important;
}
.chapter-editor .reader-mode-preview__tablet {
  width: 100% !important;
}
.chapter-editor .document-preview-physical-page {
  width: var(--physical-preview-width, auto) !important;
  height: auto !important;
  max-width: 100% !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
  box-sizing: border-box !important;
}
.chapter-editor .document-preview-physical-shell {
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  padding: 10px !important;
}
.chapter-editor .document-preview-physical-content {
  height: 100% !important;
  overflow: hidden !important;
}
.chapter-editor .reader-mode-preview-fluid {
  grid-template-columns: 1fr !important;
}
.chapter-editor .reader-mini-reader {
  width: min(100%, 260px);
  justify-self: center;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  background: #0f172a;
  padding: 8px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .18);
}
.chapter-editor .reader-mini-reader__topbar,
.chapter-editor .reader-mini-reader__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.chapter-editor .reader-mini-reader__topbar {
  color: #e2e8f0;
  font-size: .66rem;
  font-weight: 800;
  padding: 2px 2px 7px;
}
.chapter-editor .reader-mini-reader__screen {
  height: 292px;
  overflow: hidden;
  border-radius: 12px;
  background: #fffefc;
  border: 1px solid rgba(226, 232, 240, .45);
}
.chapter-editor .reader-mini-reader__content {
  height: 100%;
  overflow: hidden;
  padding: 16px 13px;
  color: #111827 !important;
  background: #fffefc !important;
  font-family: Georgia, serif !important;
  font-size: 10.5px !important;
  line-height: 1.62 !important;
}
.chapter-editor .reader-mini-reader__content * {
  color: #111827 !important;
  background: transparent !important;
  font-family: inherit !important;
}
.chapter-editor .reader-mini-reader__content p {
  margin: 0 0 .72em !important;
}
.chapter-editor .reader-mini-reader__controls {
  padding-top: 8px;
}
.chapter-editor .reader-mini-reader__controls .btn {
  min-height: 28px !important;
  padding: 4px 8px !important;
  font-size: .68rem !important;
  background: #fff !important;
}
.chapter-editor .reader-mini-reader-real {
  width: min(100%, 340px) !important;
  overflow: hidden;
}
.chapter-editor .reader-mini-reader__topbar a {
  color: #bfdbfe !important;
  font-size: .64rem;
  text-decoration: none;
}
.chapter-editor .reader-mini-reader__frame {
  display: block;
  width: 100%;
  height: 420px;
  border: 0;
  border-radius: 12px;
  background: #edf0f5;
}
.chapter-editor .physical-snapshot-actions {
  display: grid;
  gap: 6px;
  width: 100%;
  margin-bottom: 8px;
}
.chapter-editor .physical-snapshot-actions .btn {
  min-height: 30px;
  padding: 5px 8px;
  font-size: .72rem;
}
.chapter-editor .physical-snapshot-actions span {
  color: #64748b;
  font-size: .7rem;
  line-height: 1.25;
}
.chapter-editor .editor-font-panel {
  display: none !important;
  grid-column: 1 !important;
  min-width: 0;
  padding: 10px;
  border: 1px solid #d6deea;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 251, 255, .96));
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}
.chapter-editor.editor-tool-tab-format .editor-font-panel {
  display: grid !important;
  gap: 8px;
  position: relative !important;
  z-index: 1 !important;
  margin-bottom: 10px !important;
}
.chapter-editor.editor-tools-collapsed .editor-font-panel {
  display: none !important;
}
.chapter-editor .editor-font-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px 34px 34px;
  gap: 6px;
  align-items: end;
}
.chapter-editor .editor-font-control {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.chapter-editor .editor-font-control span {
  color: #475569;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.chapter-editor .editor-font-control select {
  width: 100%;
  min-height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  font-size: .82rem;
  line-height: 1.15;
  padding: 5px 7px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .78);
}
.chapter-editor .editor-font-command-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.chapter-editor .editor-font-tool,
.chapter-editor .editor-font-color-tool {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 34px;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: linear-gradient(180deg, #ffffff, #f4f7fb);
  color: #0f172a;
  font: inherit;
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .86), 0 4px 10px rgba(15, 23, 42, .045);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, color .16s ease, transform .16s ease;
}
.chapter-editor .editor-font-tool:hover,
.chapter-editor .editor-font-tool.active,
.chapter-editor .editor-font-color-tool:hover {
  border-color: #2563eb;
  background: linear-gradient(180deg, #f8fbff, #eff6ff);
  color: #1d4ed8;
  transform: translateY(-1px);
}
.chapter-editor .editor-font-tool i,
.chapter-editor .editor-font-color-tool i {
  font-size: 1.05rem;
  line-height: 1;
}
.chapter-editor .editor-font-tool--text {
  font-size: .84rem;
}
.chapter-editor .editor-font-tool--script span {
  align-self: flex-start;
  font-size: .58rem;
  margin-left: -1px;
}
.chapter-editor .editor-font-tool--script:nth-of-type(6) span {
  align-self: flex-start;
}
.chapter-editor .editor-font-tool--script:nth-of-type(5) span {
  align-self: flex-end;
}
.chapter-editor .editor-font-color-tool input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.chapter-editor .editor-font-swatch {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 5px;
  height: 3px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .14);
}
@media (max-width: 520px) {
.chapter-editor .editor-font-topline {
    grid-template-columns: minmax(0, 1fr) 64px 34px 34px;
}
}
.chapter-editor .editor-paragraph-panel {
  display: none !important;
  grid-column: 1 !important;
  min-width: 0;
  padding: 10px 10px 8px;
  border: 1px solid #d6deea;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 251, 255, .96));
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}
.chapter-editor.editor-tool-tab-format .editor-paragraph-panel {
  display: grid !important;
  gap: 7px;
  position: relative !important;
  z-index: 1 !important;
  margin-bottom: 10px !important;
}
.chapter-editor.editor-tools-collapsed .editor-paragraph-panel {
  display: none !important;
}
.chapter-editor .editor-paragraph-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.chapter-editor .editor-paragraph-row--top {
  padding-bottom: 2px;
}
.chapter-editor .editor-paragraph-tool,
.chapter-editor .editor-paragraph-select-tool,
.chapter-editor .editor-paragraph-color-tool {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 34px;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: linear-gradient(180deg, #ffffff, #f4f7fb);
  color: #0f172a;
  font: inherit;
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .86), 0 4px 10px rgba(15, 23, 42, .045);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, color .16s ease, transform .16s ease;
}
.chapter-editor .editor-paragraph-tool--combo {
  width: 42px;
}
.chapter-editor .editor-paragraph-select-tool {
  width: 66px;
  padding: 0 4px;
}
.chapter-editor .editor-paragraph-tool:hover,
.chapter-editor .editor-paragraph-tool.active,
.chapter-editor .editor-paragraph-select-tool:hover,
.chapter-editor .editor-paragraph-color-tool:hover {
  border-color: #2563eb;
  background: linear-gradient(180deg, #f8fbff, #eff6ff);
  color: #1d4ed8;
  transform: translateY(-1px);
}
.chapter-editor .editor-paragraph-tool i,
.chapter-editor .editor-paragraph-select-tool i,
.chapter-editor .editor-paragraph-color-tool i {
  font-size: 1.05rem;
  line-height: 1;
}
.chapter-editor .editor-paragraph-tool__chevron {
  font-size: .62rem !important;
  margin-left: -1px;
}
.chapter-editor .editor-paragraph-separator {
  width: 1px;
  height: 28px;
  background: #d7e0ec;
  margin: 0 1px;
}
.chapter-editor .editor-paragraph-select-tool select {
  width: 34px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .68rem;
  font-weight: 800;
  padding: 0;
  outline: 0;
  cursor: pointer;
}
.chapter-editor .editor-paragraph-color-tool input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.chapter-editor .editor-paragraph-swatch {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 5px;
  height: 3px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .14);
}
.chapter-editor .editor-paragraph-label {
  color: #475569;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-align: center;
}
.chapter-editor .document-editor-paper-show-marks .ProseMirror p::after {
  content: ' ¶';
  color: #94a3b8;
  font-weight: 700;
}
@media (max-width: 520px) {
.chapter-editor .editor-paragraph-select-tool {
    width: 60px;
}
}
.chapter-editor .editor-paragraph-label-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 18px;
  align-items: center;
  gap: 4px;
}
.chapter-editor .editor-paragraph-launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #475569;
  cursor: pointer;
}
.chapter-editor .editor-paragraph-launcher:hover {
  background: #eff6ff;
  color: #1d4ed8;
}
.chapter-editor .editor-paragraph-launcher i {
  font-size: .72rem;
  line-height: 1;
}
.chapter-editor .editor-paragraph-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, .28);
}
.chapter-editor .editor-paragraph-dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  color: #0f172a;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}
.chapter-editor .editor-paragraph-dialog__header,
.chapter-editor .editor-paragraph-dialog__footer {
  display: grid;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}
.chapter-editor .editor-paragraph-dialog__header {
  grid-template-columns: 1fr auto;
  border-bottom: 1px solid #e2e8f0;
}
.chapter-editor .editor-paragraph-dialog__header strong {
  font-size: .92rem;
}
.chapter-editor .editor-paragraph-dialog__header div {
  display: inline-flex;
  gap: 6px;
}
.chapter-editor .editor-paragraph-dialog__ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #0f172a;
}
.chapter-editor .editor-paragraph-dialog__ghost:hover {
  background: #e2e8f0;
}
.chapter-editor .editor-paragraph-dialog__tabs {
  display: flex;
  gap: 0;
  padding: 8px 8px 0;
}
.chapter-editor .editor-paragraph-dialog__tabs button {
  min-height: 30px;
  border: 1px solid #cbd5e1;
  border-bottom: 0;
  background: #e5e7eb;
  color: #0f172a;
  font: inherit;
  font-size: .78rem;
  padding: 5px 10px;
}
.chapter-editor .editor-paragraph-dialog__tabs button.active {
  background: #ffffff;
  font-weight: 800;
}
.chapter-editor .editor-paragraph-dialog__body {
  display: grid;
  gap: 10px;
  padding: 8px 12px;
  background: #ffffff;
  border-top: 1px solid #cbd5e1;
}
.chapter-editor .editor-paragraph-dialog fieldset {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 0;
  padding: 8px 0 0;
}
.chapter-editor .editor-paragraph-dialog legend {
  width: auto;
  float: none;
  color: #0f172a;
  font-size: .78rem;
  font-weight: 800;
  padding: 0 6px 0 0;
  margin: 0;
}
.chapter-editor .editor-paragraph-dialog__grid {
  display: grid;
  gap: 8px 10px;
}
.chapter-editor .editor-paragraph-dialog__grid-general,
.chapter-editor .editor-paragraph-dialog__grid-indent,
.chapter-editor .editor-paragraph-dialog__grid-spacing {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.chapter-editor .editor-paragraph-dialog label {
  position: relative;
  display: grid;
  grid-template-columns: minmax(74px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  color: #0f172a;
  font-size: .76rem;
}
.chapter-editor .editor-paragraph-dialog label > span:first-child {
  white-space: nowrap;
}
.chapter-editor .editor-paragraph-dialog select,
.chapter-editor .editor-paragraph-dialog input[type="number"] {
  width: 100%;
  min-height: 28px;
  border: 1px solid #b8c3d1;
  border-radius: 4px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  font-size: .76rem;
  padding: 3px 6px;
}
.chapter-editor .editor-paragraph-dialog em {
  color: #475569;
  font-style: normal;
}
.chapter-editor .editor-paragraph-dialog__check,
.chapter-editor .editor-paragraph-dialog__checks .editor-paragraph-dialog__check {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 7px;
}
.chapter-editor .editor-paragraph-dialog__check input {
  flex: 0 0 auto;
}
.chapter-editor .editor-paragraph-dialog__check-wide {
  grid-column: 1 / -1;
}
.chapter-editor .editor-paragraph-dialog__check-muted {
  color: #94a3b8;
}
.chapter-editor .editor-paragraph-dialog__checks {
  display: grid;
  gap: 8px;
}
.chapter-editor .editor-paragraph-dialog__preview {
  display: grid;
  gap: 6px;
  padding: 8px 12px 12px;
  background: #ffffff;
}
.chapter-editor .editor-paragraph-dialog__preview strong {
  font-size: .78rem;
}
.chapter-editor .editor-paragraph-preview {
  min-height: 82px;
  border: 1px solid #94a3b8;
  background: #ffffff;
  padding: 10px 18px;
  font-family: Georgia, serif;
  font-size: .72rem;
  overflow: hidden;
}
.chapter-editor .editor-paragraph-preview p {
  margin: var(--paragraph-preview-before, 0) 0 var(--paragraph-preview-after, .8em);
  text-indent: var(--paragraph-preview-indent, 0);
}
.chapter-editor .editor-paragraph-preview p:first-child {
  color: #cbd5e1;
  font-size: .62rem;
}
.chapter-editor .editor-paragraph-dialog__footer {
  grid-template-columns: auto auto 1fr auto auto;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}
@media (max-width: 620px) {
.chapter-editor .editor-paragraph-dialog__grid-general,
  .chapter-editor .editor-paragraph-dialog__grid-indent,
  .chapter-editor .editor-paragraph-dialog__grid-spacing {
    grid-template-columns: 1fr;
}
.chapter-editor .editor-paragraph-dialog__footer {
    grid-template-columns: 1fr 1fr;
}
.chapter-editor .editor-paragraph-dialog__footer span {
    display: none;
}
}
.chapter-editor .editor-styles-panel {
  display: none !important;
  grid-column: 1 !important;
  min-width: 0;
  padding: 10px 10px 8px;
  border: 1px solid #d6deea;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 251, 255, .96));
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}
.chapter-editor.editor-tool-tab-format .editor-styles-panel {
  display: grid !important;
  gap: 8px;
  position: relative !important;
  z-index: 1 !important;
  margin-bottom: 10px !important;
}
.chapter-editor.editor-tools-collapsed .editor-styles-panel {
  display: none !important;
}
.chapter-editor .editor-styles-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 30px;
  gap: 6px;
  align-items: stretch;
}
.chapter-editor .editor-styles-gallery-expanded {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.chapter-editor .editor-style-tile,
.chapter-editor .editor-style-more {
  min-width: 0;
  min-height: 50px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .86), 0 4px 10px rgba(15, 23, 42, .04);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, color .16s ease, transform .16s ease;
}
.chapter-editor .editor-style-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 6px;
  text-align: center;
  overflow: hidden;
}
.chapter-editor .editor-style-tile span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .88rem;
  line-height: 1.1;
}
.chapter-editor .editor-style-tile-heading1 span,
.chapter-editor .editor-style-tile-heading2 span {
  color: #0f4c81;
  font-size: 1.05rem;
}
.chapter-editor .editor-style-tile-title span {
  font-size: 1.2rem;
}
.chapter-editor .editor-style-tile-subtitle span {
  color: #64748b;
  letter-spacing: .08em;
}
.chapter-editor .editor-style-tile-reference-subtle span,
.chapter-editor .editor-style-tile-reference-intense span {
  font-size: .72rem;
  text-transform: uppercase;
}
.chapter-editor .editor-style-tile:hover,
.chapter-editor .editor-style-tile.active,
.chapter-editor .editor-style-more:hover {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 7px 16px rgba(37, 99, 235, .12);
  transform: translateY(-1px);
}
.chapter-editor .editor-style-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
}
.chapter-editor .editor-styles-gallery-expanded .editor-style-more {
  grid-column: span 3;
  min-height: 30px;
}
.chapter-editor .editor-style-actions {
  display: grid;
  gap: 5px;
  border-top: 1px solid #e2e8f0;
  padding-top: 7px;
}
.chapter-editor .editor-style-actions button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-size: .76rem;
  font-weight: 700;
  padding: 4px 6px;
  text-align: left;
}
.chapter-editor .editor-style-actions button:hover {
  background: #eff6ff;
  color: #1d4ed8;
}
.chapter-editor .editor-style-actions i {
  font-size: 1rem;
}
.chapter-editor .editor-styles-label {
  color: #475569;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-align: center;
}
@media (max-width: 520px) {
.chapter-editor .editor-styles-gallery,
  .chapter-editor .editor-styles-gallery-expanded {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.chapter-editor .editor-styles-gallery-expanded .editor-style-more {
    grid-column: span 2;
}
}
.chapter-editor .editor-quick-tools-panel,
.chapter-editor .editor-document-blocks-panel,
.chapter-editor .editor-media-links-panel,
.chapter-editor .editor-page-text-panel,
.chapter-editor .editor-page-background-panel {
  display: none !important;
  grid-column: 1 !important;
  min-width: 0;
  padding: 10px 10px 8px;
  border: 1px solid #d6deea;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 251, 255, .96));
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}
.chapter-editor.editor-tool-tab-format .editor-quick-tools-panel,
.chapter-editor.editor-tool-tab-format .editor-document-blocks-panel,
.chapter-editor.editor-tool-tab-format .editor-media-links-panel,
.chapter-editor.editor-tool-tab-format .editor-page-text-panel,
.chapter-editor.editor-tool-tab-format .editor-page-background-panel {
  display: grid !important;
  gap: 8px;
  position: relative !important;
  z-index: 1 !important;
  margin-bottom: 10px !important;
}
.chapter-editor.editor-tools-collapsed .editor-quick-tools-panel,
.chapter-editor.editor-tools-collapsed .editor-document-blocks-panel,
.chapter-editor.editor-tools-collapsed .editor-media-links-panel,
.chapter-editor.editor-tools-collapsed .editor-page-text-panel,
.chapter-editor.editor-tools-collapsed .editor-page-background-panel {
  display: none !important;
}
.chapter-editor .editor-quick-tools-grid,
.chapter-editor .editor-document-blocks-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.chapter-editor .editor-insert-pages-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 72px;
  gap: 6px;
  align-items: stretch;
}
.chapter-editor .editor-insert-page,
.chapter-editor .editor-insert-table {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 66px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f4f7fb);
  color: #0f172a;
  font: inherit;
  font-size: .7rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .86), 0 4px 10px rgba(15, 23, 42, .045);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, color .16s ease, transform .16s ease;
}
.chapter-editor .editor-insert-page:hover,
.chapter-editor .editor-insert-table:hover {
  border-color: #2563eb;
  background: linear-gradient(180deg, #f8fbff, #eff6ff);
  color: #1d4ed8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 7px 16px rgba(37, 99, 235, .12);
  transform: translateY(-1px);
}
.chapter-editor .editor-insert-page__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72), 0 6px 14px rgba(15, 23, 42, .08);
}
.chapter-editor .editor-insert-page__icon i {
  font-size: 1.05rem;
  line-height: 1;
}
.chapter-editor .editor-insert-page__icon--cover {
  background: linear-gradient(135deg, #eff6ff, #bfdbfe);
  color: #1d4ed8;
}
.chapter-editor .editor-insert-page__icon--blank {
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  color: #475569;
}
.chapter-editor .editor-insert-page__icon--break {
  background: linear-gradient(135deg, #fff7ed, #fed7aa);
  color: #c2410c;
}
.chapter-editor .editor-insert-table__icon {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 38px;
  height: 34px;
  border: 1px solid #64748b;
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(15, 23, 42, .08);
}
.chapter-editor .editor-insert-table__icon span {
  border-right: 1px solid #94a3b8;
  border-bottom: 1px solid #94a3b8;
}
.chapter-editor .editor-insert-table__icon span:nth-child(3n) {
  border-right: 0;
}
.chapter-editor .editor-insert-table__icon span:nth-last-child(-n+3) {
  border-bottom: 0;
}
.chapter-editor .editor-quick-tool,
.chapter-editor .editor-document-block {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 58px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f4f7fb);
  color: #0f172a;
  font: inherit;
  font-size: .7rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .86), 0 4px 10px rgba(15, 23, 42, .045);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, color .16s ease, transform .16s ease, opacity .16s ease;
}
.chapter-editor .editor-quick-tool:hover,
.chapter-editor .editor-document-block:hover {
  border-color: #2563eb;
  background: linear-gradient(180deg, #f8fbff, #eff6ff);
  color: #1d4ed8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 7px 16px rgba(37, 99, 235, .12);
  transform: translateY(-1px);
}
.chapter-editor .editor-quick-tool:disabled,
.chapter-editor .editor-document-block:disabled {
  cursor: not-allowed;
  opacity: .52;
  transform: none;
}
.chapter-editor .editor-quick-tool > span:last-child,
.chapter-editor .editor-document-block > span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chapter-editor .editor-quick-tool__icon,
.chapter-editor .editor-document-block__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(15, 23, 42, .06);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72), 0 6px 14px rgba(15, 23, 42, .08);
}
.chapter-editor .editor-quick-tool__icon i,
.chapter-editor .editor-document-block__icon i {
  font-size: 1.08rem;
  line-height: 1;
}
.chapter-editor .editor-quick-tool__icon--type,
.chapter-editor .editor-document-block__icon--cover {
  background: linear-gradient(135deg, #f5f3ff, #ddd6fe);
  color: #7c3aed;
}
.chapter-editor .editor-quick-tool__icon--rule,
.chapter-editor .editor-document-block__icon--break {
  background: linear-gradient(135deg, #f8fafc, #dbe4f0);
  color: #334155;
}
.chapter-editor .editor-quick-tool__icon--link,
.chapter-editor .editor-document-block__icon--scene {
  background: linear-gradient(135deg, #ecfeff, #bae6fd);
  color: #0369a1;
}
.chapter-editor .editor-quick-tool__icon--unlink,
.chapter-editor .editor-document-block__icon--quote {
  background: linear-gradient(135deg, #fff7ed, #fed7aa);
  color: #c2410c;
}
.chapter-editor .editor-quick-tool__icon--image,
.chapter-editor .editor-document-block__icon--note {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  color: #15803d;
}
.chapter-editor .editor-quick-tool__icon--pdf,
.chapter-editor .editor-document-block__icon--comment {
  background: linear-gradient(135deg, #fff1f2, #fecdd3);
  color: #be123c;
}
.chapter-editor .editor-quick-tool__icon--history {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #b45309;
}
.chapter-editor .editor-quick-tools-hint {
  color: #64748b;
  font-size: .68rem;
  line-height: 1.25;
}
.chapter-editor .editor-quick-tools-label,
.chapter-editor .editor-document-blocks-label {
  color: #475569;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-align: center;
}
@media (max-width: 520px) {
.chapter-editor .editor-quick-tools-grid,
  .chapter-editor .editor-document-blocks-grid,
  .chapter-editor .editor-insert-pages-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
.chapter-editor .editor-page-text-groups {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: 8px;
}
.chapter-editor .editor-page-text-group {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 6px;
  min-width: 0;
  padding: 0 8px;
  border-right: 1px solid #d8dee8;
}
.chapter-editor .editor-page-text-group:last-child {
  border-right: 0;
}
.chapter-editor .editor-page-text-group__body--chrome {
  display: grid;
  gap: 5px;
}
.chapter-editor .editor-page-command {
  display: grid;
  grid-template-columns: 28px 1fr 12px;
  align-items: center;
  gap: 7px;
  min-height: 31px;
  min-width: 0;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.chapter-editor .editor-page-command:hover {
  border-color: #cbd5e1;
  background: #eff6ff;
  color: #1d4ed8;
}
.chapter-editor .editor-page-command__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  border-radius: 5px;
  background: #f8fafc;
  color: #334155;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
}
.chapter-editor .editor-page-command__icon--header {
  background: #eff6ff;
  color: #1d4ed8;
}
.chapter-editor .editor-page-command__icon--footer {
  background: #fff7ed;
  color: #c2410c;
}
.chapter-editor .editor-page-command__icon--page-number {
  background: #ecfdf5;
  color: #15803d;
}
.chapter-editor .editor-page-text-group__body--text {
  display: grid;
  grid-template-columns: minmax(76px, .82fr) minmax(112px, 1fr);
  gap: 7px;
  align-items: stretch;
}
.chapter-editor .editor-text-insert-main {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  min-height: 95px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: linear-gradient(180deg, #ffffff, #f4f7fb);
  color: #0f172a;
  font: inherit;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .86), 0 4px 10px rgba(15, 23, 42, .045);
}
.chapter-editor .editor-text-insert-main:hover,
.chapter-editor .editor-text-insert-tool:hover {
  border-color: #2563eb;
  background: linear-gradient(180deg, #f8fbff, #eff6ff);
  color: #1d4ed8;
  transform: translateY(-1px);
}
.chapter-editor .editor-text-insert-main__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 1.3rem;
}
.chapter-editor .editor-text-insert-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}
.chapter-editor .editor-text-insert-tool {
  display: grid;
  place-items: center;
  min-height: 29px;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: linear-gradient(180deg, #ffffff, #f4f7fb);
  color: #334155;
  cursor: pointer;
  font-size: 1rem;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}
.chapter-editor .editor-text-insert-tool--wordart {
  color: #1d4ed8;
  font-size: 1.15rem;
  font-style: italic;
}
.chapter-editor .editor-page-text-group__label {
  color: #475569;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-align: center;
}
@media (max-width: 520px) {
.chapter-editor .editor-page-text-groups,
  .chapter-editor .editor-page-text-group__body--text {
    grid-template-columns: 1fr;
}
.chapter-editor .editor-page-text-group {
    padding: 0;
    border-right: 0;
    border-bottom: 1px solid #d8dee8;
    padding-bottom: 8px;
}
.chapter-editor .editor-page-text-group:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
}
.chapter-editor .document-page-setup-ribbon {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid #d6deea;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 251, 255, .96));
  box-shadow: 0 10px 22px rgba(15, 23, 42, .06);
}
.chapter-editor .document-page-setup-ribbon__group {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 6px;
  min-width: 0;
  padding: 0 10px 0 0;
  border-right: 1px solid #d8dee8;
}
.chapter-editor .document-page-setup-ribbon__group:last-child {
  padding-right: 0;
  border-right: 0;
}
.chapter-editor .document-page-setup-ribbon__page-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(62px, 1fr)) minmax(118px, 1.15fr);
  grid-template-rows: auto auto auto;
  gap: 5px 6px;
}
.chapter-editor .document-page-setup-tool {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-height: 66px;
  min-width: 0;
  padding: 7px 5px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-size: .68rem;
  font-weight: 700;
  line-height: 1.05;
  cursor: pointer;
}
.chapter-editor .document-page-setup-tool:hover,
.chapter-editor .document-page-setup-row-command:hover,
.chapter-editor .document-page-setup-row-command.active {
  border-color: #cbd5e1;
  background: #eff6ff;
  color: #1d4ed8;
}
.chapter-editor .document-page-setup-tool__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 1.15rem;
}
.chapter-editor .document-page-setup-row-command {
  grid-column: 5;
  display: grid;
  grid-template-columns: 22px 1fr 10px;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  min-width: 0;
  padding: 3px 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-size: .68rem;
  text-align: left;
  cursor: pointer;
}
.chapter-editor .document-page-setup-row-command strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chapter-editor .document-page-setup-paragraph-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
  gap: 5px 8px;
  align-items: center;
}
.chapter-editor .document-page-setup-paragraph-grid > strong {
  color: #0f172a;
  font-size: .7rem;
  font-weight: 800;
}
.chapter-editor .document-page-setup-paragraph-grid label {
  display: grid;
  grid-template-columns: auto minmax(46px, 1fr) auto;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: #0f172a;
  font-size: .67rem;
}
.chapter-editor .document-page-setup-paragraph-grid label span {
  white-space: nowrap;
}
.chapter-editor .document-page-setup-paragraph-grid input {
  min-width: 0;
  height: 26px;
  border: 1px solid #b8c3d1;
  border-radius: 6px;
  padding: 2px 5px;
  font: inherit;
  font-size: .7rem;
}
.chapter-editor .document-page-setup-paragraph-grid em {
  color: #64748b;
  font-size: .66rem;
  font-style: normal;
}
.chapter-editor .document-page-setup-ribbon__label {
  color: #475569;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-align: center;
}
.chapter-editor .document-page-setup-launcher {
  position: absolute;
  right: 4px;
  bottom: 16px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 0;
  background: transparent;
  color: #475569;
  font-size: .72rem;
}
.chapter-editor .document-references-ribbon {
  display: grid;
  grid-template-columns: minmax(0, .75fr) minmax(0, 1fr) minmax(0, 1.65fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid #d6deea;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 251, 255, .96));
  box-shadow: 0 10px 22px rgba(15, 23, 42, .06);
}
.chapter-editor .document-references-ribbon__group {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 6px;
  min-width: 0;
  padding: 0 10px 0 0;
  border-right: 1px solid #d8dee8;
}
.chapter-editor .document-references-ribbon__group:last-child {
  padding-right: 0;
  border-right: 0;
}
.chapter-editor .document-references-ribbon__tools {
  display: grid;
  gap: 7px;
  min-width: 0;
}
.chapter-editor .document-references-ribbon__tools--summary,
.chapter-editor .document-references-ribbon__tools--notes {
  grid-template-columns: minmax(76px, .85fr) minmax(112px, 1.15fr);
}
.chapter-editor .document-references-ribbon__tools--bibliography {
  grid-template-columns: minmax(78px, .72fr) minmax(154px, 1.35fr) minmax(72px, .58fr);
}
.chapter-editor .document-reference-main {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  min-height: 92px;
  min-width: 0;
  padding: 8px 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1.08;
  text-align: center;
  cursor: pointer;
}
.chapter-editor .document-reference-main:hover,
.chapter-editor .document-reference-row-command:hover,
.chapter-editor .document-reference-provider:hover {
  border-color: #cbd5e1;
  background: #eff6ff;
  color: #1d4ed8;
}
.chapter-editor .document-reference-main__icon {
  display: grid;
  place-items: center;
  position: relative;
  width: 40px;
  height: 40px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 1.28rem;
}
.chapter-editor .document-reference-main--footnote .document-reference-main__icon {
  background: #f8fafc;
  color: #334155;
  font-family: Georgia, serif;
  font-size: 1.15rem;
}
.chapter-editor .document-reference-main__icon sup {
  position: absolute;
  top: 5px;
  right: 6px;
  color: #dc2626;
  font-family: Inter, system-ui, sans-serif;
  font-size: .72rem;
}
.chapter-editor .document-reference-main--citation .document-reference-main__icon {
  background: #ecfdf5;
  color: #15803d;
  border-color: #bbf7d0;
}
.chapter-editor .document-reference-stack,
.chapter-editor .document-bibliography-grid {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
}
.chapter-editor .document-reference-row-command {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 10px;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-size: .68rem;
  text-align: left;
  cursor: pointer;
}
.chapter-editor .document-reference-row-command strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chapter-editor .document-reference-row-command.muted {
  color: #94a3b8;
}
.chapter-editor .document-reference-style-select {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0 2px;
  color: #0f172a;
  font-size: .68rem;
  font-weight: 700;
}
.chapter-editor .document-reference-style-select select {
  min-width: 0;
  height: 28px;
  padding: 2px 24px 2px 7px;
  font-size: .72rem;
}
.chapter-editor .document-reference-provider {
  display: grid;
  place-items: center;
  gap: 2px;
  min-height: 92px;
  min-width: 0;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-size: .67rem;
  font-weight: 700;
  line-height: 1.08;
  text-align: center;
  cursor: pointer;
}
.chapter-editor .document-reference-provider i {
  color: #2563eb;
  font-size: 1.8rem;
  line-height: 1;
}
.chapter-editor .document-reference-provider small {
  max-width: 100%;
  overflow: hidden;
  color: #64748b;
  font-size: .6rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chapter-editor .document-references-ribbon__label {
  color: #475569;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-align: center;
}
.chapter-editor .document-view-ribbon {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, .7fr) minmax(0, .75fr) minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid #d6deea;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 251, 255, .96));
  box-shadow: 0 10px 22px rgba(15, 23, 42, .06);
}
.chapter-editor .document-view-ribbon__group {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 6px;
  min-width: 0;
  padding: 0 10px 0 0;
  border-right: 1px solid #d8dee8;
}
.chapter-editor .document-view-ribbon__group:last-child {
  padding-right: 0;
  border-right: 0;
}
.chapter-editor .document-view-ribbon__tools {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.chapter-editor .document-view-ribbon__tools--modes {
  grid-template-columns: repeat(3, minmax(54px, .8fr)) minmax(132px, 1.05fr);
}
.chapter-editor .document-view-ribbon__tools--advanced,
.chapter-editor .document-view-ribbon__tools--movement {
  grid-template-columns: repeat(2, minmax(54px, 1fr));
}
.chapter-editor .document-view-ribbon__tools--show,
.chapter-editor .document-view-ribbon__tools--zoom {
  align-content: start;
}
.chapter-editor .document-view-ribbon__tools--zoom {
  grid-template-columns: repeat(2, minmax(54px, .8fr)) minmax(112px, 1.2fr);
}
.chapter-editor .document-view-tool {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  min-height: 72px;
  min-width: 0;
  padding: 7px 5px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1.06;
  text-align: center;
  cursor: pointer;
}
.chapter-editor .document-view-tool--large {
  min-height: 86px;
}
.chapter-editor .document-view-tool:hover,
.chapter-editor .document-view-tool.active,
.chapter-editor .document-view-row-command:hover,
.chapter-editor .document-view-row-command.active {
  border-color: #cbd5e1;
  background: #eff6ff;
  color: #1d4ed8;
}
.chapter-editor .document-view-tool__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 1.08rem;
}
.chapter-editor .document-view-stack {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
}
.chapter-editor .document-view-row-command {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 28px;
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-size: .68rem;
  text-align: left;
  cursor: pointer;
}
.chapter-editor .document-view-row-command strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chapter-editor .document-view-check {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  margin: 0;
  color: #0f172a;
  font-size: .7rem;
  font-weight: 700;
  line-height: 1.1;
}
.chapter-editor .document-view-check input {
  width: 14px;
  height: 14px;
}
.chapter-editor .document-view-ribbon__label {
  overflow: hidden;
  color: #475569;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chapter-editor .document-editor-paper .ProseMirror {
  -moz-column-count: var(--editor-column-count, 1);
       column-count: var(--editor-column-count, 1);
  -moz-column-gap: 2.4rem;
       column-gap: 2.4rem;
  -webkit-hyphens: var(--editor-hyphenation, manual);
          hyphens: var(--editor-hyphenation, manual);
  overflow-wrap: break-word;
}
.chapter-editor .document-editor-paper-line-numbers .ProseMirror {
  counter-reset: editor-line;
  padding-left: 2.25rem;
}
.chapter-editor .document-editor-paper-line-numbers .ProseMirror > p,
.chapter-editor .document-editor-paper-line-numbers .ProseMirror > h1,
.chapter-editor .document-editor-paper-line-numbers .ProseMirror > h2,
.chapter-editor .document-editor-paper-line-numbers .ProseMirror > h3,
.chapter-editor .document-editor-paper-line-numbers .ProseMirror > blockquote {
  position: relative;
  counter-increment: editor-line;
}
.chapter-editor .document-editor-paper-line-numbers .ProseMirror > p::before,
.chapter-editor .document-editor-paper-line-numbers .ProseMirror > h1::before,
.chapter-editor .document-editor-paper-line-numbers .ProseMirror > h2::before,
.chapter-editor .document-editor-paper-line-numbers .ProseMirror > h3::before,
.chapter-editor .document-editor-paper-line-numbers .ProseMirror > blockquote::before {
  content: counter(editor-line);
  position: absolute;
  left: -2rem;
  top: .15em;
  color: #94a3b8;
  font-family: Inter, system-ui, sans-serif;
  font-size: .68em;
  font-weight: 700;
}
.chapter-editor .document-preview-physical-content {
  -moz-column-count: var(--physical-preview-column-count, 1) !important;
       column-count: var(--physical-preview-column-count, 1) !important;
  -moz-column-gap: .75rem !important;
       column-gap: .75rem !important;
  -webkit-hyphens: var(--physical-preview-hyphenation, manual) !important;
          hyphens: var(--physical-preview-hyphenation, manual) !important;
}
@media (max-width: 760px) {
.chapter-editor .document-page-setup-ribbon {
    grid-template-columns: 1fr;
}
.chapter-editor .document-page-setup-ribbon__group {
    padding: 0 0 8px;
    border-right: 0;
    border-bottom: 1px solid #d8dee8;
}
.chapter-editor .document-page-setup-ribbon__group:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
.chapter-editor .document-page-setup-ribbon__page-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.chapter-editor .document-page-setup-row-command {
    grid-column: auto;
}
.chapter-editor .document-page-setup-paragraph-grid {
    grid-template-columns: 1fr;
}
.chapter-editor .document-references-ribbon {
    grid-template-columns: 1fr;
}
.chapter-editor .document-references-ribbon__group {
    padding: 0 0 8px;
    border-right: 0;
    border-bottom: 1px solid #d8dee8;
}
.chapter-editor .document-references-ribbon__group:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
.chapter-editor .document-references-ribbon__tools--summary,
  .chapter-editor .document-references-ribbon__tools--notes,
  .chapter-editor .document-references-ribbon__tools--bibliography {
    grid-template-columns: 1fr;
}
.chapter-editor .document-reference-main,
  .chapter-editor .document-reference-provider {
    min-height: 64px;
}
.chapter-editor .document-view-ribbon {
    grid-template-columns: 1fr;
}
.chapter-editor .document-view-ribbon__group {
    padding: 0 0 8px;
    border-right: 0;
    border-bottom: 1px solid #d8dee8;
}
.chapter-editor .document-view-ribbon__group:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
.chapter-editor .document-view-ribbon__tools--modes,
  .chapter-editor .document-view-ribbon__tools--advanced,
  .chapter-editor .document-view-ribbon__tools--movement,
  .chapter-editor .document-view-ribbon__tools--zoom {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.chapter-editor .document-view-stack {
    grid-column: 1 / -1;
}
}
.chapter-editor .editor-page-background-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.chapter-editor .editor-page-background-tool {
  display: grid;
  grid-template-columns: 30px 1fr 10px;
  align-items: center;
  gap: 7px;
  min-height: 58px;
  min-width: 0;
  padding: 7px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: linear-gradient(180deg, #ffffff, #f4f7fb);
  color: #0f172a;
  font: inherit;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1.12;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .86), 0 4px 10px rgba(15, 23, 42, .045);
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}
.chapter-editor .editor-page-background-tool:hover {
  border-color: #2563eb;
  background: linear-gradient(180deg, #f8fbff, #eff6ff);
  color: #1d4ed8;
  transform: translateY(-1px);
}
.chapter-editor .editor-page-background-tool__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid rgba(15, 23, 42, .08);
  background: #f8fafc;
}
.chapter-editor .editor-page-background-tool__icon--watermark {
  background: #fff1f2;
  color: #be123c;
}
.chapter-editor .editor-page-background-tool__icon--color {
  background: #eff6ff;
  color: #1d4ed8;
}
.chapter-editor .editor-page-background-tool__icon--border {
  background: #fffbeb;
  color: #b45309;
}
.chapter-editor .editor-page-background-label {
  color: #475569;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-align: center;
}
.chapter-editor .document-editor-paper {
  position: relative;
  overflow: hidden;
}
.chapter-editor .document-page-watermark,
.chapter-editor .document-preview-physical-watermark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: rgba(15, 23, 42, .12);
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  transform: rotate(-32deg);
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  z-index: 0;
}
.chapter-editor .document-page-watermark {
  font-size: clamp(3rem, 9vw, 7rem);
}
.chapter-editor .document-preview-physical-watermark {
  font-size: 1.35rem;
}
.chapter-editor .document-paper-chrome,
.chapter-editor .document-editor-paper .ProseMirror,
.chapter-editor .document-editor-paper__comment-compose {
  position: relative;
  z-index: 1;
}
.chapter-editor .document-preview-physical-page {
  position: relative;
  overflow: hidden;
}
.chapter-editor .document-preview-physical-chrome,
.chapter-editor .document-preview-physical-content {
  position: relative;
  z-index: 1;
}
.chapter-editor .document-preview-panel__layout-layer {
  z-index: 1;
}
@media (max-width: 520px) {
.chapter-editor .editor-page-background-grid {
    grid-template-columns: 1fr;
}
}
.chapter-editor .editor-media-links-groups {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 8px;
}
.chapter-editor .editor-media-links-group {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 6px;
  min-width: 0;
  padding: 0 8px;
  border-right: 1px solid #d8dee8;
}
.chapter-editor .editor-media-links-group:last-child {
  border-right: 0;
}
.chapter-editor .editor-media-links-group__body--media {
  display: grid;
  grid-template-columns: minmax(72px, .8fr) minmax(80px, 1fr);
  gap: 6px;
  align-items: stretch;
}
.chapter-editor .editor-media-links-stack {
  display: grid;
  gap: 6px;
}
.chapter-editor .editor-media-links-group__body--links {
  display: grid;
  gap: 5px;
}
.chapter-editor .editor-media-tool,
.chapter-editor .editor-link-command {
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f4f7fb);
  color: #0f172a;
  font: inherit;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1.1;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .86), 0 4px 10px rgba(15, 23, 42, .045);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, color .16s ease, transform .16s ease, opacity .16s ease;
}
.chapter-editor .editor-media-tool:hover,
.chapter-editor .editor-link-command:hover {
  border-color: #2563eb;
  background: linear-gradient(180deg, #f8fbff, #eff6ff);
  color: #1d4ed8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 7px 16px rgba(37, 99, 235, .12);
  transform: translateY(-1px);
}
.chapter-editor .editor-media-tool:disabled,
.chapter-editor .editor-link-command:disabled {
  cursor: not-allowed;
  opacity: .52;
  transform: none;
}
.chapter-editor .editor-media-tool {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  text-align: center;
  padding: 8px;
}
.chapter-editor .editor-media-tool--tall {
  min-height: 88px;
}
.chapter-editor .editor-media-tool--small {
  min-height: 41px;
  grid-template-columns: 28px 1fr;
  justify-items: start;
  align-items: center;
  text-align: left;
}
.chapter-editor .editor-link-command {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 31px;
  padding: 5px 8px;
  text-align: left;
}
.chapter-editor .editor-link-command--muted {
  color: #475569;
}
.chapter-editor .editor-media-tool__icon,
.chapter-editor .editor-link-command__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(15, 23, 42, .06);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72), 0 6px 14px rgba(15, 23, 42, .08);
}
.chapter-editor .editor-media-tool__icon--video {
  background: linear-gradient(135deg, #eff6ff, #bfdbfe);
  color: #1d4ed8;
}
.chapter-editor .editor-media-tool__icon--image,
.chapter-editor .editor-link-command__icon--bookmark {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  color: #15803d;
}
.chapter-editor .editor-media-tool__icon--pdf,
.chapter-editor .editor-link-command__icon--reference {
  background: linear-gradient(135deg, #fff1f2, #fecdd3);
  color: #be123c;
}
.chapter-editor .editor-link-command__icon--link {
  background: linear-gradient(135deg, #ecfeff, #bae6fd);
  color: #0369a1;
}
.chapter-editor .editor-link-command__icon--unlink {
  background: linear-gradient(135deg, #fff7ed, #fed7aa);
  color: #c2410c;
}
.chapter-editor .editor-media-links-group__label {
  color: #475569;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-align: center;
}
.chapter-editor .editor-media-links-hint {
  color: #64748b;
  font-size: .68rem;
  line-height: 1.25;
}
.chapter-editor .document-editor-paper .ProseMirror .editor-bookmark-anchor {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 2px;
  padding: 1px 6px;
  border: 1px solid #93c5fd;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-family: Inter, system-ui, sans-serif;
  font-size: .72em;
  font-weight: 800;
  line-height: 1.45;
  vertical-align: baseline;
}
.chapter-editor .document-editor-paper .ProseMirror .editor-bookmark-anchor__hash {
  color: #0369a1;
}
.chapter-editor .document-editor-paper .ProseMirror .editor-document-summary {
  margin: 1rem 0 1.2rem;
  padding: 14px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  -moz-column-break-inside: avoid;
       break-inside: avoid;
}
.chapter-editor .document-editor-paper .ProseMirror .editor-document-summary__title {
  display: block;
  margin-bottom: .6rem;
  color: #0f172a;
  font-family: Inter, system-ui, sans-serif;
  font-size: .82rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.chapter-editor .document-editor-paper .ProseMirror .editor-document-summary__list {
  display: grid;
  gap: .28rem;
  margin: 0;
  padding-left: 1.2rem;
}
.chapter-editor .document-editor-paper .ProseMirror .editor-document-summary__item {
  color: #334155;
  font-size: .95em;
  line-height: 1.28;
}
.chapter-editor .document-editor-paper .ProseMirror .editor-document-summary__item--long {
  font-size: .82em;
  line-height: 1.22;
}
.chapter-editor .document-editor-paper .ProseMirror .editor-document-summary__item span {
  overflow-wrap: anywhere;
}
.chapter-editor .document-editor-paper .ProseMirror .editor-document-summary__item--level-2 {
  margin-left: .75rem;
}
.chapter-editor .document-editor-paper .ProseMirror .editor-document-summary__item--level-3,
.chapter-editor .document-editor-paper .ProseMirror .editor-document-summary__item--level-4,
.chapter-editor .document-editor-paper .ProseMirror .editor-document-summary__item--level-5,
.chapter-editor .document-editor-paper .ProseMirror .editor-document-summary__item--level-6 {
  margin-left: 1.4rem;
}
.chapter-editor .document-editor-paper .ProseMirror .editor-document-summary__item em {
  margin-left: .45rem;
  color: #94a3b8;
  font-family: Inter, system-ui, sans-serif;
  font-size: .68em;
  font-style: normal;
  font-weight: 800;
}
.chapter-editor .document-editor-paper .ProseMirror .editor-document-summary__empty {
  margin: 0;
  color: #64748b;
  font-family: Inter, system-ui, sans-serif;
  font-size: .86rem;
}
.chapter-editor .document-editor-paper .ProseMirror .editor-footnote-reference {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25em;
  min-height: 1.25em;
  margin: 0 1px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-family: Inter, system-ui, sans-serif;
  font-size: .62em;
  font-weight: 900;
  line-height: 1;
  cursor: help;
  vertical-align: super;
}
.chapter-editor .document-editor-paper .ProseMirror .editor-footnote-reference-active {
  background: #fef3c7 !important;
  color: #92400e !important;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .18);
}
.chapter-editor .document-editor-paper .ProseMirror .editor-online-video {
  margin: 1rem 0;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  overflow: hidden;
}
.chapter-editor .document-editor-paper .ProseMirror .editor-online-video__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f172a;
}
.chapter-editor .document-editor-paper .ProseMirror .editor-online-video iframe,
.chapter-editor .document-editor-paper .ProseMirror .editor-online-video__frame a {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.chapter-editor .document-editor-paper .ProseMirror .editor-online-video iframe {
  border: 0;
}
.chapter-editor .document-editor-paper .ProseMirror .editor-online-video__frame a {
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}
.chapter-editor .document-editor-paper .ProseMirror .editor-online-video figcaption {
  margin: 0;
  padding: 8px 10px;
  color: #334155;
  font-size: .8rem;
  font-weight: 700;
}
@media (max-width: 520px) {
.chapter-editor .editor-media-links-groups,
  .chapter-editor .editor-media-links-group__body--media {
    grid-template-columns: 1fr;
}
.chapter-editor .editor-media-links-group {
    padding: 0;
    border-right: 0;
    border-bottom: 1px solid #d8dee8;
    padding-bottom: 8px;
}
.chapter-editor .editor-media-links-group:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
}
.chapter-editor .editor-clipboard-panel {
  display: none !important;
  grid-column: 1 !important;
  min-width: 0;
  position: relative;
  padding: 10px;
  border: 1px solid #d6deea;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 251, 255, .96));
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}
.chapter-editor.editor-tool-tab-format .editor-clipboard-panel {
  display: grid !important;
  gap: 10px;
  position: relative !important;
  top: auto !important;
  z-index: 1 !important;
  max-height: none !important;
  overflow: visible !important;
  margin-top: 0 !important;
  margin-bottom: 10px !important;
}
.chapter-editor.editor-tools-collapsed .editor-clipboard-panel {
  display: none !important;
}
.chapter-editor .editor-clipboard-row {
  display: grid;
  grid-template-columns: minmax(76px, 1.35fr) repeat(3, minmax(54px, .9fr));
  gap: 6px;
  align-items: stretch;
}
.chapter-editor .editor-paste-combo {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px;
  min-width: 0;
}
.chapter-editor .editor-clipboard-button,
.chapter-editor .editor-clipboard-arrow {
  min-height: 48px;
  border: 1px solid #cbd5e1;
  background: linear-gradient(180deg, #ffffff, #f4f7fb);
  color: #0f172a;
  font: inherit;
  font-size: .73rem;
  font-weight: 800;
  line-height: 1.12;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .86), 0 4px 10px rgba(15, 23, 42, .045);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, color .16s ease, transform .16s ease;
}
.chapter-editor .editor-clipboard-button {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  padding: 6px 5px;
  border-radius: 10px;
}
.chapter-editor .editor-clipboard-button-main {
  min-height: 54px;
}
.chapter-editor .editor-paste-combo .editor-clipboard-button {
  border-radius: 10px 0 0 10px;
  border-right: 0;
}
.chapter-editor .editor-clipboard-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 10px 10px 0;
  padding: 0;
}
.chapter-editor .editor-clipboard-arrow i {
  font-size: .82rem;
  line-height: 1;
}
.chapter-editor .editor-clipboard-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(15, 23, 42, .06);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72), 0 6px 14px rgba(15, 23, 42, .08);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.chapter-editor .editor-clipboard-button-main .editor-clipboard-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}
.chapter-editor .editor-clipboard-icon i {
  font-size: 1.08rem;
  line-height: 1;
}
.chapter-editor .editor-clipboard-icon--paste {
  background: linear-gradient(135deg, #fff7ed, #fed7aa);
  color: #c2410c;
}
.chapter-editor .editor-clipboard-icon--cut {
  background: linear-gradient(135deg, #fff1f2, #fecdd3);
  color: #be123c;
}
.chapter-editor .editor-clipboard-icon--copy {
  background: linear-gradient(135deg, #ecfeff, #bae6fd);
  color: #0369a1;
}
.chapter-editor .editor-clipboard-icon--brush {
  background: linear-gradient(135deg, #f5f3ff, #ddd6fe);
  color: #7c3aed;
}
.chapter-editor .editor-clipboard-button > span:not(.editor-clipboard-icon) {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chapter-editor .editor-clipboard-button:hover,
.chapter-editor .editor-clipboard-arrow:hover,
.chapter-editor .editor-clipboard-button.active {
  border-color: #2563eb;
  background: linear-gradient(180deg, #f8fbff, #eff6ff);
  color: #1d4ed8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 7px 16px rgba(37, 99, 235, .12);
  transform: translateY(-1px);
}
.chapter-editor .editor-clipboard-button:hover .editor-clipboard-icon,
.chapter-editor .editor-clipboard-button.active .editor-clipboard-icon {
  filter: saturate(1.08);
  transform: translateY(-1px);
}
.chapter-editor .editor-clipboard-button.active .editor-clipboard-icon--brush {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72), 0 0 0 3px rgba(124, 58, 237, .16), 0 8px 16px rgba(124, 58, 237, .15);
}
.chapter-editor .editor-paste-menu {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
}
.chapter-editor .editor-paste-menu strong {
  color: #0f172a;
  font-size: .82rem;
  padding: 4px 6px 6px;
}
.chapter-editor .editor-paste-menu button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #1f2937;
  font: inherit;
  font-size: .82rem;
  text-align: left;
  padding: 7px 8px;
}
.chapter-editor .editor-paste-menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
  transition: transform .16s ease, filter .16s ease;
}
.chapter-editor .editor-paste-menu-icon i {
  font-size: .95rem;
  line-height: 1;
}
.chapter-editor .editor-paste-menu-icon--paste {
  background: #ffedd5;
  color: #c2410c;
}
.chapter-editor .editor-paste-menu-icon--merge {
  background: #dcfce7;
  color: #15803d;
}
.chapter-editor .editor-paste-menu-icon--text {
  background: #e0f2fe;
  color: #0369a1;
}
.chapter-editor .editor-paste-menu-icon--start {
  background: #fef3c7;
  color: #b45309;
}
.chapter-editor .editor-paste-menu-icon--settings {
  background: #ede9fe;
  color: #6d28d9;
}
.chapter-editor .editor-paste-menu button:hover {
  background: #eff6ff;
  color: #1d4ed8;
}
.chapter-editor .editor-paste-menu button:hover .editor-paste-menu-icon {
  filter: saturate(1.08);
  transform: translateY(-1px);
}
.chapter-editor .editor-paste-menu hr {
  width: 100%;
  margin: 5px 0;
  border: 0;
  border-top: 1px solid #e2e8f0;
}
.chapter-editor .editor-clipboard-advanced {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  background: #f8fafc;
}
.chapter-editor .editor-clipboard-advanced strong,
.chapter-editor .editor-clipboard-advanced span {
  display: block;
}
.chapter-editor .editor-clipboard-advanced strong {
  color: #0f172a;
  font-size: .9rem;
}
.chapter-editor .editor-clipboard-advanced span {
  color: #475569;
  font-size: .78rem;
  line-height: 1.35;
}
.chapter-editor .editor-clipboard-advanced label {
  display: grid;
  gap: 5px;
}
.chapter-editor .editor-clipboard-advanced select {
  width: 100%;
  min-height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  padding: 5px 8px;
  font-size: .84rem;
}
.chapter-editor .editor-clipboard-advanced-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
@media (max-width: 1180px) {
.chapter-editor .editor-clipboard-panel {
    grid-column: 1 !important;
    grid-row: auto !important;
}
}
@media (max-width: 520px) {
.chapter-editor .editor-clipboard-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
@media (max-width: 820px) {
.editor-v4-page {
    padding: 0 !important;
    overflow-x: hidden;
}
.editor-v4-page > .d-flex {
    padding: 10px 12px !important;
    margin: 0 !important;
}
.editor-v4-page h3 {
    max-width: 100%;
    font-size: 1rem !important;
    line-height: 1.25;
}
.chapter-editor.card {
    width: 100%;
    min-width: 0;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow-x: hidden;
}
.chapter-editor > .card-body,
  .chapter-editor.editor-tools-collapsed > .card-body {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 8px !important;
}
.chapter-editor .editor-topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(82px, 104px);
    gap: 8px !important;
    width: auto !important;
    margin: -8px -8px 8px !important;
    padding: 8px !important;
    background: rgba(248, 250, 252, .98);
    border-bottom: 1px solid #d9e2ef;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}
.chapter-editor .editor-topbar > input:first-child,
  .chapter-editor .editor-topbar .publish-controls,
  .chapter-editor .editor-topbar .construction-switch {
    grid-column: 1 / -1;
}
.chapter-editor .editor-topbar .btn,
  .chapter-editor .editor-topbar .form-control,
  .chapter-editor .editor-topbar .form-select {
    width: 100%;
    min-height: 40px;
    padding-inline: 10px;
    font-size: .84rem;
    white-space: normal;
}
.chapter-editor .publish-controls,
  .chapter-editor .publish-controls--scheduled,
  .chapter-editor .construction-switch {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
}
.chapter-editor .guest-write-banner,
  .chapter-editor .editorial-nav-banner,
  .chapter-editor .publish-notice,
  .chapter-editor .conflict-recovery-notice {
    grid-template-columns: 1fr !important;
    margin-inline: 0 !important;
}
.chapter-editor .editor-tools-rail {
    position: relative !important;
    top: auto !important;
    z-index: 20;
    width: 100% !important;
    min-width: 0 !important;
    max-height: none !important;
    padding: 8px !important;
    border-radius: 14px !important;
    border: 1px solid #d9e2ef !important;
    background: #ffffff !important;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .08) !important;
    overflow: visible !important;
}
.chapter-editor .editor-workbench-tabs {
    gap: 8px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
.chapter-editor .editor-workbench-tabs__head {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center;
    gap: 8px !important;
}
.chapter-editor .editor-workbench-tabs__head .btn {
    width: auto !important;
    min-height: 34px;
    padding-inline: 10px;
}
.chapter-editor .editor-workbench-tabs__nav {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 6px !important;
    width: 100%;
    overflow-x: auto;
    padding: 2px 0 4px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.chapter-editor .editor-workbench-tabs__tab {
    flex: 0 0 auto;
    min-width: 78px !important;
    min-height: 38px !important;
    padding: 7px 10px !important;
    scroll-snap-align: start;
}
.chapter-editor .editor-tools-rail__body {
    max-height: 42vh !important;
    padding: 8px 0 2px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
}
.chapter-editor.editor-tools-collapsed .editor-tools-rail__body {
    display: none !important;
}
.chapter-editor .document-studio-panel,
  .chapter-editor .editor-toolbar,
  .chapter-editor .document-preview-panel,
  .chapter-editor .layout-board-panel,
  .chapter-editor .character-reference-panel,
  .chapter-editor .chapter-poll-panel,
  .chapter-editor .editor-metrics {
    width: 100% !important;
    min-width: 0 !important;
    margin-bottom: 10px !important;
}
.chapter-editor .document-studio-panel__header,
  .chapter-editor .document-studio-panel__flow-header,
  .chapter-editor .document-studio-panel__hero,
  .chapter-editor .document-preview-panel__header,
  .chapter-editor .layout-visual-panel__header,
  .chapter-editor .reader-mini-reader__topbar {
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
    gap: 8px !important;
}
.chapter-editor .document-studio-panel__modes,
  .chapter-editor .reader-preview-mode-switch,
  .chapter-editor .document-view-ribbon__tools,
  .chapter-editor .document-page-setup-ribbon,
  .chapter-editor .document-page-setup-ribbon__controls,
  .chapter-editor .document-studio-panel__toggles,
  .chapter-editor .document-studio-panel__finish-grid,
  .chapter-editor .document-studio-panel__metrics,
  .chapter-editor .document-review-panels,
  .chapter-editor .layout-vector-ribbon,
  .chapter-editor .layout-object-workbench,
  .chapter-editor .chapter-poll-panel__option-row {
    grid-template-columns: 1fr !important;
}
.chapter-editor .document-studio-panel__modes,
  .chapter-editor .reader-preview-mode-switch {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
}
.chapter-editor .document-studio-panel__modes .btn,
  .chapter-editor .reader-preview-mode-switch .btn,
  .chapter-editor .document-view-tool {
    width: 100% !important;
    min-width: 0 !important;
}
.chapter-editor .writer-entry-panel {
    width: 100% !important;
    margin: 0 !important;
    padding: 12px !important;
    border-radius: 16px !important;
}
.chapter-editor .writer-entry-panel__actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100%;
}
.chapter-editor .document-stage {
    width: 100% !important;
    min-width: 0 !important;
    min-height: calc(100dvh - 220px) !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 8px !important;
    border-radius: 16px !important;
    overflow: visible !important;
}
.chapter-editor .document-outline-panel {
    width: 100% !important;
    max-height: 32vh;
    overflow-y: auto;
}
.chapter-editor .document-stage__sheet-wrap {
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    justify-content: stretch !important;
    gap: 8px !important;
}
.chapter-editor .document-stage__meta {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    width: 100%;
    overflow-x: auto;
    gap: 6px !important;
    padding-bottom: 2px;
}
.chapter-editor .document-stage__meta span {
    flex: 0 0 auto;
    font-size: .68rem !important;
}
.chapter-editor .document-editor-paper {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: calc(100dvh - 310px) !important;
    padding: 22px 16px 30px !important;
    border-radius: 16px !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .12) !important;
}
.chapter-editor .document-editor-paper .ProseMirror {
    min-height: calc(100dvh - 390px) !important;
    font-size: 16px !important;
    line-height: 1.72 !important;
}
.chapter-editor .document-editor-paper .ProseMirror * {
    max-width: 100%;
}
.chapter-editor .document-paper-chrome,
  .chapter-editor .document-editor-paper__comment-compose {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
}
.chapter-editor .document-paper-ruler {
    display: none !important;
}
.chapter-editor .reader-mode-preview,
  .chapter-editor .reader-mini-reader,
  .chapter-editor .reader-mini-reader-real,
  .chapter-editor .document-preview-physical-shell {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
}
.chapter-editor input,
  .chapter-editor select,
  .chapter-editor textarea,
  .chapter-editor button {
    max-width: 100%;
}
}
@media (max-width: 520px) {
.chapter-editor .document-studio-panel__modes,
  .chapter-editor .reader-preview-mode-switch {
    grid-template-columns: 1fr !important;
}
.chapter-editor .document-editor-paper {
    min-height: calc(100dvh - 280px) !important;
    padding-inline: 14px !important;
}
.chapter-editor .document-editor-paper .ProseMirror {
    min-height: calc(100dvh - 360px) !important;
}
}

/* Unified Office-style ribbon: replaces the former left rail while preserving every tool group. */
.chapter-editor > .card-body {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-auto-flow: row !important;
  gap: 10px !important;
  padding: 0 !important;
}
.chapter-editor .editor-topbar,
.chapter-editor .publish-notice,
.chapter-editor .conflict-recovery-notice,
.chapter-editor .guest-write-banner,
.chapter-editor .editorial-nav-banner,
.chapter-editor .editor-tools-rail,
.chapter-editor .writer-entry-panel,
.chapter-editor .document-stage,
.chapter-editor .document-review-panels,
.chapter-editor .d-flex.justify-content-end.mt-2,
.chapter-editor > .card-body > small.text-muted {
  grid-column: 1 / -1 !important;
  grid-row: auto !important;
}
.chapter-editor .editor-topbar {
  grid-row: 1 !important;
  order: 1;
  margin: 0 !important;
  padding: 10px clamp(10px, 1.6vw, 18px) !important;
  background: #3f3d43 !important;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.chapter-editor .editor-tools-rail {
  grid-row: 2 !important;
  order: 2;
  position: sticky !important;
  top: 0 !important;
  z-index: 70 !important;
  display: grid !important;
  grid-template-rows: auto auto !important;
  width: 100% !important;
  min-width: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #dedfe3 !important;
  box-shadow: 0 12px 22px rgba(15, 23, 42, .14) !important;
}
.chapter-editor .editor-workbench-tabs {
  position: relative !important;
  top: auto !important;
  z-index: 2 !important;
  display: grid !important;
  gap: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #4d4a51 !important;
  box-shadow: none !important;
}
.chapter-editor .editor-workbench-tabs__head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  min-height: 34px;
  padding: 5px 10px 3px !important;
  color: #ffffff;
}
.chapter-editor .editor-workbench-tabs__brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.chapter-editor .editor-workbench-tabs__brand strong {
  color: #ffffff !important;
  font-size: .88rem !important;
  line-height: 1 !important;
  white-space: nowrap;
}
.chapter-editor .editor-workbench-tabs__brand span {
  display: inline !important;
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, .72) !important;
  font-size: .72rem !important;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chapter-editor .editor-ribbon-toggle {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px;
  min-height: 27px !important;
  width: auto !important;
  padding: 4px 9px !important;
  border-color: rgba(255, 255, 255, .28) !important;
  background: rgba(255, 255, 255, .08) !important;
  color: #ffffff !important;
  font-size: .72rem !important;
}
.chapter-editor .editor-workbench-tabs__nav {
  display: flex !important;
  grid-template-columns: none !important;
  gap: 0 !important;
  min-width: 0;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 0 8px !important;
  background: #4d4a51;
  scrollbar-width: thin;
}
.chapter-editor .editor-workbench-tabs__tab {
  flex: 0 0 auto !important;
  width: auto !important;
  display: grid !important;
  align-content: center !important;
  justify-items: center !important;
  min-width: 92px !important;
  min-height: 34px !important;
  padding: 6px 11px 7px !important;
  border: 0 !important;
  border-radius: 5px 5px 0 0 !important;
  background: transparent !important;
  color: rgba(255, 255, 255, .88) !important;
  box-shadow: none !important;
  text-align: center !important;
}
.chapter-editor .editor-workbench-tabs__tab strong {
  color: inherit !important;
  font-size: .78rem !important;
  line-height: 1.05 !important;
}
.chapter-editor .editor-workbench-tabs__tab span {
  display: none !important;
}
.chapter-editor .editor-workbench-tabs__tab.active {
  background: #dedfe3 !important;
  color: #111827 !important;
  box-shadow: inset 0 3px 0 #2563eb !important;
}
.chapter-editor .editor-tools-rail__body {
  display: flex !important;
  align-items: stretch !important;
  gap: 0 !important;
  min-height: 0 !important;
  max-height: min(46vh, 380px) !important;
  padding: 8px 8px 9px !important;
  overflow-x: auto !important;
  overflow-y: auto !important;
  background: #dedfe3 !important;
  border-bottom: 1px solid #b8bec8;
  scrollbar-gutter: stable;
}
.chapter-editor.editor-tools-collapsed .editor-tools-rail__body {
  display: none !important;
}
.chapter-editor .editor-tools-rail__body > * {
  grid-column: auto !important;
}
.chapter-editor .editor-tools-rail__body .editor-metrics,
.chapter-editor .editor-tools-rail__body .character-reference-panel,
.chapter-editor .editor-tools-rail__body .chapter-poll-panel,
.chapter-editor .editor-tools-rail__body .document-studio-panel,
.chapter-editor .editor-tools-rail__body .editor-clipboard-panel,
.chapter-editor .editor-tools-rail__body .editor-font-panel,
.chapter-editor .editor-tools-rail__body .editor-paragraph-panel,
.chapter-editor .editor-tools-rail__body .editor-styles-panel,
.chapter-editor .editor-tools-rail__body .editor-quick-tools-panel,
.chapter-editor .editor-tools-rail__body .editor-document-blocks-panel,
.chapter-editor .editor-tools-rail__body .editor-media-links-panel,
.chapter-editor .editor-tools-rail__body .editor-page-text-panel,
.chapter-editor .editor-tools-rail__body .editor-page-background-panel,
.chapter-editor .editor-tools-rail__body .layout-board-panel,
.chapter-editor .editor-tools-rail__body .document-preview-panel {
  display: none !important;
  flex: 0 0 auto;
  min-width: 0;
  max-height: none !important;
  margin: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  border-right: 1px solid #b7bcc5 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.chapter-editor.editor-tool-tab-setup .editor-tools-rail__body .editor-metrics,
.chapter-editor.editor-tool-tab-setup .editor-tools-rail__body .character-reference-panel,
.chapter-editor.editor-tool-tab-setup .editor-tools-rail__body .chapter-poll-panel {
  display: grid !important;
}
.chapter-editor.editor-tool-tab-format .editor-tools-rail__body .editor-clipboard-panel,
.chapter-editor.editor-tool-tab-format .editor-tools-rail__body .editor-font-panel,
.chapter-editor.editor-tool-tab-format .editor-tools-rail__body .editor-paragraph-panel,
.chapter-editor.editor-tool-tab-format .editor-tools-rail__body .editor-styles-panel,
.chapter-editor.editor-tool-tab-format .editor-tools-rail__body .editor-quick-tools-panel {
  display: grid !important;
}
.chapter-editor.editor-tool-tab-insert .editor-tools-rail__body .editor-document-blocks-panel,
.chapter-editor.editor-tool-tab-insert .editor-tools-rail__body .editor-media-links-panel,
.chapter-editor.editor-tool-tab-insert .editor-tools-rail__body .editor-page-text-panel,
.chapter-editor.editor-tool-tab-insert .editor-tools-rail__body .editor-page-background-panel {
  display: grid !important;
}
.chapter-editor.editor-tool-tab-studio .editor-tools-rail__body .document-studio-panel,
.chapter-editor.editor-tool-tab-layout .editor-tools-rail__body .document-studio-panel,
.chapter-editor.editor-tool-tab-layout .editor-tools-rail__body .layout-board-panel,
.chapter-editor.editor-tool-tab-references .editor-tools-rail__body .document-studio-panel,
.chapter-editor.editor-tool-tab-view .editor-tools-rail__body .document-studio-panel,
.chapter-editor.editor-tool-tab-view .editor-tools-rail__body .document-preview-panel,
.chapter-editor.editor-tool-tab-preview .editor-tools-rail__body .document-preview-panel {
  display: grid !important;
}
.chapter-editor.editor-tool-tab-layout .document-studio-panel > *,
.chapter-editor.editor-tool-tab-references .document-studio-panel > *,
.chapter-editor.editor-tool-tab-view .document-studio-panel > * {
  display: none !important;
}
.chapter-editor.editor-tool-tab-layout .document-studio-panel > .document-page-setup-ribbon,
.chapter-editor.editor-tool-tab-layout .document-studio-panel > .document-studio-panel__controls-margins,
.chapter-editor.editor-tool-tab-references .document-studio-panel > .document-references-ribbon,
.chapter-editor.editor-tool-tab-view .document-studio-panel > .document-view-ribbon,
.chapter-editor.editor-tool-tab-view .document-studio-panel > .document-studio-panel__toggles {
  display: flex !important;
}
.chapter-editor.editor-tool-tab-layout .document-studio-panel > .document-studio-panel__controls-margins {
  display: grid !important;
}
.chapter-editor .editor-tools-rail__body .editor-metrics {
  width: min(760px, 90vw);
  grid-template-columns: repeat(4, minmax(138px, 1fr));
  gap: 7px;
  padding: 0 10px 0 2px;
}
.chapter-editor .editor-tools-rail__body .character-reference-panel,
.chapter-editor .editor-tools-rail__body .chapter-poll-panel {
  width: min(520px, 88vw);
  padding: 2px 10px;
}
.chapter-editor .editor-tools-rail__body .editor-clipboard-panel {
  width: 298px;
  padding: 2px 9px 2px 0 !important;
}
.chapter-editor .editor-tools-rail__body .editor-font-panel {
  width: 370px;
  padding: 2px 9px !important;
}
.chapter-editor .editor-tools-rail__body .editor-paragraph-panel {
  width: 370px;
  padding: 2px 9px !important;
}
.chapter-editor .editor-tools-rail__body .editor-styles-panel {
  width: 520px;
  padding: 2px 9px !important;
}
.chapter-editor .editor-tools-rail__body .editor-quick-tools-panel {
  width: 220px;
  padding: 2px 9px !important;
}
.chapter-editor .editor-tools-rail__body .editor-document-blocks-panel {
  width: 430px;
  padding: 2px 9px 2px 0 !important;
}
.chapter-editor .editor-tools-rail__body .editor-media-links-panel {
  width: 540px;
  padding: 2px 9px !important;
}
.chapter-editor .editor-tools-rail__body .editor-page-text-panel {
  width: 560px;
  padding: 2px 9px !important;
}
.chapter-editor .editor-tools-rail__body .editor-page-background-panel {
  width: 310px;
  padding: 2px 9px !important;
}
.chapter-editor .editor-tools-rail__body .document-studio-panel {
  width: min(980px, 92vw);
  max-height: 355px !important;
  padding: 2px 10px !important;
  overflow: auto !important;
}
.chapter-editor .editor-tools-rail__body .layout-board-panel {
  width: min(1120px, 94vw);
  max-height: 355px !important;
  padding: 2px 10px !important;
  overflow: auto !important;
}
.chapter-editor .editor-tools-rail__body .document-preview-panel {
  width: min(720px, 92vw);
  max-height: 355px !important;
  padding: 2px 10px !important;
  overflow: auto !important;
}
.chapter-editor .editor-tools-rail__body .document-studio-panel__header,
.chapter-editor .editor-tools-rail__body .document-studio-panel__hint,
.chapter-editor .editor-tools-rail__body .document-studio-panel__flow,
.chapter-editor .editor-tools-rail__body .document-studio-panel__hero,
.chapter-editor .editor-tools-rail__body .document-studio-panel__readiness,
.chapter-editor .editor-tools-rail__body .document-studio-panel__finish-grid,
.chapter-editor .editor-tools-rail__body .layout-board-panel__header,
.chapter-editor .editor-tools-rail__body .document-preview-panel__header {
  margin-bottom: 8px !important;
}
.chapter-editor .document-page-setup-ribbon,
.chapter-editor .document-references-ribbon,
.chapter-editor .document-view-ribbon,
.chapter-editor .layout-vector-ribbon {
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
.chapter-editor .document-stage {
  order: 5;
  margin-top: 0 !important;
  padding: clamp(10px, 1.5vw, 18px) !important;
  min-height: calc(100vh - 235px) !important;
  background: #eef2f7;
}
.chapter-editor .writer-entry-panel {
  order: 4;
  margin: 0 !important;
  border-radius: 0 !important;
}
.chapter-editor .document-review-panels {
  order: 6;
  padding-inline: clamp(10px, 1.5vw, 18px);
}
.chapter-editor > .card-body > small.text-muted {
  order: 8;
  padding: 0 clamp(10px, 1.5vw, 18px) 12px;
}
.chapter-editor .publish-notice,
.chapter-editor .conflict-recovery-notice,
.chapter-editor .guest-write-banner,
.chapter-editor .editorial-nav-banner {
  order: 3;
}
.chapter-editor .d-flex.justify-content-end.mt-2 {
  order: 7;
}
@media (max-width: 900px) {
.chapter-editor .editor-topbar {
    grid-template-columns: 1fr !important;
}
.chapter-editor .editor-workbench-tabs__brand span {
    display: none !important;
}
.chapter-editor .editor-workbench-tabs__tab {
    min-width: 84px !important;
}
.chapter-editor .editor-tools-rail__body {
    max-height: 52vh !important;
    padding-inline: 6px !important;
}
.chapter-editor .editor-tools-rail__body .editor-metrics {
    grid-template-columns: repeat(2, minmax(132px, 1fr));
}
}
@media (max-width: 560px) {
.chapter-editor .editor-workbench-tabs__head {
    align-items: stretch !important;
    gap: 6px !important;
}
.chapter-editor .editor-ribbon-toggle {
    min-width: 112px;
    justify-content: center;
}
.chapter-editor .editor-workbench-tabs__tab {
    min-width: 76px !important;
    padding-inline: 8px !important;
}
.chapter-editor .editor-tools-rail__body .editor-clipboard-panel,
  .chapter-editor .editor-tools-rail__body .editor-font-panel,
  .chapter-editor .editor-tools-rail__body .editor-paragraph-panel,
  .chapter-editor .editor-tools-rail__body .editor-styles-panel,
  .chapter-editor .editor-tools-rail__body .editor-quick-tools-panel,
  .chapter-editor .editor-tools-rail__body .editor-document-blocks-panel,
  .chapter-editor .editor-tools-rail__body .editor-media-links-panel,
  .chapter-editor .editor-tools-rail__body .editor-page-text-panel,
  .chapter-editor .editor-tools-rail__body .editor-page-background-panel {
    width: min(92vw, 420px);
}
}

/* Office-like document title bar for chapter metadata and save actions. */
.chapter-editor .editor-topbar {
  display: flex !important;
  align-items: center !important;
  grid-template-columns: none !important;
  gap: 8px !important;
  min-height: 46px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
.chapter-editor .editor-titlebar__autosave,
.chapter-editor .editor-titlebar__quick-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, .88);
  font-size: .76rem;
  line-height: 1;
  white-space: nowrap;
}
.chapter-editor .editor-titlebar__word-badge {
  display: inline-grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 5px;
  background: #185abd;
  color: #ffffff;
  font-size: .72rem;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28);
}
.chapter-editor .editor-titlebar__switch {
  position: relative;
  width: 38px;
  height: 20px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  opacity: 1;
}
.chapter-editor .editor-titlebar__switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .16s ease;
}
.chapter-editor .editor-titlebar__switch.active span {
  transform: translateX(17px);
}
.chapter-editor .editor-titlebar__quick-actions {
  padding-inline: 4px;
}
.chapter-editor .editor-titlebar__icon-button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 5px;
  background: transparent;
  color: rgba(255,255,255,.86);
}
.chapter-editor .editor-titlebar__icon-button:hover:not(:disabled) {
  background: rgba(255,255,255,.12);
  color: #ffffff;
}
.chapter-editor .editor-titlebar__icon-button:disabled {
  opacity: .45;
}
.chapter-editor .editor-titlebar__field {
  flex: 0 1 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  height: 32px;
  min-width: 0;
  padding: 0 8px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 3px;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.78);
}
.chapter-editor .editor-titlebar__field span {
  color: rgba(255,255,255,.64);
  font-size: .66rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}
.chapter-editor .editor-titlebar__field input {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #ffffff;
  font: inherit;
  font-size: .82rem;
}
.chapter-editor .editor-titlebar__field input::-moz-placeholder {
  color: rgba(255,255,255,.52);
}
.chapter-editor .editor-titlebar__field input::placeholder {
  color: rgba(255,255,255,.52);
}
.chapter-editor .editor-titlebar__field--work {
  flex: 0 0 clamp(180px, 19vw, 300px);
  width: clamp(180px, 19vw, 300px);
}
.chapter-editor .editor-titlebar__field--chapter {
  flex: 0 0 clamp(240px, 24vw, 420px);
  min-width: 240px;
}
.chapter-editor .editor-titlebar__field--price {
  flex: 0 0 122px;
  width: 122px;
}
#chapter-editor-v4[data-write-now-workspace="true"] .editor-titlebar__field--chapter {
  flex: 1 1 clamp(220px, 42vw, 520px);
  min-width: 220px;
}
#chapter-editor-v4[data-write-now-workspace="true"] .editor-titlebar__field--price,
#chapter-editor-v4[data-write-now-workspace="true"] .editor-topbar .publish-controls {
  display: none !important;
}
.chapter-editor .editor-topbar .publish-controls {
  flex: 0 0 auto;
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 6px !important;
  min-width: 162px;
}
.chapter-editor .editor-topbar .publish-controls--scheduled {
  min-width: 332px;
}
.chapter-editor .editor-topbar .publish-controls .form-select,
.chapter-editor .editor-topbar .publish-controls .form-control {
  min-height: 32px !important;
  height: 32px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 3px;
  background-color: rgba(255,255,255,.9);
  font-size: .8rem;
}
.chapter-editor .editor-topbar .publish-controls .form-select {
  width: 162px;
}
.chapter-editor .editor-topbar .publish-controls .form-control {
  width: 166px;
}
.chapter-editor .editor-topbar .publish-controls__explore {
  color: rgba(255,255,255,.86);
  font-size: .78rem;
}
.chapter-editor .editor-topbar .construction-switch {
  flex: 0 0 auto;
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.chapter-editor .editor-topbar .construction-switch .btn,
.chapter-editor .editor-titlebar__save,
.chapter-editor .editor-titlebar__link {
  min-height: 32px;
  border-radius: 4px;
  padding: 5px 12px;
  white-space: nowrap;
  font-size: .8rem;
}
.chapter-editor .editor-titlebar__save {
  flex: 0 0 auto;
}
.chapter-editor .editor-titlebar__link {
  flex: 0 0 auto;
  border-color: rgba(255,255,255,.24) !important;
  color: rgba(255,255,255,.88) !important;
}
.chapter-editor .editor-titlebar__link:hover {
  background: rgba(255,255,255,.1) !important;
  color: #ffffff !important;
}
.chapter-editor .editor-mobile-savebar {
  display: none;
}
.chapter-editor .editor-workbench-tabs__head {
  display: none !important;
}
.chapter-editor .editor-workbench-tabs__tab--collapse {
  margin-left: auto;
  min-width: 88px !important;
  color: rgba(255,255,255,.82) !important;
}
.chapter-editor .editor-workbench-tabs__tab--collapse i {
  margin-bottom: 2px;
}
.chapter-editor .editor-workbench-tabs__tab--collapse:hover {
  background: rgba(255,255,255,.1) !important;
  color: #ffffff !important;
}
@media (max-width: 900px) {
.chapter-editor .editor-titlebar__autosave > span:not(.editor-titlebar__word-badge) {
    display: none;
}
.chapter-editor .editor-titlebar__field--work {
    flex-basis: 190px;
    width: 190px;
}
.chapter-editor .editor-titlebar__field--chapter {
    flex-basis: 250px;
}
}

/* Compact Office ribbon: softer icons, clearer collapse, and more writing space on mobile. */
.chapter-editor .editor-titlebar__quick-actions {
  gap: 4px;
}
.chapter-editor .editor-titlebar__icon-button {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  font-size: .82rem;
}
.chapter-editor .editor-clipboard-button,
.chapter-editor .editor-clipboard-arrow {
  min-height: 42px;
}
.chapter-editor .editor-clipboard-button-main {
  min-height: 46px;
}
.chapter-editor .editor-clipboard-icon,
.chapter-editor .editor-quick-tool__icon,
.chapter-editor .editor-document-block__icon,
.chapter-editor .editor-insert-page__icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}
.chapter-editor .editor-clipboard-button-main .editor-clipboard-icon {
  width: 28px;
  height: 28px;
}
.chapter-editor .editor-clipboard-icon i,
.chapter-editor .editor-quick-tool__icon i,
.chapter-editor .editor-document-block__icon i,
.chapter-editor .editor-insert-page__icon i,
.chapter-editor .editor-font-tool i,
.chapter-editor .editor-font-color-tool i,
.chapter-editor .editor-paragraph-tool i,
.chapter-editor .editor-paragraph-select-tool i,
.chapter-editor .editor-paragraph-color-tool i,
.chapter-editor .document-page-setup-tool__icon,
.chapter-editor .document-reference-main__icon,
.chapter-editor .document-view-tool__icon {
  font-size: .94rem;
}
.chapter-editor .editor-font-tool,
.chapter-editor .editor-font-color-tool,
.chapter-editor .editor-paragraph-tool,
.chapter-editor .editor-paragraph-select-tool,
.chapter-editor .editor-paragraph-color-tool {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
.chapter-editor .editor-paragraph-tool--combo {
  width: 38px;
}
.chapter-editor .editor-paragraph-select-tool {
  width: 60px;
}
.chapter-editor .editor-insert-page,
.chapter-editor .editor-insert-table {
  min-height: 58px;
  gap: 4px;
}
.chapter-editor .editor-quick-tool,
.chapter-editor .editor-document-block {
  min-height: 52px;
  gap: 4px;
}
.chapter-editor.editor-tools-collapsed .editor-workbench-tabs__head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 7px 8px !important;
}
.chapter-editor.editor-tools-collapsed .editor-workbench-tabs__brand {
  display: grid !important;
  min-width: 0;
}
.chapter-editor.editor-tools-collapsed .editor-workbench-tabs__brand strong,
.chapter-editor.editor-tools-collapsed .editor-workbench-tabs__brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chapter-editor.editor-tools-collapsed .editor-ribbon-toggle {
  width: auto !important;
  min-width: 0 !important;
  min-height: 30px !important;
  margin-top: 0 !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
}
.chapter-editor.editor-tools-collapsed .editor-workbench-tabs {
  margin-bottom: 6px !important;
  border-radius: 10px !important;
}
@media (min-width: 761px) {
.chapter-editor.editor-tool-tab-setup .editor-tools-rail__body {
    align-items: stretch !important;
    max-height: min(24vh, 190px) !important;
    padding-block: 6px !important;
}
.chapter-editor.editor-tool-tab-setup .editor-tools-rail__body .editor-metrics {
    width: min(900px, 72vw) !important;
    grid-template-columns: repeat(5, minmax(118px, 1fr)) !important;
    gap: 6px !important;
    padding: 0 8px 0 0 !important;
}
.chapter-editor.editor-tool-tab-setup .editor-tools-rail__body .metric-card {
    min-height: 64px !important;
    padding: 7px 9px !important;
    gap: 2px !important;
    border-radius: 9px !important;
}
.chapter-editor.editor-tool-tab-setup .editor-tools-rail__body .metric-card small {
    font-size: .68rem !important;
    line-height: 1.05 !important;
}
.chapter-editor.editor-tool-tab-setup .editor-tools-rail__body .metric-card strong {
    font-size: .95rem !important;
    line-height: 1 !important;
}
.chapter-editor.editor-tool-tab-setup .editor-tools-rail__body .metric-card span {
    font-size: .68rem !important;
    line-height: 1.15 !important;
}
.chapter-editor.editor-tool-tab-setup .editor-tools-rail__body .metric-card .metric-actions {
    gap: 4px !important;
    margin-top: 4px !important;
}
.chapter-editor.editor-tool-tab-setup .editor-tools-rail__body .metric-card .btn {
    min-height: 26px !important;
    padding: 3px 9px !important;
    font-size: .72rem !important;
    line-height: 1 !important;
}
.chapter-editor.editor-tool-tab-setup .editor-tools-rail__body .chapter-poll-panel {
    width: min(360px, 32vw) !important;
    min-width: 290px !important;
    padding: 7px 10px !important;
    gap: 7px !important;
    align-self: stretch !important;
}
.chapter-editor.editor-tool-tab-setup .chapter-poll-panel__header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto !important;
    align-items: center !important;
    gap: 8px !important;
}
.chapter-editor.editor-tool-tab-setup .chapter-poll-panel__header strong {
    font-size: .86rem !important;
    line-height: 1.1 !important;
}
.chapter-editor.editor-tool-tab-setup .chapter-poll-panel__body {
    gap: 7px !important;
}
.chapter-editor.editor-tool-tab-setup .chapter-poll-panel__grid {
    grid-template-columns: 1fr !important;
    gap: 7px !important;
}
.chapter-editor.editor-tool-tab-setup .chapter-poll-panel__field {
    gap: 4px !important;
}
.chapter-editor.editor-tool-tab-setup .chapter-poll-panel__field span,
  .chapter-editor.editor-tool-tab-setup .chapter-poll-panel__checkbox,
  .chapter-editor.editor-tool-tab-setup .chapter-poll-panel__actions small {
    font-size: .72rem !important;
}
.chapter-editor.editor-tool-tab-setup .chapter-poll-panel__option-row {
    grid-template-columns: 26px minmax(0, 1fr) auto !important;
    gap: 6px !important;
}
.chapter-editor.editor-tool-tab-setup .chapter-poll-panel__option-index {
    width: 26px !important;
    height: 26px !important;
    font-size: .72rem !important;
}
}
@media (min-width: 761px) {
.chapter-editor.editor-tool-tab-format .editor-tools-rail__body {
    align-items: flex-start !important;
    max-height: min(21vh, 112px) !important;
    padding: 5px 7px 6px !important;
}
.chapter-editor.editor-tool-tab-format .editor-tools-rail__body .editor-clipboard-panel,
  .chapter-editor.editor-tool-tab-format .editor-tools-rail__body .editor-font-panel,
  .chapter-editor.editor-tool-tab-format .editor-tools-rail__body .editor-paragraph-panel,
  .chapter-editor.editor-tool-tab-format .editor-tools-rail__body .editor-styles-panel,
  .chapter-editor.editor-tool-tab-format .editor-tools-rail__body .editor-quick-tools-panel {
    align-self: flex-start !important;
    padding: 4px 7px !important;
    gap: 5px !important;
}
.chapter-editor.editor-tool-tab-format .editor-tools-rail__body .editor-clipboard-panel {
    width: 250px !important;
}
.chapter-editor.editor-tool-tab-format .editor-clipboard-row {
    grid-template-columns: minmax(62px, 1fr) repeat(3, minmax(45px, .8fr)) !important;
    gap: 5px !important;
}
.chapter-editor.editor-tool-tab-format .editor-paste-combo {
    grid-template-columns: minmax(0, 1fr) 22px !important;
}
.chapter-editor.editor-tool-tab-format .editor-clipboard-button,
  .chapter-editor.editor-tool-tab-format .editor-clipboard-arrow {
    min-height: 38px !important;
    font-size: .66rem !important;
    border-radius: 8px !important;
}
.chapter-editor.editor-tool-tab-format .editor-clipboard-button {
    gap: 3px !important;
    padding: 4px !important;
}
.chapter-editor.editor-tool-tab-format .editor-clipboard-button-main {
    min-height: 40px !important;
}
.chapter-editor.editor-tool-tab-format .editor-paste-combo .editor-clipboard-button {
    border-radius: 8px 0 0 8px !important;
}
.chapter-editor.editor-tool-tab-format .editor-clipboard-arrow {
    border-radius: 0 8px 8px 0 !important;
}
.chapter-editor.editor-tool-tab-format .editor-clipboard-icon,
  .chapter-editor.editor-tool-tab-format .editor-quick-tool__icon {
    width: 22px !important;
    height: 22px !important;
    border-radius: 7px !important;
}
.chapter-editor.editor-tool-tab-format .editor-clipboard-button-main .editor-clipboard-icon {
    width: 24px !important;
    height: 24px !important;
}
.chapter-editor.editor-tool-tab-format .editor-clipboard-icon i,
  .chapter-editor.editor-tool-tab-format .editor-quick-tool__icon i {
    font-size: .82rem !important;
}
.chapter-editor.editor-tool-tab-format .editor-tools-rail__body .editor-font-panel {
    width: 330px !important;
}
.chapter-editor.editor-tool-tab-format .editor-font-topline {
    grid-template-columns: minmax(0, 1fr) 54px 28px 28px !important;
    gap: 4px !important;
}
.chapter-editor.editor-tool-tab-format .editor-font-control {
    gap: 2px !important;
}
.chapter-editor.editor-tool-tab-format .editor-font-control span {
    font-size: .56rem !important;
    line-height: 1 !important;
}
.chapter-editor.editor-tool-tab-format .editor-font-control select {
    min-height: 27px !important;
    border-radius: 7px !important;
    font-size: .74rem !important;
    padding: 3px 6px !important;
}
.chapter-editor.editor-tool-tab-format .editor-font-command-row,
  .chapter-editor.editor-tool-tab-format .editor-paragraph-row {
    gap: 4px !important;
}
.chapter-editor.editor-tool-tab-format .editor-font-tool,
  .chapter-editor.editor-tool-tab-format .editor-font-color-tool,
  .chapter-editor.editor-tool-tab-format .editor-paragraph-tool,
  .chapter-editor.editor-tool-tab-format .editor-paragraph-select-tool,
  .chapter-editor.editor-tool-tab-format .editor-paragraph-color-tool {
    width: 28px !important;
    height: 28px !important;
    border-radius: 7px !important;
    font-size: .72rem !important;
}
.chapter-editor.editor-tool-tab-format .editor-font-tool i,
  .chapter-editor.editor-tool-tab-format .editor-font-color-tool i,
  .chapter-editor.editor-tool-tab-format .editor-paragraph-tool i,
  .chapter-editor.editor-tool-tab-format .editor-paragraph-select-tool i,
  .chapter-editor.editor-tool-tab-format .editor-paragraph-color-tool i {
    font-size: .86rem !important;
}
.chapter-editor.editor-tool-tab-format .editor-font-swatch,
  .chapter-editor.editor-tool-tab-format .editor-paragraph-swatch {
    left: 6px !important;
    right: 6px !important;
    bottom: 4px !important;
    height: 2px !important;
}
.chapter-editor.editor-tool-tab-format .editor-tools-rail__body .editor-paragraph-panel {
    width: 340px !important;
}
.chapter-editor.editor-tool-tab-format .editor-paragraph-tool--combo {
    width: 34px !important;
}
.chapter-editor.editor-tool-tab-format .editor-paragraph-select-tool {
    width: 54px !important;
}
.chapter-editor.editor-tool-tab-format .editor-paragraph-select-tool select {
    width: 26px !important;
    font-size: .6rem !important;
}
.chapter-editor.editor-tool-tab-format .editor-paragraph-separator {
    height: 22px !important;
}
.chapter-editor.editor-tool-tab-format .editor-paragraph-label-row {
    grid-template-columns: 1fr 16px !important;
    gap: 3px !important;
}
.chapter-editor.editor-tool-tab-format .editor-paragraph-label,
  .chapter-editor.editor-tool-tab-format .editor-styles-label,
  .chapter-editor.editor-tool-tab-format .editor-quick-tools-label {
    font-size: .56rem !important;
    line-height: 1 !important;
}
.chapter-editor.editor-tool-tab-format .editor-paragraph-launcher {
    width: 16px !important;
    height: 16px !important;
}
.chapter-editor.editor-tool-tab-format .editor-tools-rail__body .editor-styles-panel {
    width: 430px !important;
    grid-template-columns: minmax(245px, 1fr) 150px !important;
    grid-template-rows: auto 12px !important;
    align-items: start !important;
    gap: 5px 8px !important;
}
.chapter-editor.editor-tool-tab-format .editor-styles-gallery {
    grid-template-columns: repeat(3, minmax(70px, 1fr)) 24px !important;
    gap: 4px !important;
}
.chapter-editor.editor-tool-tab-format .editor-style-tile,
  .chapter-editor.editor-tool-tab-format .editor-style-more {
    min-height: 34px !important;
    border-radius: 6px !important;
}
.chapter-editor.editor-tool-tab-format .editor-style-tile {
    padding: 3px 5px !important;
}
.chapter-editor.editor-tool-tab-format .editor-style-tile span {
    font-size: .72rem !important;
    line-height: 1 !important;
}
.chapter-editor.editor-tool-tab-format .editor-style-tile-heading1 span,
  .chapter-editor.editor-tool-tab-format .editor-style-tile-heading2 span {
    font-size: .86rem !important;
}
.chapter-editor.editor-tool-tab-format .editor-style-tile-title span {
    font-size: .95rem !important;
}
.chapter-editor.editor-tool-tab-format .editor-style-actions {
    display: grid !important;
    align-self: start !important;
    gap: 2px !important;
    padding: 0 0 0 7px !important;
    border-top: 0 !important;
    border-left: 1px solid #c9d2df !important;
}
.chapter-editor.editor-tool-tab-format .editor-style-actions button {
    min-height: 22px !important;
    padding: 2px 4px !important;
    gap: 5px !important;
    border-radius: 6px !important;
    font-size: .66rem !important;
}
.chapter-editor.editor-tool-tab-format .editor-style-actions i {
    font-size: .8rem !important;
}
.chapter-editor.editor-tool-tab-format .editor-styles-label {
    grid-column: 1 / -1 !important;
}
.chapter-editor.editor-tool-tab-format .editor-tools-rail__body .editor-quick-tools-panel {
    width: 168px !important;
}
.chapter-editor.editor-tool-tab-format .editor-quick-tools-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4px !important;
}
.chapter-editor.editor-tool-tab-format .editor-quick-tool {
    min-height: 40px !important;
    gap: 3px !important;
    padding: 4px !important;
    border-radius: 7px !important;
    font-size: .64rem !important;
}
}
@media (max-width: 760px) {
.editor-v4-page,
  .chapter-editor.card,
  .chapter-editor > .card-body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
}
.chapter-editor.card {
    border-radius: 0 !important;
}
.chapter-editor > .card-body {
    gap: 8px !important;
    padding: 0 !important;
}
.chapter-editor .editor-topbar {
    min-height: 38px;
    padding-inline: 6px;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
}
.chapter-editor .editor-titlebar__quick-actions,
  .chapter-editor .editor-titlebar__save {
    display: none !important;
}
.chapter-editor .editor-titlebar__field--chapter {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}
#chapter-editor-v4[data-write-now-workspace="true"] .editor-titlebar__field--work {
    flex: 0 0 150px !important;
    width: 150px !important;
}
#chapter-editor-v4[data-write-now-workspace="true"] .editor-titlebar__field--chapter {
    flex: 1 1 min(100%, 260px) !important;
    min-width: 180px !important;
}
.chapter-editor .editor-titlebar__field--price {
    flex: 0 0 86px !important;
    width: 86px !important;
}
.chapter-editor .editor-tools-rail {
    position: sticky !important;
    top: 0 !important;
    z-index: 55 !important;
    margin: 0 !important;
    border-bottom: 1px solid #d7e0ec !important;
    background: rgba(255, 255, 255, .98) !important;
}
.chapter-editor .editor-workbench-tabs {
    margin-bottom: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.chapter-editor .editor-workbench-tabs__nav {
    grid-template-columns: repeat(8, minmax(52px, 1fr)) minmax(42px, .72fr) !important;
    gap: 3px !important;
    padding: 5px !important;
}
.chapter-editor .editor-workbench-tabs__tab {
    min-width: 52px !important;
    min-height: 30px !important;
    padding: 4px 5px !important;
    border-radius: 8px !important;
}
.chapter-editor .editor-workbench-tabs__tab strong {
    font-size: .67rem !important;
}
.chapter-editor .editor-workbench-tabs__tab--collapse {
    min-width: 42px !important;
}
.chapter-editor .editor-tools-rail__body {
    max-height: 42vh !important;
    padding: 6px 6px 10px !important;
}
.chapter-editor .document-stage {
    padding: 6px !important;
    min-height: calc(100vh - 126px) !important;
    background: #f4f7fb !important;
}
.chapter-editor .document-stage-rulers {
    padding: 6px !important;
}
.chapter-editor .document-editor-paper {
    width: 100% !important;
    max-width: none !important;
    min-height: calc(100vh - 170px) !important;
    padding: 26px 20px !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .08) !important;
}
.chapter-editor .ProseMirror {
    min-height: calc(100vh - 230px) !important;
}
.chapter-editor.card {
    padding-bottom: calc(132px + env(safe-area-inset-bottom)) !important;
}
.chapter-editor .editor-mobile-savebar {
    position: fixed;
    right: 0;
    bottom: calc(62px + env(safe-area-inset-bottom));
    left: 0;
    z-index: 1039;
    display: flex;
    gap: 8px;
    padding: 8px max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left));
    border-top: 1px solid rgba(255, 255, 255, .12);
    background: rgba(31, 41, 55, .96);
    box-shadow: 0 -10px 26px rgba(15, 23, 42, .24);
}
.chapter-editor .editor-mobile-savebar__button {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    min-height: 42px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
}
.chapter-editor .editor-mobile-savebar__button i {
    flex: 0 0 auto;
    font-size: .94rem;
    line-height: 1;
}
}
@media (max-width: 420px) {
.chapter-editor .editor-titlebar__field--work,
  .chapter-editor .editor-topbar .publish-controls,
  .chapter-editor .editor-topbar .construction-switch,
  .chapter-editor .editor-titlebar__link {
    display: none !important;
}
.chapter-editor .editor-titlebar__field--chapter {
    flex: 1 0 190px;
    min-width: 190px;
}
#chapter-editor-v4[data-write-now-workspace="true"] .editor-titlebar__field--chapter {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}
.chapter-editor .editor-titlebar__field--price {
    flex: 0 0 78px !important;
    width: 78px !important;
}
.chapter-editor .editor-titlebar__autosave {
    flex: 0 0 23px !important;
    width: 23px !important;
    min-width: 23px !important;
    gap: 0 !important;
}
.chapter-editor .editor-titlebar__field {
    height: 30px !important;
    padding-inline: 6px !important;
}
.chapter-editor .editor-titlebar__field span {
    display: none !important;
}
.chapter-editor .editor-mobile-savebar {
    gap: 6px;
}
.chapter-editor .editor-mobile-savebar__button {
    min-height: 40px;
    padding-inline: 8px;
    font-size: .7rem;
}
.chapter-editor .editor-mobile-savebar__button i {
    font-size: .86rem;
}
}

/* The collapsed editor toolbar must stay discoverable on small screens. */
.chapter-editor.editor-tools-collapsed .editor-workbench-tabs {
  background: #1f2937 !important;
  border-bottom: 1px solid rgba(37, 99, 235, .45) !important;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .18) !important;
}
.chapter-editor.editor-tools-collapsed .editor-workbench-tabs__head {
  min-height: 44px !important;
  background: linear-gradient(90deg, #111827, #1f2937) !important;
}
.chapter-editor.editor-tools-collapsed .editor-ribbon-toggle {
  min-width: 132px !important;
  min-height: 34px !important;
  justify-content: center !important;
  border: 1px solid #facc15 !important;
  background: #facc15 !important;
  color: #111827 !important;
  box-shadow: 0 8px 18px rgba(250, 204, 21, .28) !important;
  font-size: .78rem !important;
  font-weight: 950 !important;
}
.chapter-editor.editor-tools-collapsed .editor-ribbon-toggle i {
  color: #111827 !important;
  font-size: .95rem !important;
}
@media (max-width: 560px) {
.chapter-editor.editor-tools-collapsed .editor-workbench-tabs__head {
    grid-template-columns: minmax(0, 1fr) auto !important;
    padding: 8px !important;
}
.chapter-editor.editor-tools-collapsed .editor-workbench-tabs__brand strong {
    font-size: .8rem !important;
}
.chapter-editor.editor-tools-collapsed .editor-workbench-tabs__brand span {
    display: none !important;
}
.chapter-editor.editor-tools-collapsed .editor-ribbon-toggle {
    min-width: 124px !important;
    padding-inline: 12px !important;
    white-space: nowrap !important;
}
}

/* Codex 2026-07-08: keep chapter save/publish visible on desktop and mobile browsers. */
@media (min-width: 901px) {
  .chapter-editor.card {
    padding-bottom: 92px !important;
  }

  .chapter-editor .editor-mobile-savebar {
    position: fixed !important;
    right: 18px !important;
    bottom: 18px !important;
    left: auto !important;
    z-index: 2147483000 !important;
    display: flex !important;
    gap: 8px !important;
    width: min(620px, calc(100vw - 36px)) !important;
    padding: 10px !important;
    border: 1px solid rgba(255, 255, 255, .16) !important;
    border-radius: 14px !important;
    background: rgba(17, 24, 39, .96) !important;
    box-shadow: 0 16px 38px rgba(15, 23, 42, .28) !important;
  }

  .chapter-editor .editor-mobile-savebar__button {
    flex: 1 1 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    min-width: 0 !important;
    min-height: 42px !important;
    border-radius: 999px !important;
    font-size: .82rem !important;
    font-weight: 850 !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 900px) {
  .chapter-editor.card {
    padding-bottom: calc(92px + env(safe-area-inset-bottom)) !important;
  }

  .chapter-editor .editor-mobile-savebar {
    position: fixed !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 2147483000 !important;
    display: flex !important;
    gap: 8px !important;
    padding: 8px max(10px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)) !important;
    border-top: 1px solid rgba(255, 255, 255, .16) !important;
    background: rgba(17, 24, 39, .98) !important;
    box-shadow: 0 -10px 26px rgba(15, 23, 42, .28) !important;
  }

  .chapter-editor .editor-mobile-savebar__button {
    flex: 1 1 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    min-width: 0 !important;
    min-height: 44px !important;
    border-radius: 999px !important;
    font-size: .78rem !important;
    font-weight: 850 !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
  }

  .chapter-editor .editor-mobile-savebar__button i {
    flex: 0 0 auto !important;
    font-size: .95rem !important;
    line-height: 1 !important;
  }
}
