:root {
  --navy-950: #061426;
  --navy-900: #081b30;
  --navy-850: #0c223a;
  --navy-800: #112b47;
  --navy-700: #183d63;
  --blue: #299ae8;
  --blue-2: #54c4ff;
  --gold: #e6ad3d;
  --gold-soft: #f4ce75;
  --paper: #ffffff;
  --canvas: #e8edf2;
  --ink: #152336;
  --muted: #6e7b8d;
  --line: #d9e0e7;
  --line-dark: rgba(255,255,255,.12);
  --danger: #b84444;
  --shadow: 0 20px 52px rgba(7, 24, 42, .16);
  --zoom: 1;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; min-height: 0; }
body {
  margin: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: 38px 104px minmax(0, 1fr) 42px;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px 9px;
  color: var(--ink);
  background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(41,154,232,.2); border-color: var(--blue); }
label { display: block; font-size: 12px; font-weight: 700; color: inherit; margin: 10px 0 5px; }
kbd { margin-left: auto; color: #8d99a8; font-size: 10px; font-family: inherit; font-weight: 500; }

.titlebar {
  position: relative;
  z-index: 50;
  display: grid;
  grid-template-columns: 320px 1fr auto;
  align-items: center;
  min-width: 980px;
  color: #edf6ff;
  background: linear-gradient(90deg, #061527, #071b30 65%, #061426);
  border-bottom: 1px solid rgba(255,255,255,.08);
  user-select: none;
}
.titlebar-app { display: flex; align-items: center; gap: 8px; padding-left: 17px; font-size: 13px; }
.titlebar-icon { width: 21px; height: 21px; object-fit: cover; object-position: left; }
.menu-bar { display: flex; align-items: stretch; height: 100%; }
.menu-wrap { position: relative; }
.menu-trigger {
  height: 100%;
  padding: 0 14px;
  border: 0;
  color: #eef5fd;
  background: transparent;
  font-size: 13px;
}
.menu-trigger:hover, .menu-trigger.active { background: rgba(255,255,255,.1); }
.menu-dropdown {
  position: absolute;
  z-index: 100;
  top: calc(100% + 1px);
  left: 0;
  width: 230px;
  padding: 7px;
  border: 1px solid #cfd8e2;
  border-radius: 0 0 7px 7px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(5,17,30,.25);
}
.menu-dropdown button {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #172537;
  text-align: left;
  font-size: 12px;
}
.menu-dropdown button:hover { background: #eef5fb; }
.window-dots { display: flex; height: 100%; align-items: center; }
.window-dots span { width: 46px; height: 100%; display: grid; place-items: center; color: #d8e1ea; }
.window-dots span:last-child:hover { background: #c42b3d; color: white; }

.ribbon {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 235px;
  min-width: 980px;
  background: #fff;
  border-bottom: 1px solid #cfd8e1;
  box-shadow: 0 2px 8px rgba(9,31,52,.07);
  position: relative;
  z-index: 20;
}
.brand-panel {
  display: flex;
  align-items: center;
  padding: 7px 18px;
  background: radial-gradient(circle at 65% 0, #133e63, transparent 50%), linear-gradient(145deg, #09203a, #07182b);
  border-right: 1px solid rgba(255,255,255,.1);
}
.brand-panel img { width: 270px; max-height: 86px; }
.ribbon-actions { display: flex; min-width: 0; align-items: stretch; overflow-x: auto; padding: 10px 14px; scrollbar-width: thin; }
.ribbon-button {
  min-width: 82px;
  height: 82px;
  padding: 7px 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #21334a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12px;
  white-space: nowrap;
}
.ribbon-button:hover { background: #edf5fb; }
.ribbon-button svg { width: 30px; height: 30px; fill: none; stroke: #163f68; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.word-icon { width: 29px; height: 31px; border-radius: 3px; display: grid; place-items: center; color: white; background: linear-gradient(135deg,#1f72c7,#0a4d9a); box-shadow: inset 4px 0 rgba(255,255,255,.16); font-weight: 850; font-size: 17px; }
.ribbon-separator { flex: 0 0 1px; height: 68px; margin: 7px 7px; background: #dce3e9; }
.auto-toc-status { padding: 20px 20px; display: flex; flex-direction: column; justify-content: center; border-left: 1px solid #e0e5ea; color: #657285; }
.auto-toc-status strong { color: #229369; font-size: 13px; margin-bottom: 7px; }
.auto-toc-status > span { font-size: 11px; line-height: 1.4; }
.status-check { display: inline-grid; width: 18px; height: 18px; place-items: center; border: 1px solid #2aa47a; border-radius: 50%; margin-right: 5px; }

.app-shell {
  min-height: 0;
  min-width: 980px;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 320px;
  overflow: hidden;
}
.sidebar, .inspector { min-height: 0; overflow: auto; color: #e8f1fa; background: linear-gradient(180deg, #102b46, #0a2138); scrollbar-width: thin; scrollbar-color: #61758a transparent; }
.book-sidebar { display: flex; flex-direction: column; border-right: 1px solid #27445e; }
.sidebar-title-row, .inspector-header { flex: 0 0 auto; min-height: 43px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; background: rgba(2,13,24,.3); border-bottom: 1px solid var(--line-dark); }
.sidebar-title-row h2, .inspector-header h2 { margin: 0; font-size: 12px; letter-spacing: .45px; font-weight: 750; }
.sidebar-icons { display: flex; gap: 15px; font-size: 18px; color: #cfdeeb; }
.project-compact { padding: 12px 15px; border-bottom: 1px solid var(--line-dark); }
.project-compact label { margin-top: 0; color: #9eb1c4; font-size: 10px; text-transform: uppercase; letter-spacing: .8px; }
.project-compact input { border-color: rgba(255,255,255,.15); background: rgba(255,255,255,.07); color: #fff; }
.section-list { flex: 1 1 auto; min-height: 90px; padding: 6px 9px 13px; overflow-y: auto; }
.section-group-label {
  margin: 13px 7px 5px;
  padding: 0 5px 8px;
  border-bottom: 1px dashed rgba(255,255,255,.19);
  color: #dce7f1;
  font-size: 11px;
  font-weight: 780;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.section-group-label::before { content: "▾  ▣  "; color: var(--gold-soft); }
.section-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0,1fr) auto 23px;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 6px 5px 6px 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #dce8f4;
  cursor: pointer;
}
.section-item::before { content: "▧"; color: #b9cadd; font-size: 16px; }
.section-item:hover { background: rgba(255,255,255,.07); }
.section-item.active { color: white; background: linear-gradient(90deg, rgba(42,154,232,.38), rgba(42,154,232,.13)); border-color: rgba(84,196,255,.22); }
.section-item.active::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: #39b6ff; border-radius: 4px 0 0 4px; }
.drag-handle { display: none; }
.section-item-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.section-delete { opacity: 0; width: 22px; height: 22px; border: 0; color: #afc2d3; background: transparent; border-radius: 3px; }
.section-item:hover .section-delete { opacity: 1; }
.section-delete:hover { color: white; background: rgba(195,64,64,.8); }
.auto-badge { padding: 2px 6px; border-radius: 4px; color: #d8fff0; background: #1b8063; font-size: 9px; font-weight: 800; }
.section-item:has(.auto-badge) .section-delete { visibility: hidden; }
.add-section-button { flex: 0 0 auto; margin: 9px 12px; min-height: 45px; border: 1px solid #3a5873; border-radius: 4px; color: #eaf4fd; background: rgba(255,255,255,.035); }
.add-section-button:hover { background: rgba(45,157,227,.18); border-color: #3d99d1; }
.add-section-button span { display: inline-grid; margin-right: 8px; width: 20px; height: 20px; place-items: center; border-radius: 50%; color: white; background: #387aac; }
.sidebar-settings { flex: 0 0 auto; padding: 7px 14px 13px; border-top: 1px solid var(--line-dark); display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.sidebar-settings label { color: #9fb1c3; font-size: 10px; }
.sidebar-settings select { border-color: #37536d; background: #0c243b; color: #e8f2fb; font-size: 11px; }
.dark-secondary { grid-column: 1 / -1; margin-top: 9px; padding: 8px; border: 1px solid #3e607d; border-radius: 4px; color: #e8f2fb; background: #183b5b; }

.workspace { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: #e6ebf0; }
.workspace-meta { flex: 0 0 58px; padding: 8px 18px; display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid #d6dde4; }
.section-heading-controls { min-width: 0; }
.section-title-input { width: min(500px, 55vw); padding: 0 0 3px; border: 0; border-radius: 0; font-size: 18px; font-weight: 750; }
.section-title-input:focus { outline: 0; border-bottom: 2px solid var(--blue); }
.section-options { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.section-options label { margin: 0; display: flex; align-items: center; gap: 5px; color: #5c6878; font-size: 10px; }
.section-options input { width: auto; }
.section-options select { width: auto; padding: 3px 6px; font-size: 10px; }
.workspace-meta > span { color: #778494; font-size: 11px; }
.format-toolbar { flex: 0 0 auto; min-height: 41px; padding: 4px 11px; display: flex; align-items: center; gap: 4px; overflow-x: auto; background: #f7f9fb; border-bottom: 1px solid #d0d8df; }
.format-toolbar button, .format-toolbar select { height: 31px; min-width: 31px; padding: 4px 7px; border: 1px solid #d4dce4; border-radius: 4px; color: #25374d; background: #fff; font-size: 11px; white-space: nowrap; }
.format-toolbar button:hover { border-color: #86b9dc; background: #edf7fd; }
.format-toolbar select { width: 130px; }
.separator { flex: 0 0 1px; width: 1px; height: 23px; margin: 0 3px; background: #d6dde4; }
.ruler { flex: 0 0 22px; display: grid; grid-template-columns: repeat(7,1fr); margin: 0 24px; padding-left: 20px; align-items: center; color: #647181; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(2% - 1px), #c5cdd5 calc(2% - 1px), #c5cdd5 2%); border-left: 1px solid #bfc8d0; border-right: 1px solid #bfc8d0; font-size: 9px; }
.ruler span { border-left: 1px solid #8e9aa6; padding-left: 3px; }
.editor-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 25px 44px 130px; scrollbar-gutter: stable; }
.editor {
  width: min(780px, 100%);
  min-height: 980px;
  margin: 0 auto 45px;
  padding: 68px 86px 120px;
  outline: 0;
  color: #17191c;
  background: white;
  box-shadow: var(--shadow);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.65;
  zoom: var(--zoom);
}
.editor p { margin: 0 0 .22em; text-indent: 1.5em; }
.editor p:first-child, .editor h1 + p, .editor h2 + p, .editor blockquote p { text-indent: 0; }
.editor h1 { margin: 1.7em 0 1.05em; text-align: center; color: #0d2540; font-size: 2em; font-weight: 500; line-height: 1.18; }
.editor h1:first-child { margin-top: .2em; }
.editor h2 { margin: 1.5em 0 .7em; color: #173c64; font-size: 1.35em; }
.editor blockquote { margin: 1.3em 2em; padding: .2em 0 .2em 1.1em; border-left: 3px solid #2f7cba; color: #3b4652; font-style: italic; }
.editor .scene-break { margin: 1.4em 0; text-align: center; text-indent: 0; letter-spacing: .55em; }
.editor figure { max-width: 100%; margin: 1.4em auto; }
.editor figure[data-align="left"] { margin-left: 0; margin-right: auto; }
.editor figure[data-align="right"] { margin-left: auto; margin-right: 0; }
.editor figure img { display: block; width: 100%; max-width: 100%; height: auto; outline: 2px solid transparent; cursor: pointer; }
.editor figure img.selected-image { outline-color: var(--blue); }
.editor figcaption { margin-top: .5em; color: #69717a; text-align: center; font-family: ui-sans-serif,system-ui,sans-serif; font-size: .72em; font-style: italic; }
.editor table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-family: ui-sans-serif, system-ui, sans-serif; font-size: .82em; }
.editor th, .editor td { border: 1px solid #cbd1da; padding: .45em .55em; vertical-align: top; }
.editor th { background: #f2f4f7; text-align: left; }
.editor.generated-toc-editor { background: #fbfdff; }
.editor.generated-toc-editor::before { content: "Automatically generated from your chapter list"; display: block; margin: -34px 0 28px; color: #728093; text-align: center; font-family: ui-sans-serif,system-ui,sans-serif; font-size: 10px; }
.book-toc ol { list-style: none; padding: 0; margin: 1.4em 0; }
.book-toc li { margin: .72em 0; text-indent: 0; }
.book-toc a { color: inherit; text-decoration: none; border-bottom: 1px dotted #9ca8b4; }

.inspector { border-left: 1px solid #27445e; }
.inspector-tabs { display: grid; grid-template-columns: repeat(4,1fr); border-bottom: 1px solid var(--line-dark); background: rgba(2,13,24,.18); }
.inspector-tab { height: 37px; border: 0; border-bottom: 2px solid transparent; color: #d6e4ef; background: transparent; font-size: 11px; }
.inspector-tab:hover { background: rgba(255,255,255,.05); }
.inspector-tab.active { color: #5bc5ff; border-bottom-color: #36aef0; background: rgba(47,156,225,.08); }
.inspector-pane { display: none; }
.inspector-pane.active { display: block; }
.inspector-section { padding: 13px 16px; border-bottom: 1px solid var(--line-dark); }
.inspector-section h3 { margin: 0 0 10px; color: #f1f7fb; font-size: 12px; }
.inspector-section label { color: #b7c7d5; }
.inspector-section input, .inspector-section select { border-color: #496278; color: #ecf5fc; background: #142f49; }
.control-grid { display: grid; gap: 8px; }
.control-grid.two { grid-template-columns: 1fr 1fr; }
.control-grid label { margin-top: 0; }
.segmented { display: grid; grid-template-columns: repeat(4,1fr); }
.segmented button { height: 34px; border: 1px solid #496278; border-right: 0; color: #eaf4fb; background: #142f49; }
.segmented button:last-child { border-right: 1px solid #496278; }
.segmented button:hover, .segmented button.active { background: #2077b3; }
.range-row { display: grid; grid-template-columns: 1fr 65px; align-items: center; gap: 8px; }
.range-row output { color: #c9d9e6; font-size: 11px; text-align: right; }
.wide-control { width: 100%; margin-bottom: 7px; padding: 8px; border: 1px solid #496278; color: #eaf4fb; background: #142f49; border-radius: 4px; }
.small-copy { color: #aabccd; font-size: 11px; line-height: 1.55; }
.empty-state { padding: 12px; border: 1px dashed #526a7f; border-radius: 5px; color: #aebdcc; font-size: 11px; }
button.danger { border: 1px solid #ce6060; color: #fff; background: #a63f3f; }
button.wide { width: 100%; margin-top: 10px; padding: 8px; border-radius: 4px; }
.toc-preview { display: flex; flex-direction: column; gap: 5px; }
.toc-entry { display: flex; align-items: baseline; gap: 6px; color: #dfebf5; font-size: 11px; cursor: pointer; }
.toc-entry:hover { color: #60c7ff; }
.toc-entry::after { content: ""; flex: 1; order: 1; border-bottom: 1px dotted rgba(255,255,255,.28); }
.toc-entry span:first-child { order: 0; }
.toc-entry span:last-child { order: 2; color: #9db0c1; }

.status-bar { min-width: 980px; display: grid; grid-template-columns: minmax(240px,1.25fr) repeat(4,auto) minmax(245px,1fr) auto; align-items: center; color: #dce8f3; background: linear-gradient(90deg,#071a2e,#0a2239); border-top: 1px solid #27445d; font-size: 10.5px; }
.status-bar > div { height: 100%; padding: 0 16px; display: flex; align-items: center; border-right: 1px solid rgba(255,255,255,.12); white-space: nowrap; }
.status-bar strong { margin-left: 4px; color: #fff; }
.status-project span { margin-left: 8px; color: #9eb1c3; }
.save-status { justify-content: center; gap: 4px; }
.save-status > span:first-child { color: #55d08f; font-size: 17px; }
#lastSavedTime { color: #9fb1c2; }
.zoom-controls { padding: 0 9px !important; gap: 6px; border-right: 0 !important; }
.zoom-controls button { width: 28px; height: 27px; border: 0; color: #dce8f3; background: transparent; }
.zoom-controls button:hover { background: rgba(255,255,255,.08); }

.modal, .preview-modal { max-height: calc(100vh - 28px); border: 0; border-radius: 9px; color: var(--ink); background: #fff; box-shadow: 0 28px 90px rgba(5,17,30,.35); overflow: auto; }
.modal { width: min(680px, calc(100vw - 36px)); padding: 0; }
.modal::backdrop, .preview-modal::backdrop { background: rgba(4,15,27,.67); backdrop-filter: blur(2px); }
.modal form { padding: 0 22px 22px; }
.modal-header { min-height: 58px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; color: #132a42; font-size: 17px; }
.icon-button { width: 30px; height: 30px; border: 0; border-radius: 4px; color: #536173; background: transparent; font-size: 20px; }
.icon-button:hover { background: #edf2f6; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.modal-actions button, .preview-controls button { padding: 8px 12px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.modal-actions .primary { color: white; background: #147cc2; border-color: #147cc2; }
.import-summary { margin: 18px 0 4px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 6px; background: #f5f8fb; }
.import-summary strong, .import-summary span { display: block; }
.import-summary span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.check-row { display: flex; align-items: flex-start; gap: 8px; font-weight: 650; line-height: 1.4; }
.check-row input { width: auto; margin-top: 2px; }
.import-note { margin-top: 14px; padding: 11px 13px; border-radius: 6px; color: #3c5270; background: #eaf4fb; font-size: 11px; line-height: 1.5; }
.preview-modal { width: min(1080px, calc(100vw - 30px)); height: min(850px, calc(100vh - 30px)); padding: 0; overflow: hidden; }
.preview-header { height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 17px; border-bottom: 1px solid var(--line); }
.preview-header span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.preview-stage { height: calc(100% - 58px); padding: 20px; display: grid; place-items: center; overflow: auto; background: #dfe5eb; }
#previewFrame { width: 700px; height: 100%; border: 0; background: white; box-shadow: var(--shadow); transition: width .2s ease; }
#previewFrame.phone { width: 390px; }
.validation-modal { width: min(620px, calc(100vw - 38px)); padding-bottom: 20px; }
.validation-item { margin: 12px 20px 0; padding: 11px 13px; border-radius: 6px; font-size: 12px; line-height: 1.45; }
.validation-item.pass { color: #27633a; background: #ecf8ef; }
.validation-item.warn { color: #75530b; background: #fff6df; }
.validation-item.error { color: #812d2d; background: #fdecec; }
.help-content { padding: 8px 22px 20px; color: #465568; font-size: 13px; line-height: 1.65; }
.toast { position: fixed; z-index: 1000; left: 50%; bottom: 54px; transform: translate(-50%,20px); opacity: 0; pointer-events: none; padding: 10px 14px; border-radius: 6px; color: white; background: #071b30; box-shadow: var(--shadow); transition: .2s ease; font-size: 12px; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 1250px) {
  .ribbon, .titlebar { grid-template-columns: 275px 1fr auto; }
  .brand-panel { padding-left: 9px; }
  .brand-panel img { width: 250px; }
  .app-shell { grid-template-columns: 275px minmax(0,1fr) 275px; }
  .ribbon-button { min-width: 75px; }
  .auto-toc-status { display: none; }
  .ribbon { grid-template-columns: 275px 1fr; }
}
@media (max-width: 1050px) {
  .inspector { display: none; }
  .app-shell { grid-template-columns: 260px minmax(0,1fr); }
  .titlebar, .ribbon, .status-bar, .app-shell { min-width: 760px; }
  .titlebar { grid-template-columns: 260px 1fr auto; }
  .ribbon { grid-template-columns: 260px 1fr; }
  .brand-panel img { width: 235px; }
  .status-bar { grid-template-columns: minmax(220px,1fr) repeat(2,auto) minmax(190px,1fr) auto; }
  .status-bar > div:nth-child(4), .status-bar > div:nth-child(5) { display: none; }
}

/* Page Binder compact workspace refresh */
body {
  grid-template-rows: 32px 82px minmax(0, 1fr) 36px;
}
.titlebar { grid-template-columns: 250px 1fr auto; min-width: 900px; }
.titlebar-app { gap: 7px; padding-left: 12px; font-size: 12px; }
.titlebar-icon { width: 18px; height: 18px; object-fit: contain; }
.menu-bar { gap: 1px; }
.menu-trigger { padding: 0 10px; font-size: 11.5px; }
.menu-link { display: inline-flex; align-items: center; text-decoration: none; }
.window-dots span { width: 38px; font-size: 12px; }
.ribbon { grid-template-columns: 250px minmax(0, 1fr) 205px; min-width: 900px; }
.brand-panel { padding: 5px 12px; }
.brand-panel img { width: 220px; max-height: 66px; }
.ribbon-actions { padding: 6px 9px; }
.ribbon-button { min-width: 66px; height: 68px; padding: 4px 7px; gap: 4px; font-size: 10.25px; }
.ribbon-button svg { width: 24px; height: 24px; }
.word-icon { width: 24px; height: 26px; font-size: 14px; }
.ribbon-separator { height: 52px; margin: 7px 5px; }
.auto-toc-status { padding: 11px 13px; }
.auto-toc-status strong { margin-bottom: 4px; font-size: 11px; }
.auto-toc-status > span { font-size: 9.5px; }
.status-check { width: 15px; height: 15px; }
.app-shell { grid-template-columns: 250px minmax(0, 1fr) 260px; min-width: 900px; transition: grid-template-columns .2s ease; }
.sidebar-title-row, .inspector-header { min-height: 39px; padding: 0 12px; }
.sidebar-title-row h2, .inspector-header h2 { font-size: 11px; }
.sidebar-icons { gap: 10px; font-size: 15px; }
.project-compact { padding: 9px 11px; }
.section-list { padding-left: 6px; padding-right: 6px; }
.section-item { min-height: 34px; padding-left: 7px; gap: 5px; }
.section-item-title { font-size: 11.25px; }
.add-section-button { min-height: 39px; margin: 7px 9px; font-size: 11px; }
.sidebar-settings { padding: 5px 10px 9px; }
.inspector-tab { height: 33px; font-size: 10px; }
.inspector-section { padding: 10px 12px; }
.inspector-section h3 { font-size: 11px; margin-bottom: 8px; }
.workspace { position: relative; }
.workspace-meta { flex-basis: 52px; padding: 6px 14px; }
.section-title-input { font-size: 16px; }
.format-toolbar { min-height: 37px; padding: 3px 8px; }
.format-toolbar button, .format-toolbar select { height: 28px; min-width: 28px; font-size: 10px; }
.ruler { flex-basis: 19px; }
.editor-wrap { padding-left: 24px; padding-right: 24px; }
.editor { width: min(830px, 100%); }
.status-bar { min-width: 900px; font-size: 9.75px; }
.status-bar > div { padding: 0 12px; }
.panel-header-actions { display: flex; align-items: center; gap: 9px; }
.panel-toggle { width: 25px; height: 25px; border: 1px solid rgba(255,255,255,.14); border-radius: 4px; color: #e7f3fc; background: rgba(255,255,255,.05); font-size: 18px; line-height: 1; }
.panel-toggle:hover { background: rgba(57,182,255,.2); border-color: rgba(84,196,255,.45); }
.panel-reopen { display: none; position: absolute; z-index: 12; top: 9px; width: 28px; height: 34px; border: 1px solid #b9c8d4; color: #164e78; background: rgba(255,255,255,.94); box-shadow: 0 3px 10px rgba(4,20,35,.14); font-size: 20px; }
.panel-reopen-left { left: 0; border-radius: 0 6px 6px 0; }
.panel-reopen-right { right: 0; border-radius: 6px 0 0 6px; }
.app-shell.left-collapsed { grid-template-columns: 0 minmax(0,1fr) 260px; }
.app-shell.right-collapsed { grid-template-columns: 250px minmax(0,1fr) 0; }
.app-shell.left-collapsed.right-collapsed { grid-template-columns: 0 minmax(0,1fr) 0; }
.app-shell.left-collapsed .book-sidebar,
.app-shell.right-collapsed .inspector { visibility: hidden; overflow: hidden; }
.app-shell.left-collapsed .panel-reopen-left,
.app-shell.right-collapsed .panel-reopen-right { display: block; }

@media (max-width: 1250px) {
  .ribbon, .titlebar { grid-template-columns: 230px 1fr auto; }
  .brand-panel img { width: 205px; }
  .app-shell { grid-template-columns: 230px minmax(0,1fr) 235px; }
  .app-shell.left-collapsed { grid-template-columns: 0 minmax(0,1fr) 235px; }
  .app-shell.right-collapsed { grid-template-columns: 230px minmax(0,1fr) 0; }
  .app-shell.left-collapsed.right-collapsed { grid-template-columns: 0 minmax(0,1fr) 0; }
  .ribbon-button { min-width: 62px; }
  .ribbon { grid-template-columns: 230px 1fr; }
}
@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 220px minmax(0,1fr); }
  .app-shell.left-collapsed { grid-template-columns: 0 minmax(0,1fr); }
  .titlebar, .ribbon, .status-bar, .app-shell { min-width: 700px; }
  .titlebar, .ribbon { grid-template-columns: 220px 1fr auto; }
  .ribbon { grid-template-columns: 220px 1fr; }
  .brand-panel img { width: 198px; }
}
