:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-soft: #eef3f6;
  --ink: #1c252c;
  --muted: #68737d;
  --line: #d9e0e5;
  --accent: #0b746f;
  --accent-strong: #095c58;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(31, 45, 61, 0.13);
  --topbar-bg: rgba(244, 245, 247, 0.92);
  --field-bg: #ffffff;
}

html[data-theme="dark"] {
  --bg: #101417;
  --panel: #171d21;
  --panel-soft: #20282d;
  --ink: #edf3f5;
  --muted: #9aa8b1;
  --line: #303b42;
  --accent: #22a39c;
  --accent-strong: #7edbd5;
  --danger: #ff8a80;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  --topbar-bg: rgba(16, 20, 23, 0.92);
  --field-bg: #11171a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.app-shell.sidebar-compact {
  grid-template-columns: 76px minmax(0, 1fr);
}

.app-shell.sidebar-compact .sidebar {
  padding: 18px 12px;
}

.app-shell.sidebar-compact .brand {
  justify-content: center;
  padding-right: 0;
}

.app-shell.sidebar-compact .sidebar-collapse {
  position: static;
  margin-top: 8px;
}

.app-shell.sidebar-compact .brand-text,
.app-shell.sidebar-compact .search,
.app-shell.sidebar-compact .tree-item span,
.app-shell.sidebar-compact .tree-children {
  display: none;
}

.app-shell.sidebar-compact .tree-row {
  grid-template-columns: 1fr;
}

.app-shell.sidebar-compact .tree-toggle {
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 22px;
}

.brand {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
  padding-right: 46px;
}

.sidebar-collapse {
  position: absolute;
  right: 0;
  top: 2px;
  margin-left: 0;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #fff;
  background: var(--accent) center / cover no-repeat url("favicon.png");
  font-weight: 800;
  overflow: hidden;
  text-indent: -999px;
}

.brand span,
.admin-header span,
.field span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.search input,
.field input,
.field select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--ink);
  padding: 9px 11px;
}

.search {
  display: block;
  margin-bottom: 18px;
}

.page-tree {
  display: grid;
  gap: 3px;
}

.tree-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  border-radius: 8px;
}

.tree-row:hover,
.tree-row.active {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.tree-item {
  display: block;
  color: var(--ink);
  text-decoration: none;
  padding: 8px 10px 8px 0;
  min-width: 0;
}

.tree-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-toggle {
  width: 28px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.tree-toggle:disabled {
  opacity: 0.45;
  cursor: default;
}

.tree-item:hover,
.tree-item.active {
  background: transparent;
}

.tree-item small {
  color: var(--muted);
}

.tree-children {
  margin-left: 17px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.content-shell {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  padding: 0 26px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.storage-status {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  padding: 6px 10px;
}

.storage-status.remote {
  border-color: rgba(11, 116, 111, 0.28);
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
}

.storage-status.error {
  border-color: #f2c2bd;
  color: var(--danger);
  background: #fff5f4;
}

.breadcrumbs {
  color: var(--muted);
  font-size: 14px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article {
  max-width: 980px;
  margin: 0 auto;
  padding: 42px 36px 72px;
}

.page-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 8px 12px;
  margin-bottom: 22px;
}

.page-back:disabled {
  opacity: 0.45;
  cursor: default;
}

.article-cover {
  width: 100%;
  max-height: 330px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 28px;
}

.article h1 {
  margin: 0 0 22px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.05;
}

.article h2 {
  margin-top: 34px;
  font-size: 28px;
}

.article h3 {
  margin-top: 26px;
  font-size: 21px;
}

.document-content p,
.document-content li,
.editable p,
.editable li {
  font-size: 17px;
  line-height: 1.72;
}

.document-content a,
.editable a {
  color: var(--accent-strong);
}

.document-content a.no-underline,
.editable a.no-underline {
  text-decoration: none;
}

.document-content figure,
.editable figure {
  margin: 22px 0;
}

.document-content .column-list,
.editable .column-list {
  display: flex !important;
  gap: 24px;
  align-items: flex-start;
}

.document-content .column,
.editable .column {
  flex: 1 1 0;
  min-width: 0;
}

.document-content img,
.document-content video,
.editable img,
.editable video {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.document-content img {
  cursor: zoom-in;
}

.document-content .link-to-page a,
.editable .link-to-page a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 13px 15px;
  text-decoration: none;
  font-weight: 650;
}

.document-content details,
.editable details {
  border-left: 2px solid var(--line);
  margin: 18px 0;
  padding-left: 14px;
}

.toggle-body {
  min-height: 42px;
  border-radius: 8px;
  padding: 6px 0 6px 10px;
}

.toggle-body:empty::before {
  content: "Write hidden content here...";
  color: var(--muted);
}

.document-content summary,
.editable summary {
  cursor: pointer;
  font-weight: 750;
  color: var(--accent-strong);
  margin-bottom: 10px;
}

.document-content details[open] summary,
.editable details[open] summary {
  margin-bottom: 12px;
}

.icon-button,
.ghost-button,
.primary-button,
.danger-button,
.toolbar button,
.color-control,
.upload-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 8px 12px;
}

.icon-button {
  width: 40px;
  padding: 0;
  font-size: 21px;
}

.hamburger-icon,
.hamburger-icon::before,
.hamburger-icon::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.hamburger-icon {
  position: relative;
  margin: 0 auto;
}

.hamburger-icon::before,
.hamburger-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.hamburger-icon::before {
  top: -6px;
}

.hamburger-icon::after {
  top: 6px;
}

.primary-button {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-strong);
}

.danger-button {
  border-color: #f2c2bd;
  color: var(--danger);
}

.admin-drawer,
.auth-drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  background: rgba(16, 24, 32, 0.38);
}

.admin-drawer.open,
.auth-drawer.open {
  display: block;
}

.admin-panel,
.auth-panel {
  width: min(1480px, calc(100vw - 28px));
  height: calc(100vh - 28px);
  margin: 14px auto;
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-panel {
  width: min(440px, calc(100vw - 28px));
  height: auto;
}

.auth-body {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  border-bottom: 1px solid var(--line);
  padding: 0 18px 0 22px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 280px;
  height: calc(100% - 66px);
}

.admin-list {
  overflow: auto;
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 16px;
}

.admin-list-actions,
.editor-actions,
.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-pages {
  display: grid;
  gap: 4px;
  margin-top: 14px;
}

.admin-page-button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 9px 10px;
}

.admin-page-button.active,
.admin-page-button:hover {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.admin-page-button span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.editor {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 18px;
  min-height: 0;
}

.editor-row {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.editor-row.two {
  grid-template-columns: minmax(0, 1fr) 150px;
}

.editor-row.three {
  grid-template-columns: minmax(0, 1fr) 110px 130px;
}

.field {
  display: grid;
  gap: 6px;
}

.check-field {
  display: flex;
  align-items: end;
  gap: 8px;
  padding-bottom: 8px;
}

.check-field input {
  width: auto;
  min-height: auto;
}

.toolbar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 8px;
  margin: 4px 0 12px;
  flex-shrink: 0;
}

.compact-toolbar {
  align-items: center;
  gap: 8px;
  overflow: visible;
}

.toolbar select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 8px 10px;
}

.tool-menu {
  position: relative;
}

.tool-menu summary {
  list-style: none;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 8px 30px 8px 12px;
  cursor: pointer;
  user-select: none;
}

.tool-menu summary::-webkit-details-marker {
  display: none;
}

.tool-menu summary::after {
  content: "v";
  position: absolute;
  right: 11px;
  top: 9px;
  color: var(--muted);
  font-size: 12px;
}

.tool-menu[open] summary {
  border-color: var(--accent);
}

.tool-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 7px);
  z-index: 70;
  display: grid;
  gap: 6px;
  min-width: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 8px;
  box-shadow: var(--shadow);
}

.tool-popover button,
.tool-popover label {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field-bg);
  color: var(--ink);
  text-align: left;
  padding: 7px 10px;
}

.tool-popover button:hover,
.tool-popover label:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--field-bg));
}

.tool-popover select {
  width: 100%;
  margin-top: 6px;
}

.color-popover {
  min-width: 250px;
}

.swatch-row {
  display: flex;
  gap: 8px;
}

[data-help] {
  position: relative;
}

[data-help]:hover::before {
  content: attr(data-help);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 90;
  width: max-content;
  max-width: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: var(--panel);
  font-size: 12px;
  line-height: 1.35;
  padding: 8px 10px;
  box-shadow: var(--shadow);
  pointer-events: none;
}

.color-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.color-control span {
  color: var(--ink);
  font-size: 15px;
}

.color-control input {
  width: 28px;
  height: 24px;
  border: 0;
  background: transparent;
  padding: 0;
}

.toolbar .swatch {
  width: 38px;
  padding: 0;
}

.toolbar .swatch::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.upload-button {
  position: relative;
  overflow: hidden;
}

.upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.document-canvas {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 28px;
}

.editable {
  width: min(850px, 100%);
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  margin: 0 auto;
  padding: 32px;
  line-height: 1.65;
  outline: none;
  display: flow-root;
  box-shadow: var(--shadow);
}

.editor-block {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  border-radius: 8px;
  padding: 2px 0;
}

.editor-block:hover {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.block-controls {
  display: flex;
  flex-direction: column;
  gap: 3px;
  opacity: 0;
  padding-top: 3px;
  transition: opacity 0.14s ease;
}

.editor-block:hover .block-controls,
.editor-block:focus-within .block-controls {
  opacity: 1;
}

.block-controls button {
  width: 26px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  padding: 0;
}

.editor-block.dragging {
  opacity: 0.42;
}

.editor-block.pointer-dragging {
  pointer-events: none;
}

body.block-drag-active {
  cursor: grabbing;
  user-select: none;
}

.editor-block.drop-before::before,
.editor-block.drop-after::after {
  content: "";
  position: absolute;
  left: 36px;
  right: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
}

.editor-block.drop-before::before {
  top: -3px;
}

.editor-block.drop-after::after {
  bottom: -3px;
}

[data-block-drag] {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

[data-block-drag]:active {
  cursor: grabbing;
}

.block-content {
  min-width: 0;
}

.block-content > :first-child {
  margin-top: 0;
}

.block-content > :last-child {
  margin-bottom: 0;
}

.slash-menu,
.bubble-toolbar {
  position: fixed;
  z-index: 80;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.slash-menu {
  width: 270px;
  max-height: 310px;
  overflow: auto;
  padding: 6px;
}

.slash-menu button {
  display: grid;
  width: 100%;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 8px 10px;
}

.slash-menu button:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.slash-menu span {
  color: var(--muted);
  font-size: 12px;
}

.bubble-toolbar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px;
}

.bubble-toolbar button,
.bubble-toolbar label {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field-bg);
  color: var(--ink);
  font-size: 13px;
  padding: 5px 8px;
}

.bubble-toolbar input {
  width: 22px;
  height: 18px;
  border: 0;
  padding: 0;
  background: transparent;
  vertical-align: middle;
}

.callout-block {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  padding: 14px;
}

.callout-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.code-block {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #071013;
  color: #d6f3ef;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  padding: 14px;
}

.formula-block,
.date-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--ink);
  padding: 5px 9px;
}

.formula-block {
  border-radius: 8px;
  font-family: ui-serif, Georgia, serif;
}

.todo-block {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editable::after {
  content: "";
  display: block;
  clear: both;
}

.editable:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 116, 111, 0.13);
}

.editor-actions {
  align-items: center;
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding: 14px 0 0;
  background: var(--panel);
  flex-shrink: 0;
}

.document-content blockquote,
.editable blockquote {
  border-left: 3px solid var(--accent);
  margin: 18px 0;
  padding: 8px 0 8px 16px;
  color: var(--muted);
}

.document-content table,
.editable table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.document-content td,
.document-content th,
.editable td,
.editable th {
  border: 1px solid var(--line);
  padding: 8px;
}

.insert-panel {
  overflow: auto;
  border-left: 1px solid var(--line);
  background: var(--panel);
  padding: 18px;
}

.insert-tabs {
  display: flex;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.insert-tabs span,
.insert-panel p {
  color: var(--muted);
  font-size: 13px;
}

.insert-panel button {
  display: block;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--ink);
  text-align: left;
  padding: 9px 12px;
  margin-bottom: 8px;
}

.insert-panel button:hover {
  border-color: var(--accent);
}

.spacer {
  flex: 1;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: none;
  max-width: 360px;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.toast.show {
  display: block;
}

.scroll-top {
  position: fixed;
  right: 18px;
  bottom: 82px;
  z-index: 25;
  width: 48px;
  height: 48px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 72%, transparent);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.scroll-top.show {
  opacity: 0.72;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top:hover {
  opacity: 1;
}

.image-modal {
  background: rgba(0, 0, 0, 0.82);
  z-index: 60;
}

.image-modal .modal-dialog {
  width: min(1120px, calc(100vw - 24px));
  max-width: none;
  margin: 12px auto;
}

.image-modal .modal-content {
  height: calc(100vh - 24px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  overflow: hidden;
}

.image-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  padding: 9px 12px;
}

.image-modal-actions {
  display: flex;
  gap: 8px;
}

.image-modal-actions .icon-button {
  width: auto;
  min-width: 42px;
  padding: 0 10px;
}

.image-modal-body {
  height: calc(100% - 58px);
  padding: 0;
}

.image-stage {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 24px;
  background: #050708;
}

.image-stage img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  transform-origin: center center;
  transition: transform 0.16s ease;
}

.sidebar-toggle {
  display: none;
}

@media (max-width: 900px) {
  .article {
    padding: 30px 18px 56px;
  }

  .admin-grid,
  .editor-row.two,
  .editor-row.three {
    grid-template-columns: 1fr;
  }

  .admin-panel {
    width: 100vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
  }

  .admin-grid {
    overflow: auto;
    height: calc(100% - 66px);
  }

  .admin-list,
  .editor {
    overflow: visible;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-shell.sidebar-compact {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 15;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    width: min(92vw, 420px);
    max-width: 100vw;
    padding: 18px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .app-shell.sidebar-compact .brand-text,
  .app-shell.sidebar-compact .search,
  .app-shell.sidebar-compact .tree-item span,
  .app-shell.sidebar-compact .tree-children {
    display: block;
  }

  .app-shell.sidebar-compact .tree-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .app-shell.sidebar-compact .brand {
    justify-content: flex-start;
    padding-right: 46px;
  }

  .app-shell.sidebar-compact .sidebar-collapse {
    position: absolute;
    right: 0;
    top: 2px;
    margin-top: 0;
  }

  .sidebar-toggle {
    display: block;
  }

  .topbar {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-areas:
      "menu actions"
      "crumb crumb";
    gap: 8px;
    height: auto;
    min-height: 72px;
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 12px 8px;
  }

  .sidebar-toggle {
    grid-area: menu;
  }

  .breadcrumbs {
    grid-area: crumb;
    font-size: 13px;
    white-space: normal;
    line-height: 1.25;
    max-height: 34px;
  }

  .topbar-actions {
    grid-area: actions;
    gap: 7px;
    justify-content: end;
    min-width: 0;
  }

  .storage-status {
    max-width: 106px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar .ghost-button {
    padding-inline: 10px;
  }

  .article {
    width: 100%;
    max-width: none;
    padding: 24px 16px 56px;
  }

  .article h1 {
    font-size: clamp(31px, 10vw, 44px);
    overflow-wrap: anywhere;
  }

  .article h2 {
    font-size: 24px;
  }

  .article h3 {
    font-size: 20px;
  }

  .article p,
  .article li {
    font-size: 18px;
    line-height: 1.65;
    overflow-wrap: anywhere;
  }

  .article figure {
    margin: 20px 0;
  }

  .article .column-list {
    display: grid !important;
    gap: 18px;
  }

  .article .column {
    width: 100% !important;
  }

  .article img,
  .article video {
    width: 100%;
    max-width: 100%;
  }

  .image-modal .modal-dialog {
    width: 100vw;
    margin: 0;
  }

  .image-modal .modal-content {
    height: 100vh;
    border-radius: 0;
  }

  .image-stage {
    padding: 12px;
  }

}
