/* Conversion plan (내 원고) + zoned studio workspace. */

.conversion-plan {
  display: grid;
  gap: 10px;
  margin: 18px 0 4px;
}

.conversion-plan-head {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
}

.conversion-plan-head h3 {
  margin: 0;
  font-size: 0.92rem;
}

.conversion-plan-head small {
  color: var(--muted);
}

.conversion-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.conversion-choice {
  display: grid;
  gap: 4px;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
}

.conversion-choice input {
  position: absolute;
  opacity: 0;
}

.conversion-choice strong {
  font-size: 0.88rem;
}

.conversion-choice span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.conversion-choice.is-active {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
  background: color-mix(in srgb, var(--brand-soft) 70%, var(--surface));
}

.paid-bookmark-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px 12px;
  align-items: start;
  padding: 14px 16px;
  border: 1px dashed color-mix(in srgb, var(--accent) 40%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface));
}

.paid-bookmark-card .paid-badge {
  grid-column: 3;
  grid-row: 1;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
}

.paid-bookmark-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.78rem;
  line-height: 1.5;
}

.import-progress {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, #120f18 52%, transparent);
}

.import-progress[hidden] {
  display: none;
}

.import-progress-card {
  width: min(420px, calc(100% - 32px));
  padding: 22px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.import-progress-card progress {
  width: 100%;
  height: 8px;
}

.studio-ico,
.nav-ico {
  width: 20px;
  height: 20px;
  object-fit: contain;
  background: transparent;
  flex: 0 0 auto;
  pointer-events: none;
}

.studio-ico-lg {
  width: 20px;
  height: 20px;
}

/* ---- Studio shell: three rooms ---- */
body.studio-shell {
  --studio-canvas: #e6e4ee;
  --studio-rail-bg: #f3f1f7;
  --studio-edit-bg: #eceaf2;
  --studio-paper: #fffefa;
  --studio-proof-bg: #f3f1f7;
  --studio-proof-ink: var(--text);
  --studio-proof-muted: var(--muted);
  --studio-proof-seg-bg: var(--surface-muted, #f4f4f8);
  --studio-proof-seg-line: var(--line);
  --studio-proof-seg-active: var(--surface, #fffefa);
  --studio-proof-seg-ink: var(--muted);
  --studio-proof-seg-active-ink: var(--text);
  --header-height: 56px;
  overflow: hidden;
}

html[data-theme="dark"] body.studio-shell {
  --studio-canvas: #121118;
  --studio-rail-bg: #1b1a22;
  --studio-edit-bg: #16151c;
  --studio-paper: #24202a;
  --studio-proof-bg: #0e0d12;
  --studio-proof-ink: #f4f1ea;
  --studio-proof-muted: #c6c1d0;
  --studio-proof-seg-bg: #14131a;
  --studio-proof-seg-line: #3d3a48;
  --studio-proof-seg-active: #2f2c3c;
  --studio-proof-seg-ink: #c6c1d0;
  --studio-proof-seg-active-ink: #fffefa;
}

body.studio-shell .site-header.rm-header {
  width: 100%;
  height: 56px;
}

body.studio-shell .site-header .header-inner.rm-header-inner {
  width: 100%;
  max-width: none;
  margin-inline: 0;
  padding-inline: 10px;
  box-sizing: border-box;
}

body.studio-shell .brand-logo.rm-brand-logo {
  max-height: 36px;
}

body.studio-shell .site-nav.rm-nav > a:not(.is-live),
body.studio-shell .site-nav.rm-nav > button:not(.theme-toggle),
body.studio-shell .rm-header-tools .rm-tool,
body.studio-shell .site-footer,
body.studio-shell .rm-nav-kicker {
  display: none !important;
}

body.studio-shell[data-chrome-collapsed="true"] .site-header {
  display: none !important;
}

body.studio-shell .workspace-main,
body.studio-shell .project-workspace {
  padding: 0;
  max-width: none;
  width: auto;
}

.studio-shell-main {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 56px);
  min-height: 0;
  background: var(--studio-canvas);
}

body.studio-shell[data-chrome-collapsed="true"] .studio-shell-main {
  height: 100dvh;
}

body.publishing-app[data-page="project"] .studio-appbar {
  position: static;
  isolation: auto;
  overflow: visible;
  display: flex;
  gap: 16px;
  align-items: center;
  min-height: 52px;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}

.appbar-cluster {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.appbar-id {
  min-width: 0;
  gap: 10px;
  flex-shrink: 1;
}

.appbar-policy {
  margin-left: auto;
  padding-right: 12px;
  border-right: 1px solid var(--line);
}

.appbar-file {
  gap: 6px;
}

.appbar-chrome {
  padding-left: 4px;
}

.tool-btn {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 750;
  white-space: nowrap;
  flex-shrink: 0;
}

.tool-btn.is-save {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

body.publishing-app[data-page="project"] .studio-appbar::before {
  display: none;
}

body.publishing-app[data-page="project"] .mini-cover-small,
body.publishing-app[data-page="project"] .project-workload {
  display: none;
}

body.publishing-app[data-page="project"] .project-app-title h1 {
  max-width: 36vw;
  font-size: 1rem;
  font-weight: 800;
}

.studio-mode-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.appbar-policy {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
}

.studio-options {
  position: relative;
}

.studio-options > summary {
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  list-style: none;
  white-space: nowrap;
}

.studio-options > summary::-webkit-details-marker {
  display: none;
}

.studio-options > summary::after {
  margin-left: 7px;
  color: var(--muted);
  content: '▾';
}

.studio-options[open] > summary {
  border-color: var(--brand);
  color: var(--brand-strong, var(--brand));
}

.studio-options-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: 270px;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 16px 36px rgba(28, 22, 40, 0.18);
}

.studio-options-popover > strong {
  font-size: 0.76rem;
}

.studio-options-popover .cover-plan-chip,
.studio-options-popover .paid-switch {
  width: 100%;
  justify-content: flex-start;
}

.studio-mode-switch {
  display: flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
}

.studio-mode-switch button {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  min-height: 32px;
  padding: 3px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.studio-mode-switch button.is-active {
  background: var(--surface);
  color: var(--text);
}

.paid-switch {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 32px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 750;
}

.chrome-min,
.pane-min,
.pane-restore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.pane-restore {
  margin-left: 4px;
}

.pane-restore:has(> span) {
  width: auto;
  padding-inline: 8px;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 800;
}

.pane-edit .studio-pane-label .pane-restore:first-of-type {
  margin-left: auto;
}

.analysis-notice-button {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  min-height: 28px;
  margin-left: auto;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand-soft) 45%, var(--surface));
  color: var(--brand-strong, var(--brand));
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 800;
  white-space: nowrap;
}

.analysis-notice-button:hover {
  border-color: var(--brand);
}

.pane-restore[hidden] {
  display: none !important;
}

.chrome-min {
  margin-left: 4px;
}

.pane-min svg,
.pane-restore svg {
  width: 14px;
  height: 14px;
}

body.studio-shell[data-chrome-collapsed="true"] .appbar-policy,
body.studio-shell[data-chrome-collapsed="true"] .studio-appbar [data-undo-edit],
body.studio-shell[data-chrome-collapsed="true"] .project-app-title p,
body.studio-shell[data-chrome-collapsed="true"] .project-app-title > div {
  display: none;
}

.studio-stage-switch {
  display: none;
}

.studio-workspace {
  --nav-width: 248px;
  --proof-width: 300px;
  display: grid;
  flex: 1;
  grid-template-columns: var(--nav-width) 8px minmax(0, 1fr) 8px var(--proof-width);
  gap: 0;
  min-height: 0;
  padding: 8px 10px 10px;
  background: var(--studio-canvas);
}

.pane-resizer {
  position: relative;
  z-index: 3;
  width: 8px;
  margin: 8px -2px;
  cursor: col-resize;
  touch-action: none;
  background: transparent;
}

.pane-resizer::after {
  content: "";
  position: absolute;
  top: 10%;
  bottom: 10%;
  left: 3px;
  width: 2px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--line) 88%, transparent);
}

.pane-resizer:hover::after,
.pane-resizer:focus-visible::after,
.pane-resizer.is-dragging::after,
body.studio-resizing .pane-resizer.is-dragging::after {
  left: 2px;
  width: 4px;
  background: var(--brand);
}

.pane-resizer:focus-visible {
  outline: none;
}

body.studio-resizing {
  cursor: col-resize;
  user-select: none;
}

body.studio-shell[data-nav-collapsed="true"] .studio-workspace {
  grid-template-columns: 64px 0 minmax(0, 1fr) 8px var(--proof-width);
}

body.studio-shell[data-proof-collapsed="true"] .studio-workspace {
  grid-template-columns: var(--nav-width) 8px minmax(0, 1fr) 0 64px;
}

body.studio-shell[data-nav-collapsed="true"][data-proof-collapsed="true"] .studio-workspace {
  grid-template-columns: 64px 0 minmax(0, 1fr) 0 64px;
}

body.studio-shell[data-nav-collapsed="true"] .pane-resizer[data-resize="nav"],
body.studio-shell[data-proof-collapsed="true"] .pane-resizer[data-resize="proof"] {
  visibility: hidden;
  pointer-events: none;
}

.studio-pane {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border-radius: 12px;
}

.studio-pane-label {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 0 8px 0 10px;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.studio-pane-label .pane-min {
  margin-left: auto;
}

.studio-pane-label > span {
  text-transform: none;
}

.studio-pane-label strong,
.studio-pane-label small {
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-pane-label strong {
  margin-right: auto;
  color: inherit;
  font-size: 0.78rem;
  opacity: 0.78;
}

.studio-pane-body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: auto;
}

.studio-pane-rail {
  display: none;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  padding: 8px 6px;
}

.studio-pane-rail button {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.studio-pane-rail button:hover,
.studio-pane-rail button.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.studio-pane-rail .rail-expand {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  background: var(--brand-soft);
  color: var(--brand-strong, var(--brand));
}

.studio-pane-rail .rail-expand svg,
.pane-min svg,
.pane-restore svg {
  width: 14px;
  height: 14px;
}

.studio-pane-rail button i {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 14px;
  padding: 0 3px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.58rem;
  font-style: normal;
}

.pane-nav {
  background: var(--studio-rail-bg);
  box-shadow: inset 3px 0 0 var(--ss-purple, #6439e8);
}

body.publishing-app.studio-shell .pane-edit.content-editor,
.pane-edit {
  background: var(--studio-paper);
}

body.studio-shell .pane-proof.studio-proof,
.pane-proof {
  color: var(--studio-proof-ink);
  background: var(--studio-proof-bg) !important;
  box-shadow: inset 3px 0 0 var(--ss-coral, #f42c8d);
}

.pane-proof .studio-pane-label {
  color: var(--studio-proof-ink);
}

.pane-proof .pane-min {
  border-color: var(--studio-proof-seg-line);
  background: var(--studio-proof-seg-active);
  color: var(--studio-proof-ink);
}

body.publishing-app.studio-shell .studio-paper.free-editor-document,
body.studio-shell .studio-paper {
  flex: 1;
  overflow: auto;
  margin: 0;
  padding: 8px 20px 36px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* Shown only when the editor has enough content to navigate logical chunks.
   These are authoring ranges, not publication page numbers. */
body.studio-shell .pane-edit > [data-editor-chunk-toolbar] {
  display: flex;
  min-width: 0;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  padding: 8px 12px;
  border-block: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, var(--brand-soft));
  color: var(--text-soft);
}

body.studio-shell .pane-edit > [data-editor-chunk-toolbar][hidden] {
  display: none !important;
}

.editor-chunk-toolbar__view {
  display: flex;
  min-width: 0;
  flex: 0 1 250px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: var(--studio-caption);
  font-weight: 750;
  white-space: nowrap;
}

.editor-chunk-toolbar__view > span {
  flex: 0 0 auto;
}

.editor-chunk-toolbar__view select {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  height: 32px;
  padding: 0 28px 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.editor-chunk-toolbar__view select:focus-visible,
.editor-chunk-toolbar__navigation button:focus-visible,
.free-editor-document [data-insert-paragraph-after]:focus-visible,
.free-editor-document [data-insert-paragraph-section]:focus-visible {
  outline: 2px solid var(--focus, var(--brand));
  outline-offset: 2px;
}

.editor-chunk-toolbar__navigation {
  display: grid;
  min-width: min(100%, 224px);
  flex: 1 1 224px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.editor-chunk-toolbar__navigation button {
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  font-size: var(--studio-caption);
  font-weight: 750;
}

.editor-chunk-toolbar__navigation button:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--brand) 46%, var(--line));
  color: var(--brand);
}

.editor-chunk-toolbar__navigation button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

[data-editor-chunk-status] {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--studio-caption);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The visual slot remains between blocks so inserting a paragraph never
   requires the author to guess which asset or paragraph will move. */
body.studio-shell .free-editor-document .editor-insertion-slot {
  position: relative;
  display: grid;
  min-height: 38px;
  margin: -2px 0 8px;
  padding: 4px 0;
  place-items: center;
}

body.studio-shell .free-editor-document .editor-insertion-slot::before {
  position: absolute;
  inset-inline: 0;
  top: 50%;
  border-top: 1px dashed color-mix(in srgb, var(--brand) 34%, var(--line));
  content: "";
}

body.studio-shell .free-editor-document .editor-insertion-slot:hover::before,
body.studio-shell .free-editor-document .editor-insertion-slot:focus-within::before {
  border-top-color: var(--brand);
}

.free-editor-document [data-insert-paragraph-after],
.free-editor-document [data-insert-paragraph-section] {
  position: relative;
  z-index: 1;
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid color-mix(in srgb, var(--brand) 32%, var(--line));
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand);
  cursor: pointer;
  font-size: var(--studio-caption);
  font-weight: 800;
}

.free-editor-document [data-insert-paragraph-after]::before,
.free-editor-document [data-insert-paragraph-section]::before {
  content: "+";
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
}

.free-editor-document [data-insert-paragraph-after]:hover:not(:disabled),
.free-editor-document [data-insert-paragraph-section]:hover:not(:disabled) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.free-editor-document [data-insert-paragraph-after]:disabled,
.free-editor-document [data-insert-paragraph-section]:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

/* Reserve space before the editable text so its caret stays clear of the
   single rounded keyboard-focus outline. */
body.studio-shell .studio-paper .word-paragraph {
  min-height: 2.4em;
  margin-bottom: 10px;
  padding: 3px 10px 3px 16px;
  border-radius: 5px;
}

body.studio-shell .studio-paper .word-paragraph:focus {
  caret-color: var(--text);
  box-shadow: none;
}

body.studio-shell .studio-paper .word-paragraph:focus-visible {
  outline: 2px solid var(--focus, var(--brand));
  outline-offset: 2px;
}

body.studio-shell[data-nav-collapsed="true"] .pane-nav > .studio-pane-label,
body.studio-shell[data-nav-collapsed="true"] .pane-nav > .studio-pane-body {
  display: none;
}

body.studio-shell[data-nav-collapsed="true"] .pane-nav > .studio-pane-rail {
  display: flex;
}

body.studio-shell[data-proof-collapsed="true"] .pane-proof > .studio-pane-label,
body.studio-shell[data-proof-collapsed="true"] .pane-proof > .studio-pane-body {
  display: none;
}

body.studio-shell[data-proof-collapsed="true"] .pane-proof > .studio-pane-rail {
  display: flex;
}

body.studio-shell .pane-nav .workspace-tabs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 8px;
  border: 0;
  background: transparent;
}

.pane-nav .workspace-tabs button {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 750;
  cursor: pointer;
}

.pane-nav .workspace-tabs button:hover {
  border-color: var(--line);
  background: var(--surface-strong, #fff);
}

body.studio-shell .pane-nav .workspace-tabs button.is-active {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
  background: var(--brand-soft);
  box-shadow: inset 3px 0 0 var(--brand);
  color: var(--brand-strong, var(--brand));
}

body.studio-shell .pane-nav .workspace-tabs button > span,
body.studio-shell .pane-nav .workspace-tabs button.is-active > span {
  display: inline;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.pane-nav .workspace-tabs button b,
.pane-nav .workspace-tabs .nav-count {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-align: center;
}

.pane-nav .chapter-tree {
  padding: 0 8px 12px;
}

.proof-toolbar {
  display: grid;
  gap: 8px;
  padding: 10px 10px 8px;
}

body.studio-shell .pane-proof .proof-seg,
body.studio-shell .pane-proof .publication-tabs,
body.studio-shell .pane-proof .device-tabs {
  display: flex;
  grid-template-columns: none;
  gap: 0;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--studio-proof-seg-line);
  border-radius: 10px;
  background: var(--studio-proof-seg-bg);
}

body.studio-shell .pane-proof .proof-seg button,
body.studio-shell .pane-proof .publication-tabs button,
body.studio-shell .pane-proof .device-tabs button {
  flex: 1;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--studio-proof-seg-ink);
  font-size: 0.74rem;
  font-weight: 750;
  text-align: center;
  box-shadow: none;
}

body.studio-shell .pane-proof .proof-seg button.is-active,
body.studio-shell .pane-proof .publication-tabs button.is-active,
body.studio-shell .pane-proof .device-tabs button.is-active {
  background: var(--studio-proof-seg-active);
  color: var(--studio-proof-seg-active-ink);
  border-color: transparent;
  box-shadow: none;
}

body.studio-shell .pane-proof .font-control {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: var(--studio-proof-muted);
}

body.studio-shell .pane-proof .font-control input {
  width: 100%;
  max-width: 140px;
  accent-color: var(--accent, #f42c8d);
}

.proof-stage {
  display: flex;
  flex: 1;
  min-height: 0;
  align-items: center;
  justify-content: center;
  padding: 8px 10px 16px;
}

body.studio-shell .pane-proof .studio-pane-body,
body.studio-shell .pane-proof .reader-stage,
body.studio-shell .pane-proof .reflow-preview,
body.studio-shell .pane-proof .magazine-preview {
  background: transparent !important;
}

body.studio-shell .pane-proof .reader-stage {
  display: grid;
  flex: 1;
  place-items: center;
  min-height: 0 !important;
  padding: 0;
  border-radius: 0;
}

.pane-proof .reader-device.phone {
  width: min(220px, 92%);
}

.bookmark-slot {
  margin: 16px 0;
  overflow: hidden;
  border: 1px dashed color-mix(in srgb, var(--brand) 35%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--brand-soft) 50%, var(--surface));
}

.bookmark-slot.is-inserted {
  border-style: solid;
  background: var(--surface);
}

.bookmark-slot.is-missing {
  border-color: color-mix(in srgb, var(--warning, #a96c16) 40%, var(--line));
}

.slot-missing {
  margin: 0;
  color: var(--warning, #a96c16);
  font-size: 0.78rem;
}

.slot-action:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.asset-queue-list > button.is-active {
  border-radius: 8px;
  background: var(--brand-soft);
  box-shadow: inset 3px 0 0 var(--brand);
}

.bookmark-slot header {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  font-size: 0.72rem;
}

.bookmark-slot header .mono {
  margin-left: auto;
}

.bookmark-slot .bookmark-body {
  display: grid;
  gap: 6px;
  padding: 8px 10px 10px;
}

.bookmark-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.slot-action {
  appearance: none;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: auto;
  min-height: 36px;
  padding: 4px 12px 4px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong, var(--surface));
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1.2;
  box-shadow: none;
}

.slot-action.is-primary {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  background: var(--brand-soft);
  color: var(--brand-strong, var(--brand));
}

.slot-ico {
  width: 20px;
  height: 20px;
  object-fit: contain;
  background: transparent;
  filter: none;
  flex: 0 0 auto;
}

.slot-label {
  max-width: 100%;
  text-align: left;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.slot-action:hover {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand-soft) 70%, var(--surface));
}

.slot-action:hover .slot-ico {
  transform: none;
}

.slot-action:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

html[data-theme="dark"] .slot-action {
  background: color-mix(in srgb, #2c2836 86%, transparent);
}

html[data-theme="dark"] .slot-action.is-primary {
  background: color-mix(in srgb, var(--brand-soft) 82%, #1b1822);
}

.bookmark-table,
.studio-paper table,
.reader-page table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.bookmark-table th,
.bookmark-table td,
.studio-paper table th,
.studio-paper table td,
.reader-page table th,
.reader-page table td {
  padding: 6px 8px;
  border: 1px solid var(--line);
}

.studio-paper .word-paragraph,
.studio-paper .editor-heading {
  margin: 0 0 12px;
}

.studio-paper .editor-heading {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 650;
}

.reader-bookmark {
  padding: 6px 8px;
  border: 1px dashed #b7b1c4;
  border-radius: 8px;
  color: #6b6578;
  font-size: 0.78em;
}

.reader-bookmark.is-missing {
  border-color: color-mix(in srgb, var(--warning, #a96c16) 45%, #b7b1c4);
  color: var(--warning, #a96c16);
}

.preview-template-help[hidden],
.sound-toggle[hidden],
.sample-label[hidden] {
  display: none !important;
}

.side-panel-action {
  margin: 8px;
}

@media (min-width: 1024px) {
  body.publishing-app[data-page="project"] .studio-workspace .pane-nav,
  body.publishing-app[data-page="project"] .studio-workspace .pane-edit,
  body.publishing-app[data-page="project"] .studio-workspace .pane-proof {
    display: flex !important;
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .studio-workspace {
    grid-template-columns: var(--nav-width) 8px minmax(0, 1fr) 8px var(--proof-width);
  }
}

@media (max-width: 1023px) {
  body.studio-shell {
    overflow: hidden;
    height: 100dvh;
  }

  body.publishing-app.studio-shell .site-header.rm-header {
    height: 44px;
  }

  body.studio-shell .site-header .header-inner.rm-header-inner {
    width: 100%;
    padding-inline: 10px;
  }

  body.studio-shell .brand-logo.rm-brand-logo {
    max-height: 28px;
  }

  .studio-shell-main {
    height: calc(100dvh - 44px);
    min-height: 0;
  }

  body.publishing-app[data-page="project"] .studio-appbar {
    display: flex;
    justify-content: space-between;
    min-height: 42px;
    padding: 4px 10px;
    gap: 8px;
  }

  .project-app-title p,
  .appbar-policy,
  .save-state,
  .appbar-file [data-undo-edit],
  .appbar-chrome {
    display: none;
  }

  body.publishing-app[data-page="project"] .project-app-title h1 {
    max-width: 46vw;
    font-size: 0.84rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tool-btn {
    min-height: 32px;
    padding: 0 10px;
  }

  .studio-workspace {
    display: block;
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 6px 8px;
  }

  .studio-workspace .studio-pane {
    display: none;
    min-height: 100%;
  }

  .studio-workspace[data-mobile-pane="nav"] .pane-nav,
  .studio-workspace[data-mobile-pane="edit"] .pane-edit,
  .studio-workspace[data-mobile-pane="preview"] .pane-proof {
    display: flex;
  }

  .studio-pane-label,
  .pane-min,
  .pane-restore,
  .studio-pane-rail,
  .chrome-min,
  .pane-resizer {
    display: none !important;
  }

  .pane-edit .studio-pane-label {
    display: flex !important;
    min-height: 36px;
    padding: 0 12px;
    border-bottom: 1px solid var(--line);
    background: transparent;
  }

  .pane-edit .studio-pane-label .pane-restore {
    display: none !important;
  }

  .pane-nav .studio-pane-body,
  .pane-proof .studio-pane-body {
    display: flex;
  }

  body.publishing-app.studio-shell .studio-paper.free-editor-document,
  .studio-paper {
    margin: 0;
    padding: 12px 14px 28px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  body.studio-shell .pane-edit > [data-editor-chunk-toolbar] {
    gap: 8px;
    padding: 8px 12px;
  }

  .editor-chunk-toolbar__view,
  .editor-chunk-toolbar__navigation {
    flex-basis: 100%;
  }

  .editor-chunk-toolbar__view {
    justify-content: space-between;
  }

  .editor-chunk-toolbar__view select {
    width: min(100%, 172px);
  }

  .studio-stage-switch {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    flex-shrink: 0;
    gap: 0;
    padding: 4px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 -10px 24px rgba(28, 22, 40, 0.08);
  }

  html[data-theme="dark"] .studio-stage-switch {
    box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.28);
  }

  .studio-stage-switch button {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
  }

  .studio-stage-switch .nav-ico,
  .studio-stage-switch .studio-ico {
    width: 22px;
    height: 22px;
  }

  .studio-stage-switch button.is-active {
    background: var(--brand-soft);
    color: var(--text);
  }

  .slot-label {
    white-space: nowrap;
  }

  .pane-resizer {
    display: none;
  }

  body.studio-shell[data-nav-collapsed="true"] .studio-workspace,
  body.studio-shell[data-proof-collapsed="true"] .studio-workspace,
  body.studio-shell[data-nav-collapsed="true"][data-proof-collapsed="true"] .studio-workspace {
    grid-template-columns: 1fr;
  }

  body.studio-shell[data-nav-collapsed="true"] .pane-nav > .studio-pane-body,
  body.studio-shell[data-proof-collapsed="true"] .pane-proof > .studio-pane-body {
    display: flex;
  }

  .studio-mode-bar {
    display: none;
  }
}

@media (max-width: 900px) {
  .conversion-choices,
  .paid-bookmark-card {
    grid-template-columns: 1fr;
  }

  body.publishing-app[data-page="submit"] .workspace-layout {
    display: flex;
    flex-direction: column;
  }

  .workspace-layout .form-workspace {
    order: 1;
  }

  .workspace-layout .submission-summary {
    order: 2;
  }
}

/* Reader preview: reserve a real footprint for the device layer so it never
   competes with the mode, viewport, or type controls above it. */
body.studio-shell .pane-proof .studio-pane-body {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

body.studio-shell .pane-proof .proof-toolbar {
  position: relative;
  z-index: 1;
  grid-row: 1;
  flex: 0 0 auto;
  background: var(--studio-proof-bg);
}

body.studio-shell .pane-proof [data-print-preset-panel] {
  grid-row: 2;
}

body.studio-shell .pane-proof [data-reflow-control][hidden] {
  display: none !important;
}

.preview-device-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 6px;
  align-items: center;
}

.preview-profile-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-width: 0;
  color: var(--studio-proof-muted);
  font-size: 0.7rem;
  font-weight: 750;
  white-space: nowrap;
}

.preview-profile-field select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0 6px;
  border: 1px solid var(--studio-proof-seg-line);
  border-radius: 8px;
  background: var(--studio-proof-seg-bg);
  color: var(--studio-proof-ink);
  font: inherit;
}

.preview-orientation {
  display: flex;
  min-height: 40px;
  padding: 2px;
  border: 1px solid var(--studio-proof-seg-line);
  border-radius: 8px;
  background: var(--studio-proof-seg-bg);
}

.preview-orientation button {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  padding: 0 5px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--studio-proof-seg-ink);
  font-size: 0.69rem;
  font-weight: 750;
}

.preview-orientation button.is-active {
  background: var(--studio-proof-seg-active);
  color: var(--studio-proof-seg-active-ink);
}

.preview-device-summary {
  grid-column: 1 / -1;
  min-height: 16px;
  overflow: hidden;
  color: var(--studio-proof-muted);
  font-size: 0.64rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.studio-shell .pane-proof .font-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 40px;
  align-items: center;
  justify-content: stretch;
  color: var(--studio-proof-muted);
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 750;
}

body.studio-shell .pane-proof .font-control input {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.font-control [data-reader-font-output] {
  min-width: 62px;
  color: var(--studio-proof-ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

body.studio-shell .pane-proof .proof-stage {
  display: grid;
  grid-row: 3;
  min-height: 0;
  align-items: stretch;
  justify-items: stretch;
  padding: 8px 10px 16px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

body.studio-shell .pane-proof .proof-stage > .reader-stage {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 100% !important;
  place-items: center;
  padding: 0;
}

.preview-fit {
  position: relative;
  display: block;
  flex: 0 0 auto;
  inline-size: var(--preview-render-width, 220px);
  block-size: var(--preview-render-height, 476px);
  max-inline-size: 100%;
  max-block-size: 100%;
}

body.studio-shell .pane-proof .preview-fit .reader-device {
  position: absolute;
  inset: 0 auto auto 0;
  display: flex;
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  transition: none;
}

.preview-fit[data-preview-scale-mode="transform"] .reader-device {
  transform: scale(var(--preview-scale, 1));
  transform-origin: top left;
}

body.studio-shell .pane-proof .reader-device[data-preview-family="tablet"],
body.studio-shell .pane-proof .reader-device[data-preview-orientation="landscape"] {
  border-radius: 20px;
}

body.studio-shell .pane-proof .reader-page {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 15px 14px;
  font-size: var(--reader-font-size, 20px);
  overscroll-behavior: contain;
}

body.studio-shell .pane-proof .reader-page p {
  font-size: 1em;
}

.reader-page-empty {
  margin: 0;
  color: var(--studio-proof-muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.reader-page-context {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--studio-proof-seg-line);
  color: var(--studio-proof-muted);
  font-size: 0.64rem !important;
  line-height: 1.45;
}

@media (max-width: 390px) {
  .preview-device-controls {
    grid-template-columns: 1fr;
  }

  .preview-orientation {
    width: 100%;
  }
}

/* The legacy studio rules still hide proof at tablet widths. The active
   workspace state owns pane visibility below the three-pane breakpoint. */
@media (max-width: 1023px) {
  body.publishing-app.studio-shell[data-page="project"] .studio-workspace[data-mobile-pane="nav"] .pane-nav,
  body.publishing-app.studio-shell[data-page="project"] .studio-workspace[data-mobile-pane="edit"] .pane-edit,
  body.publishing-app.studio-shell[data-page="project"] .studio-workspace[data-mobile-pane="preview"] .pane-proof {
    display: flex !important;
  }
}

/* Intake receipt, source-page navigation, and editable bookmark results. */
body.studio-shell .pane-edit .editor-extraction-summary {
  flex: 0 0 auto;
  margin: 0 12px 8px;
  padding: 12px 14px 10px;
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--brand-soft) 42%, var(--surface));
  color: var(--text);
}

.analysis-notice-dialog {
  width: min(560px, calc(100% - 32px));
  max-height: min(720px, calc(100dvh - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--line));
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(28, 22, 40, 0.26);
}

.analysis-notice-dialog::backdrop {
  background: rgba(28, 22, 40, 0.42);
  backdrop-filter: blur(2px);
}

.analysis-notice-card {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.analysis-notice-card > header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.analysis-notice-card > header h2 {
  margin: 4px 0 0;
  font-size: 1.08rem;
}

.analysis-notice-card > header button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-muted);
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
}

.analysis-notice-card > p[data-extraction-copy] {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

.analysis-notice-card .editor-extraction-rate {
  display: flex;
  min-width: 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 10px;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in srgb, var(--brand-soft) 48%, var(--surface));
  text-align: left;
}

.analysis-notice-card .editor-extraction-rate strong {
  margin: 0;
}

.analysis-notice-card .editor-extraction-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.analysis-notice-card .editor-extraction-metrics > span {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.analysis-notice-card .editor-extraction-summary__note {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
  line-height: 1.55;
}

.analysis-notice-actions {
  display: flex;
  justify-content: flex-end;
}

.project-entry-gate {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(5px);
}

.project-entry-gate[hidden] {
  display: none !important;
}

.project-entry-gate-card {
  width: min(520px, 100%);
  padding: clamp(24px, 5vw, 38px);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  text-align: center;
  box-shadow: 0 28px 80px rgba(28, 22, 40, 0.22);
}

.project-entry-gate-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 16px;
  background: var(--brand);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 900;
}

.project-entry-gate-card h2 {
  margin: 7px 0 10px;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
}

.project-entry-gate-card > p:not(.kicker) {
  margin: 0 auto;
  max-width: 38em;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.7;
}

.project-entry-gate-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 22px 0;
}

.project-entry-gate-steps span {
  display: grid;
  gap: 7px;
  justify-items: center;
  padding: 12px 6px;
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--text-soft);
  font-size: 0.7rem;
  font-weight: 750;
}

.project-entry-gate-steps b {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-strong, var(--brand));
}

.project-entry-gate-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.project-entry-gate-card > small {
  display: block;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.5;
}

body.is-project-locked .site-header,
body.is-project-locked .studio-shell-main > :not(.project-entry-gate) {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  user-select: none;
}

.editor-extraction-summary__top {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
}

.editor-extraction-summary__eyebrow,
.classification-rate-card .classification-kicker {
  display: block;
  color: var(--brand-strong, var(--brand));
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.editor-extraction-summary h2 {
  margin: 3px 0 2px;
  font-size: 0.86rem;
  line-height: 1.25;
}

.editor-extraction-summary__top p {
  max-width: 48em;
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.editor-extraction-rate {
  flex: 0 0 auto;
  min-width: 112px;
  padding-left: 12px;
  border-left: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line));
  text-align: right;
}

.editor-extraction-rate span {
  display: block;
  color: var(--muted);
  font-size: 0.59rem;
  font-weight: 750;
  white-space: nowrap;
}

.editor-extraction-rate strong {
  display: block;
  margin-top: 2px;
  color: var(--brand-strong, var(--brand));
  font-family: var(--font-mono);
  font-size: 1.45rem;
  line-height: 1;
}

.editor-extraction-rate small {
  margin-left: 2px;
  font-size: 0.72rem;
}

.editor-extraction-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--brand) 14%, var(--line));
  color: var(--muted);
  font-size: 0.64rem;
}

.editor-extraction-metrics strong {
  margin-right: 2px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.editor-extraction-summary__note {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.59rem;
  line-height: 1.35;
}

body.studio-shell .pane-edit .editor-page-navigation {
  display: grid;
  flex: 0 0 auto;
  gap: 6px;
  padding: 8px 12px 10px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, var(--brand-soft));
}

.editor-page-navigation__heading {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
}

.editor-page-navigation__heading output {
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
}

.editor-page-navigation__controls {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.editor-page-navigation__controls > button,
.editor-page-navigation__list > button,
.bookmark-table-actions button,
.bookmark-file-action {
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.editor-page-navigation__controls > button:hover:not(:disabled),
.editor-page-navigation__list > button:hover,
.bookmark-table-actions button:hover:not(:disabled),
.bookmark-file-action:hover {
  border-color: var(--brand);
  color: var(--brand-strong, var(--brand));
}

.editor-page-navigation__controls > button:disabled,
.bookmark-table-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.editor-page-navigation__list {
  display: flex;
  min-width: 0;
  gap: 4px;
  justify-content: center;
  overflow-x: auto;
  scrollbar-width: thin;
}

.editor-page-navigation__list > button {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 32px;
  align-items: center;
  justify-content: center;
  padding-inline: 7px;
  color: var(--brand-strong, var(--brand));
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.proof-toolbar-reader-only {
  gap: 10px;
}

.proof-toolbar-title {
  color: var(--text);
  font-size: 0.72rem;
}

.editor-page-navigation__list > button strong {
  color: var(--brand-strong, var(--brand));
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.editor-page-navigation__list > button span {
  max-width: 82px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-page-navigation__ellipsis {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 12px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.editor-page-navigation__list > button.is-active {
  border-color: color-mix(in srgb, var(--brand) 58%, var(--line));
  background: var(--brand-soft);
  color: var(--text);
}

.editor-page-navigation__empty {
  padding: 6px 8px;
  color: var(--muted);
  font-size: 0.64rem;
}

.editor-page-divider {
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 2px 0 15px;
  color: var(--muted);
}

.editor-page-divider::before,
.editor-page-divider::after {
  flex: 1 1 auto;
  border-top: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line));
  content: '';
}

.editor-page-divider span {
  flex: 0 0 auto;
  padding: 4px 9px;
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-soft) 62%, var(--surface));
  color: var(--brand-strong, var(--brand));
  font-family: var(--font-mono);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
}

.editor-page-divider:first-child {
  margin-top: 0;
}

.bookmark-slot header .bookmark-state {
  margin-left: auto;
  color: var(--brand-strong, var(--brand));
  font-size: 0.61rem;
  font-weight: 800;
}

.bookmark-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.bookmark-table-editor {
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
}

.bookmark-edit-table {
  min-width: 360px;
  table-layout: fixed;
}

.bookmark-edit-table th,
.bookmark-edit-table td {
  min-width: 86px;
  vertical-align: top;
  background: color-mix(in srgb, var(--surface) 88%, var(--brand-soft));
  line-height: 1.4;
  word-break: break-word;
}

.bookmark-edit-table th {
  background: color-mix(in srgb, var(--brand-soft) 64%, var(--surface));
  font-weight: 850;
}

.bookmark-edit-table [data-table-cell] {
  outline: none;
}

.bookmark-edit-table [data-table-cell]:focus {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand) 60%, transparent);
}

.bookmark-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.bookmark-table-actions button,
.bookmark-file-action {
  min-height: 28px;
  padding-inline: 8px;
  font-size: 0.61rem;
}

.bookmark-image-editor {
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.bookmark-image-editor .bookmark-thumb {
  display: block;
  width: min(100%, 420px);
  max-height: 280px;
  margin: 0 auto;
  object-fit: contain;
}

.bookmark-image-editor figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.62rem;
  text-align: center;
}

.bookmark-native-text {
  max-height: 180px;
  margin: 0;
  padding: 8px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-soft);
  font: 0.68rem/1.45 var(--font-mono);
  white-space: pre-wrap;
}

.bookmark-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.bookmark-fields label {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.bookmark-fields label > span {
  color: var(--muted);
  font-size: 0.59rem;
  font-weight: 800;
}

.bookmark-fields input {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.66rem;
}

.bookmark-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.bookmark-file-input:focus-visible + .bookmark-file-action,
.bookmark-file-action:focus-visible,
.editor-page-navigation button:focus-visible,
.bookmark-table-actions button:focus-visible,
.bookmark-fields input:focus-visible,
.bookmark-edit-table [data-table-cell]:focus-visible {
  outline: 2px solid var(--focus, var(--brand));
  outline-offset: 2px;
}

.reader-bookmark.is-pending {
  border-color: color-mix(in srgb, var(--brand) 38%, #b7b1c4);
  background: color-mix(in srgb, var(--brand-soft) 35%, transparent);
}

.reader-bookmark.is-pending table {
  background: transparent;
}

@media (max-width: 620px) {
  .analysis-notice-card {
    padding: 18px;
  }

  .analysis-notice-card .editor-extraction-metrics {
    grid-template-columns: 1fr;
  }

  .project-entry-gate {
    padding: 14px;
  }

  .project-entry-gate-card {
    padding: 24px 18px;
  }

  .project-entry-gate-steps {
    gap: 5px;
  }

  .project-entry-gate-steps span {
    padding-inline: 3px;
    font-size: 0.64rem;
  }

  .editor-extraction-summary__top {
    gap: 9px;
  }

  .editor-extraction-rate {
    min-width: 90px;
    padding-left: 8px;
  }

  .editor-extraction-rate span {
    white-space: normal;
  }

  .editor-extraction-rate strong {
    font-size: 1.22rem;
  }

  .editor-page-navigation__controls {
    gap: 4px;
  }

  .editor-page-navigation__controls > button {
    min-height: 40px;
    padding-inline: 6px;
  }

  .editor-page-navigation__list > button {
    min-height: 40px;
    min-width: 46px;
    padding-inline: 4px;
  }

  .editor-page-navigation__ellipsis {
    min-width: 9px;
  }

  .bookmark-fields {
    grid-template-columns: 1fr;
  }
}
