/*
  MagicFeather v5.27c theme regression repair
  Component layer: layout, structure, states and responsive behavior.
  Theme values live in theme_tokens.css. Components must not encode
  Light/Dark colors directly.
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--mf-bg-page);
  color: var(--mf-text-main);
  accent-color: var(--mf-accent);
}

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at top right, var(--mf-bg-page-glow), transparent 34rem),
    linear-gradient(135deg, var(--mf-bg-page), var(--mf-bg-page-soft));
  color: var(--mf-text-main);
  font-family: var(--mf-font-ui);
  font-size: var(--mf-type-base);
  line-height: 1.55;
  text-rendering: geometricPrecision;
}

[hidden] {
  display: none;
}

.mf-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

img,
svg {
  max-width: 100%;
  display: block;
}

svg {
  flex: 0 0 auto;
}

a {
  color: var(--mf-link);
  text-decoration: none;
}

a:hover {
  color: var(--mf-link-hover);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
[aria-disabled="true"],
.disabled {
  cursor: not-allowed;
  opacity: var(--mf-opacity-disabled);
}

:focus-visible {
  outline: var(--mf-focus-ring);
  outline-offset: var(--mf-focus-offset);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--mf-text-heading);
  font-family: var(--mf-font-display);
  line-height: 1.12;
  margin: 0;
}

h1 {
  font-size: clamp(var(--mf-type-2xl), 2.4vw, var(--mf-type-4xl));
  letter-spacing: var(--mf-track-tight);
}

h2 {
  font-size: clamp(var(--mf-type-xl), 1.5vw, var(--mf-type-2xl));
}

h3 {
  font-size: var(--mf-type-lg);
}

p {
  margin: 0;
}

p + p {
  margin-top: var(--mf-space-4);
}

code,
pre {
  font-family: var(--mf-font-mono);
}

code {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-xs);
  background: var(--mf-bg-code);
  color: var(--mf-text-code);
  padding: 0 var(--mf-space-1);
  font-size: var(--mf-type-xs);
}

.muted,
.helptext,
.hint,
small {
  color: var(--mf-text-muted);
}

.eyebrow,
.nav-label,
.section-kicker,
[class*="eyebrow"],
[class*="topline"] {
  margin: 0;
  color: var(--mf-text-accent);
  font-size: var(--mf-type-xs);
  font-weight: var(--mf-weight-black);
  letter-spacing: var(--mf-track-label);
  text-transform: uppercase;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--mf-sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: var(--mf-z-sidebar);
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: var(--mf-space-6);
  padding: var(--mf-space-6) var(--mf-space-4);
  overflow: auto;
  background:
    radial-gradient(circle at top left, var(--mf-sidebar-glow), transparent 22rem),
    linear-gradient(180deg, var(--mf-bg-sidebar), var(--mf-bg-sidebar-soft));
  color: var(--mf-text-inverted);
  border-right: 1px solid var(--mf-border-inverted);
  box-shadow: var(--mf-shadow-sidebar);
}

.brand {
  display: grid;
  grid-template-columns: var(--mf-brand-logo-size) minmax(0, 1fr);
  gap: var(--mf-space-3);
  align-items: center;
  color: var(--mf-text-inverted);
}

.brand-logo,
.brand-mark {
  width: var(--mf-brand-logo-size);
  height: var(--mf-brand-logo-size);
  border-radius: var(--mf-radius-md);
  object-fit: contain;
  object-position: center center;
  box-shadow: var(--mf-shadow-brand);
}

.brand strong {
  display: block;
  color: var(--mf-text-inverted);
  font-size: var(--mf-type-lg);
  line-height: 1;
}

.brand span {
  display: block;
  margin-top: var(--mf-space-1);
  color: var(--mf-text-inverted-muted);
  font-size: var(--mf-type-xs);
  font-weight: var(--mf-weight-bold);
  letter-spacing: var(--mf-track-wide);
  text-transform: uppercase;
}

.side-nav,
.nav-group-links,
.sidebar-bottom {
  display: grid;
  gap: var(--mf-space-1);
}

.nav-label {
  margin: var(--mf-space-4) var(--mf-space-2) var(--mf-space-1);
  color: var(--mf-text-inverted-muted);
}

.side-nav a,
.sidebar-bottom a,
.sidebar-bottom button,
.link-button,
.nav-group summary {
  min-height: var(--mf-control-height);
  display: flex;
  align-items: center;
  gap: var(--mf-space-3);
  width: 100%;
  padding: var(--mf-space-3);
  border: 1px solid transparent;
  border-radius: var(--mf-radius-sm);
  background: transparent;
  color: var(--mf-text-inverted);
  font-weight: var(--mf-weight-bold);
  text-align: left;
}

.side-nav a:hover,
.side-nav a.is-active,
.side-nav a.active,
.sidebar-bottom a:hover,
.sidebar-bottom button:hover,
.nav-group[open] > summary {
  background: var(--mf-sidebar-active-bg);
  color: var(--mf-text-inverted);
  border-color: var(--mf-sidebar-active-border);
}

.nav-group {
  display: grid;
  gap: var(--mf-space-2);
  border-top: 1px solid var(--mf-border-inverted);
  padding-top: var(--mf-space-2);
}

.nav-group summary {
  list-style: none;
  justify-content: space-between;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group summary::after {
  content: "+";
  color: var(--mf-text-inverted-muted);
}

.nav-group[open] summary::after {
  content: "–";
}

.ui-icon {
  width: var(--mf-icon-size);
  height: var(--mf-icon-size);
  color: currentColor;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 0;
}

.ui-icon use {
  fill: currentColor;
  stroke: currentColor;
}

.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid var(--mf-border-inverted);
  padding-top: var(--mf-space-4);
}

.mobile-nav-toggle,
.sidebar-collapse-toggle {
  display: none;
}

.mf-theme-switcher-v522i {
  display: grid;
  gap: var(--mf-space-2);
  margin-top: var(--mf-space-3);
  padding-top: var(--mf-space-3);
  border-top: 1px solid var(--mf-border-inverted);
}

.mf-theme-toggle-group-v522i {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--mf-space-2);
}

.mf-theme-toggle-group-v522i button {
  min-height: var(--mf-control-height-sm);
  border: 1px solid var(--mf-border-inverted);
  border-radius: var(--mf-radius-sm);
  background: var(--mf-sidebar-control-bg);
  color: var(--mf-text-inverted);
  font-size: var(--mf-type-sm);
  font-weight: var(--mf-weight-black);
}

.mf-theme-toggle-group-v522i button.is-active,
.mf-theme-toggle-group-v522i button[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--mf-accent), var(--mf-accent-hover));
  color: var(--mf-text-on-accent);
  border-color: var(--mf-accent-strong);
}

.content-wrap {
  min-width: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--mf-z-topbar);
  min-height: var(--mf-topbar-height);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--mf-space-4);
  padding: var(--mf-space-3) var(--mf-page-pad-x);
  background: var(--mf-bg-topbar);
  color: var(--mf-text-main);
  border-bottom: 1px solid var(--mf-border-soft);
  backdrop-filter: var(--mf-backdrop-blur);
}

.topbar-copy {
  min-width: 0;
}

.topbar-copy strong {
  display: block;
  color: var(--mf-text-heading);
  font-size: var(--mf-type-xl);
}

.topbar-copy span,
.top-user span {
  display: block;
  color: var(--mf-text-muted);
  font-size: var(--mf-type-sm);
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--mf-space-2);
}

.top-status,
.top-user {
  justify-self: end;
}

.container {
  width: min(var(--mf-container-max), 100%);
  margin-inline: auto;
  padding: var(--mf-page-pad-y) var(--mf-page-pad-x) calc(var(--mf-footer-height) + var(--mf-space-10));
}

.footer,
.footer-v522h {
  position: sticky;
  bottom: 0;
  z-index: var(--mf-z-footer);
  min-height: var(--mf-footer-height);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--mf-space-3);
  padding: var(--mf-space-2) var(--mf-page-pad-x);
  background: var(--mf-bg-footer);
  color: var(--mf-text-muted);
  border-top: 1px solid var(--mf-border-soft);
  backdrop-filter: var(--mf-backdrop-blur);
}

.footer-brand strong {
  color: var(--mf-text-heading);
  font-size: var(--mf-type-xs);
}

.footer-center-v522h,
.footer-health-v522h {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--mf-space-2);
}

.footer-health-v522h {
  justify-content: flex-end;
}

.card,
.hero-card,
.small-card,
.form-card,
.empty-state,
.panel,
.table-card,
.list-card,
.project-card,
.volume-card,
.series-header,
.polished-detail,
.detail-section,
.knowledge-card,
.knowledge-dashboard-card,
.storycontrol-card-v44,
.server-cockpit-card,
.cockpit-card-v511,
.metric-v511,
.transfer-card,
.transfer-file-row,
.project-index-card,
.editor-main,
.editor-writing-card,
.editor-stat-card,
.chapter-note-item-v45,
.ai-provider-card-v50,
.ai-task-row-v52,
.module-entry-card-v524e,
.mf-confirm-dialog {
  background: var(--mf-bg-card);
  color: var(--mf-text-main);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-lg);
  box-shadow: var(--mf-shadow-card);
}

.card,
.small-card,
.form-card,
.empty-state,
.project-card,
.volume-card,
.series-header,
.knowledge-card,
.storycontrol-card-v44,
.server-cockpit-card,
.cockpit-card-v511,
.metric-v511,
.module-entry-card-v524e {
  padding: var(--mf-card-pad);
}

.hero-card,
.series-hero-polished,
.detail-hero-row,
.project-index-head,
.editor-head-v10,
.clean-title,
.cockpit-hero-v511,
.ai-hero-v50,
.ai-test-hero-v51,
.delete-impact-hero-v58a,
.module-hero-v524b {
  background:
    radial-gradient(circle at top right, var(--mf-bg-panel-glow), transparent 26rem),
    linear-gradient(135deg, var(--mf-bg-panel), var(--mf-bg-panel-strong));
  color: var(--mf-text-main);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-xl);
  box-shadow: var(--mf-shadow-card);
  padding: var(--mf-hero-pad);
}

.hero-card,
.series-header,
.clean-title {
  margin-bottom: var(--mf-space-6);
}

.hero-card p,
.series-header p,
.clean-title p {
  max-width: 78ch;
  color: var(--mf-text-muted);
}

.grid,
.cards,
.knowledge-grid,
.overview-grid,
.series-preview-grid,
.theme-audit-grid-v527a,
.theme-audit-grid-v527b {
  display: grid;
  gap: var(--mf-space-4);
}

.grid.cards,
.cards,
.knowledge-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--mf-card-min)), 1fr));
}

.two-col-fields,
.overview-grid,
.series-preview-grid,
.theme-audit-grid-v527a,
.theme-audit-grid-v527b {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-grid,
.detail-page-grid,
.editor-layout,
.editor-layout-wide,
.editor-layout-v55a,
.series-workspace,
.knowledge-layout,
.ai-layout-v50,
.ai-test-layout-v51,
.module-hero-v524b {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, var(--mf-side-panel-width));
  gap: var(--mf-space-5);
  align-items: start;
}

.editor-layout-v55a {
  min-height: var(--mf-editor-workspace-height, auto);
}

.editor-layout-v55a .editor-main,
.editor-layout-v55a .editor-writing-card,
.editor-layout-v55a .project-index-card {
  min-height: 0;
}

.editor-layout-v55a .project-index-card,
.series-workspace-side,
.editor-context-panel,
.context-panel {
  position: sticky;
  top: calc(var(--mf-topbar-height) + var(--mf-space-4));
  max-height: calc(100vh - var(--mf-topbar-height) - var(--mf-footer-height) - var(--mf-space-6));
  overflow: auto;
}

.btn,
button.btn,
.mini-btn,
.link-button,
.download-link,
.auth-link,
.project-index-tabs button,
.knowledge-filter-chip,
.cockpit-chip,
.footer-health-chip-v522h {
  min-height: var(--mf-control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--mf-space-2);
  border: 1px solid var(--mf-control-border);
  border-radius: var(--mf-radius-sm);
  background: var(--mf-control-bg);
  color: var(--mf-control-text);
  padding: var(--mf-control-pad-y) var(--mf-control-pad-x);
  font-size: var(--mf-type-sm);
  font-weight: var(--mf-weight-black);
  line-height: 1.1;
  text-align: center;
  box-shadow: var(--mf-shadow-control);
  transition: transform var(--mf-motion-fast), background-color var(--mf-motion-fast), border-color var(--mf-motion-fast), box-shadow var(--mf-motion-fast);
}

.btn:hover,
button.btn:hover,
.mini-btn:hover,
.download-link:hover,
.project-index-tabs button:hover,
.knowledge-filter-chip:hover,
.cockpit-chip:hover,
.footer-health-chip-v522h:hover {
  transform: translateY(-1px);
  background: var(--mf-control-bg-hover);
  border-color: var(--mf-control-border-hover);
}

.btn.primary,
button.primary,
.primary,
.project-index-tabs button.active,
.knowledge-filter-chip.active {
  background: linear-gradient(135deg, var(--mf-accent), var(--mf-accent-hover));
  color: var(--mf-text-on-accent);
  border-color: var(--mf-accent-strong);
}

.btn.danger,
.danger-soft-v58,
.danger-soft-v54b,
.danger-btn-v58,
.danger-chip-v40a {
  background: var(--mf-danger-soft);
  color: var(--mf-danger);
  border-color: var(--mf-danger-border);
}

.btn.mini,
.mini-btn,
.download-link,
.footer-health-chip-v522h {
  min-height: var(--mf-control-height-sm);
  border-radius: var(--mf-radius-pill);
  padding: var(--mf-space-2) var(--mf-space-3);
  font-size: var(--mf-type-xs);
}

.mf-btn-icon-only-v524i,
.mf-modal-close-x-v525e,
.trash-icon-button,
.drawer-close,
.sidebar-collapse-toggle {
  width: var(--mf-icon-button-size);
  min-width: var(--mf-icon-button-size);
  height: var(--mf-icon-button-size);
  min-height: var(--mf-icon-button-size);
  padding: 0;
  border-radius: var(--mf-radius-md);
}

.field,
.compact-form .field,
form label,
.filter-form label {
  display: grid;
  gap: var(--mf-space-2);
}

label,
.field span,
.filter-form span {
  color: var(--mf-text-heading);
  font-size: var(--mf-type-sm);
  font-weight: var(--mf-weight-black);
}

input,
select,
textarea,
.field input,
.field select,
.field textarea,
.filter-form input,
.filter-form select,
#chapterText,
.writing-textarea,
.writing-textarea-v10,
.writing-textarea-v11 {
  width: 100%;
  min-height: var(--mf-control-height);
  border: 1px solid var(--mf-input-border);
  border-radius: var(--mf-radius-sm);
  background: var(--mf-input-bg);
  color: var(--mf-input-text);
  padding: var(--mf-space-3);
  box-shadow: var(--mf-shadow-input);
}

textarea,
#chapterText,
.writing-textarea,
.writing-textarea-v10,
.writing-textarea-v11 {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--mf-input-placeholder);
}

input:focus,
select:focus,
textarea:focus,
#chapterText:focus,
.writing-textarea:focus {
  border-color: var(--mf-input-border-focus);
  outline: var(--mf-focus-ring);
  outline-offset: 0;
}

.form-card,
.compact-form,
.auth-form,
.mf-login-form,
.mf-modal-form {
  display: grid;
  gap: var(--mf-space-4);
}

.form-actions,
.mf-form-page-actions-v524m5,
.mf-modal-actions,
.mf-app-modal-actions-v524m1,
.drawer-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--mf-space-3);
  margin-top: var(--mf-space-5);
}

.mf-form-page-actions-left-v524m5,
.module-detail-actions-start-v524i {
  justify-self: start;
}

.mf-form-page-actions-right-v524m5,
.module-detail-actions-end-v524i,
.module-detail-actions-side-v524i {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--mf-space-2);
}

.badge,
.pill,
.chip,
.status-pill,
.count-pill,
.meta-pill,
.mini-pill,
.type-pill,
.quality-chip,
.price-badge,
.price-badge-v515,
.section-status,
.section-type-badge,
.word-pill,
.save-state-pill,
.context-chip,
.project-index-chip,
.knowledge-meta-badges span,
.meta-row span,
.drawer-meta span,
.drawer-facts span,
.mini-chip-v511 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--mf-space-1);
  min-height: var(--mf-chip-height);
  padding: var(--mf-space-1) var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-pill);
  background: var(--mf-bg-chip);
  color: var(--mf-text-main);
  font-size: var(--mf-type-xs);
  font-weight: var(--mf-weight-black);
  line-height: 1.1;
}

.save-state-pill.saved,
.is-ok,
.status-ok,
.ok {
  color: var(--mf-success);
}

.status-warn,
.warn,
.attention {
  color: var(--mf-warning);
}

.is-bad,
.status-danger,
.danger,
.error,
.form-errors,
.field-error {
  color: var(--mf-danger);
}

.form-errors,
.field-error,
.msg.error {
  border: 1px solid var(--mf-danger-border);
  border-radius: var(--mf-radius-sm);
  background: var(--mf-danger-soft);
  padding: var(--mf-space-3);
}

.msg,
.messages > * {
  border: 1px solid var(--mf-success-border);
  border-radius: var(--mf-radius-sm);
  background: var(--mf-success-soft);
  color: var(--mf-success);
  padding: var(--mf-space-3);
}

.progress-track,
.volume-progress,
.bar-v511,
.theme-audit-progress-track-v527b,
.theme-audit-progress-track-v527a {
  height: var(--mf-progress-height);
  border-radius: var(--mf-radius-pill);
  background: var(--mf-bg-track);
  overflow: hidden;
}

.progress-fill,
.volume-progress > div,
.bar-v511 > i,
.theme-audit-progress-fill-v527b,
.theme-audit-progress-fill-v527a {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mf-accent), var(--mf-cyan));
  transition: width var(--mf-motion-normal);
}

progress.progress-fill,
progress.volume-progress-value,
progress.bar-value-v511 {
  width: 100%;
  height: var(--mf-progress-height);
  appearance: none;
  border: 0;
  border-radius: var(--mf-radius-pill);
  overflow: hidden;
  background: var(--mf-bg-track);
}

progress.progress-fill::-webkit-progress-bar,
progress.volume-progress-value::-webkit-progress-bar,
progress.bar-value-v511::-webkit-progress-bar {
  background: var(--mf-bg-track);
}

progress.progress-fill::-webkit-progress-value,
progress.volume-progress-value::-webkit-progress-value,
progress.bar-value-v511::-webkit-progress-value {
  border-radius: var(--mf-radius-pill);
  background: linear-gradient(90deg, var(--mf-accent), var(--mf-cyan));
}

progress.progress-fill::-moz-progress-bar,
progress.volume-progress-value::-moz-progress-bar,
progress.bar-value-v511::-moz-progress-bar {
  border-radius: var(--mf-radius-pill);
  background: linear-gradient(90deg, var(--mf-accent), var(--mf-cyan));
}

table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-md);
  overflow: hidden;
  background: var(--mf-bg-card);
  color: var(--mf-text-main);
}

th,
td {
  padding: var(--mf-space-3);
  border-bottom: 1px solid var(--mf-border-soft);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--mf-table-head-bg);
  color: var(--mf-text-muted);
  font-size: var(--mf-type-xs);
  font-weight: var(--mf-weight-black);
  letter-spacing: var(--mf-track-label);
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.mf-table-scroll {
  overflow-x: auto;
  border-radius: var(--mf-radius-md);
}

.project-card,
.volume-card,
.index-entry,
.mini-list a,
.series-side-nav a,
.module-entry-card-v524e {
  transition: transform var(--mf-motion-fast), border-color var(--mf-motion-fast), box-shadow var(--mf-motion-fast), background-color var(--mf-motion-fast);
}

.project-card:hover,
.volume-card:hover,
.index-entry:hover,
.mini-list a:hover,
.series-side-nav a:hover,
.module-entry-card-v524e:hover {
  transform: translateY(-2px);
  border-color: var(--mf-border-accent);
  box-shadow: var(--mf-shadow-card-hover);
}

.cover-thumb,
.series-logo,
.detail-icon,
.drawer-icon,
.side-nav-icon,
.empty-icon,
.knowledge-type-icon,
.index-avatar,
.module-entry-icon-v524e {
  display: grid;
  place-items: center;
  border-radius: var(--mf-radius-md);
  background: var(--mf-bg-icon);
  color: var(--mf-text-accent);
}

.cover-thumb {
  width: 5.5rem;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.series-logo,
.detail-icon,
.drawer-icon {
  width: 4.75rem;
  height: 4.75rem;
}

.side-nav-icon,
.index-avatar,
.knowledge-type-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--mf-radius-pill);
}

.project-body,
.detail-title-block,
.mini-main,
.index-entry-text {
  min-width: 0;
}

.project-body h2,
.knowledge-card h2,
.detail-section h2,
.project-index-head h2,
.index-entry-text strong,
.mini-list strong,
.series-side-nav strong,
.knowledge-dashboard-card strong {
  color: var(--mf-text-heading);
}

.project-body p,
.knowledge-card p,
.detail-section p,
.mini-list small,
.series-side-nav small,
.index-entry-text small {
  color: var(--mf-text-muted);
}

.readable-content,
.knowledge-content {
  max-width: 82ch;
  color: var(--mf-text-main);
  font-size: var(--mf-type-md);
  line-height: 1.72;
}

.chapter-list,
.mini-list,
.volume-overview-list,
.transfer-file-list,
.chapter-note-list-v45,
.ai-model-list-v50,
.ai-usage-list-v50,
.ai-task-list-v52 {
  display: grid;
  gap: var(--mf-space-2);
}

.chapter-list a,
.mini-list a,
.chapter-jump,
.transfer-file-row,
.service-v511,
.ai-model-row-v50,
.ai-task-row-v52 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--mf-space-3);
  align-items: center;
  padding: var(--mf-space-3);
}

.transfer-file-row {
  grid-template-columns: minmax(12rem, 1fr) minmax(7rem, auto) minmax(7rem, auto) minmax(9rem, auto) auto;
  box-shadow: none;
}

.transfer-file-row-head {
  background: var(--mf-table-head-bg);
  color: var(--mf-text-muted);
  font-size: var(--mf-type-xs);
  font-weight: var(--mf-weight-black);
  letter-spacing: var(--mf-track-label);
  text-transform: uppercase;
}

.project-index-card {
  overflow: hidden;
  padding: 0;
}

.project-index-head,
.project-index-search,
.project-index-tabs,
.project-index-filters {
  border-bottom: 1px solid var(--mf-border-soft);
  border-radius: 0;
  box-shadow: none;
  padding: var(--mf-space-4);
}

.project-index-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--mf-space-2);
}

.project-index-search {
  display: grid;
  gap: var(--mf-space-2);
}

.project-index-list,
.index-entry-list {
  display: grid;
  gap: var(--mf-space-2);
  padding: var(--mf-space-3);
}

.index-entry {
  width: 100%;
  grid-template-columns: auto minmax(0, 1fr) auto;
  border: 1px solid transparent;
  border-radius: var(--mf-radius-md);
  background: transparent;
  color: var(--mf-text-main);
  text-align: left;
}

.index-entry-text strong,
.index-entry-text small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mention-pill {
  min-width: var(--mf-chip-height);
  height: var(--mf-chip-height);
  display: grid;
  place-items: center;
  border-radius: var(--mf-radius-pill);
  background: var(--mf-success-soft);
  color: var(--mf-success);
  font-weight: var(--mf-weight-black);
}

.editor-breadcrumb,
.breadcrumb,
.meta-row,
.quick-actions,
.module-entry-badges-v524e,
.chapter-note-actions-v45,
.ai-provider-actions-v50,
.ai-route-actions-v52a {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--mf-space-2);
}

.editor-stat-grid,
.editor-meta-grid,
.cockpit-grid-v511,
.metric-grid-v511,
.ai-stats-v50,
.ai-cost-grid-v518b,
.theme-token-grid-v527a,
.theme-token-grid-v527b,
.knowledge-dashboard-v21 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  gap: var(--mf-space-3);
}

.editor-stat-card,
.metric-v511,
.cockpit-card-v511,
.knowledge-dashboard-card {
  display: grid;
  gap: var(--mf-space-2);
  align-content: start;
}

#chapterText,
.writing-textarea,
.writing-textarea-v10,
.writing-textarea-v11,
.theme-audit-editor-sample-v527a,
.theme-audit-editor-sample-v527b {
  min-height: 46rem;
  border-radius: var(--mf-radius-lg);
  background: var(--mf-editor-bg);
  color: var(--mf-editor-text);
  font-family: var(--mf-font-editor);
  font-size: var(--mf-type-editor);
  line-height: 1.72;
  padding: var(--mf-space-7);
  box-shadow: var(--mf-shadow-editor);
}

.theme-audit-editor-sample-v527a,
.theme-audit-editor-sample-v527b {
  min-height: 12rem;
}

.editor-cockpit-strip,
.editor-cockpit-strip-v55a,
.editor-cockpit-strip-v55f {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: var(--mf-space-2);
  padding: var(--mf-space-3);
  border-top: 1px solid var(--mf-border-soft);
  border-bottom: 1px solid var(--mf-border-soft);
  background: var(--mf-bg-panel);
}

.cockpit-chip,
.cockpit-chip-v55a {
  justify-content: flex-start;
  min-height: 3.75rem;
  border-left: var(--mf-status-rail) solid var(--mf-border-medium);
}

.cockpit-chip span {
  display: block;
  color: var(--mf-text-muted);
  font-size: var(--mf-type-xs);
  letter-spacing: var(--mf-track-label);
  text-transform: uppercase;
}

.cockpit-chip strong {
  color: var(--mf-text-heading);
}

.drawer,
.drawer-backdrop,
.mf-confirm-backdrop,
.mf-toast-region {
  position: fixed;
  inset: 0;
  z-index: var(--mf-z-modal);
}

.drawer-backdrop,
.mf-confirm-backdrop {
  background: var(--mf-bg-scrim);
  backdrop-filter: var(--mf-backdrop-blur);
}

dialog.mf-modal-dialog,
.mf-modal-dialog {
  width: min(var(--mf-modal-width), calc(100vw - var(--mf-space-6)));
  max-height: calc(100vh - var(--mf-space-6));
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

dialog.mf-modal-dialog::backdrop {
  background: var(--mf-bg-scrim);
  backdrop-filter: var(--mf-backdrop-blur);
}

.mf-modal-card,
.mf-app-modal-card-v524m1,
.drawer-panel,
.theme-audit-modal-sample-v522i,
.theme-audit-modal-sample-v527b {
  max-height: calc(100vh - var(--mf-space-8));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--mf-modal-bg);
  color: var(--mf-text-main);
  border: 1px solid var(--mf-border-strong);
  border-radius: var(--mf-radius-xl);
  box-shadow: var(--mf-shadow-modal);
}

.mf-modal-head,
.mf-app-modal-head-v524m1,
.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--mf-space-4);
  padding: var(--mf-space-5);
  background: var(--mf-modal-head-bg);
  border-bottom: 1px solid var(--mf-border-soft);
}

.mf-modal-body,
.mf-app-modal-body-v524m1,
.drawer-content {
  min-height: 0;
  overflow: auto;
  padding: var(--mf-space-5);
}

.mf-modal-actions,
.mf-app-modal-actions-v524m1 {
  margin: 0;
  padding: var(--mf-space-4) var(--mf-space-5);
  background: var(--mf-bg-panel);
  border-top: 1px solid var(--mf-border-soft);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.module-detail-actions-main-v524i {
  min-width: 0;
}

.mf-modal-footer-close-v525e {
  display: none;
}

.filter-form,
.knowledge-filter-v20 {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(10rem, 14rem) minmax(10rem, 14rem) auto auto;
  gap: var(--mf-space-3);
  align-items: end;
}

.knowledge-dashboard-card {
  min-height: 4.5rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  border-radius: var(--mf-radius-md);
  padding: var(--mf-space-3);
}

.knowledge-dashboard-card em {
  min-width: var(--mf-chip-height);
  height: var(--mf-chip-height);
  display: grid;
  place-items: center;
  border-radius: var(--mf-radius-pill);
  background: var(--mf-success-soft);
  color: var(--mf-success);
  font-style: normal;
  font-weight: var(--mf-weight-black);
}

.knowledge-card-head-v20,
.module-entry-head-v524e,
.ai-provider-head-v50,
.ai-test-result-head-v51a {
  display: flex;
  align-items: flex-start;
  gap: var(--mf-space-3);
}

.server-grid-v511,
.cockpit-grid-v511,
.ai-check-grid-v50,
.ai-cost-grid-v518b {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: var(--mf-space-4);
}

.dot-v511 {
  width: var(--mf-dot-size);
  height: var(--mf-dot-size);
  border-radius: var(--mf-radius-pill);
  background: var(--mf-success);
  box-shadow: var(--mf-shadow-dot);
}

.dot-v511.offline {
  background: var(--mf-danger);
}

.mf-status-card-v58a {
  display: flex;
  align-items: center;
  gap: var(--mf-space-3);
  min-height: var(--mf-control-height);
  padding: var(--mf-space-2) var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-md);
  background: var(--mf-bg-card);
  box-shadow: var(--mf-shadow-control);
}

.mf-status-clock-v58a,
.mf-status-metrics-v58a,
.mf-status-metric-v58a {
  display: flex;
  align-items: center;
  gap: var(--mf-space-2);
}

.mf-status-metric-v58a span {
  color: var(--mf-text-muted);
  font-size: var(--mf-type-xs);
  font-weight: var(--mf-weight-black);
  letter-spacing: var(--mf-track-label);
  text-transform: uppercase;
}

.system-ok,
.system-good,
.system-value:not(.system-unknown) {
  color: var(--mf-success);
}

.system-warn {
  color: var(--mf-warning);
}

.system-bad,
.system-unknown {
  color: var(--mf-danger);
}

.mf-login-card {
  width: min(32rem, calc(100vw - var(--mf-space-6)));
  margin: min(8vh, var(--mf-space-12)) auto;
  display: grid;
  gap: var(--mf-space-5);
  padding: var(--mf-space-8);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-2xl);
  background:
    radial-gradient(circle at top, var(--mf-bg-panel-glow), transparent 22rem),
    var(--mf-bg-card);
  color: var(--mf-text-main);
  box-shadow: var(--mf-shadow-modal);
}

.mf-login-stage {
  position: relative;
  width: min(12rem, 52vw);
  aspect-ratio: 1;
  justify-self: center;
  display: grid;
  place-items: center;
}

.mf-login-halo {
  position: absolute;
  inset: 8%;
  border-radius: var(--mf-radius-2xl);
  background: radial-gradient(circle, var(--mf-accent-soft), transparent 70%);
  filter: blur(var(--mf-blur-lg));
}

.mf-login-mark {
  position: relative;
  width: 100%;
  border-radius: var(--mf-radius-2xl);
  overflow: hidden;
  box-shadow: var(--mf-shadow-brand);
}

.mf-login-mark img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
}

.mf-login-spark {
  position: absolute;
  width: var(--mf-spark-size);
  height: var(--mf-spark-size);
  border-radius: var(--mf-radius-pill);
  background: currentColor;
  filter: blur(var(--mf-blur-xs));
  animation: mf-spark 2.8s ease-in-out infinite;
}

.mf-login-spark.gold {
  color: var(--mf-accent);
  left: 12%;
  top: 58%;
}

.mf-login-spark.violet {
  color: var(--mf-violet);
  right: 16%;
  top: 18%;
  animation-delay: .4s;
}

.mf-login-spark.cyan {
  color: var(--mf-cyan);
  right: 12%;
  bottom: 18%;
  animation-delay: .7s;
}

.mf-login-copy,
.auth-header {
  text-align: center;
}

.mf-login-status {
  display: grid;
  gap: var(--mf-space-2);
  color: var(--mf-text-muted);
  font-size: var(--mf-type-sm);
  text-align: center;
}

.mf-login-status-track {
  height: var(--mf-progress-height);
  border-radius: var(--mf-radius-pill);
  overflow: hidden;
  background: var(--mf-bg-track);
}

.mf-login-status-track::after {
  content: "";
  display: block;
  height: 100%;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mf-accent), var(--mf-cyan));
  animation: mf-login-load 1.8s ease-in-out infinite;
}

.mf-login-actions,
.auth-actions {
  display: grid;
  gap: var(--mf-space-3);
}

.mf-login-meta {
  display: flex;
  justify-content: space-between;
  gap: var(--mf-space-3);
  color: var(--mf-text-muted);
  font-size: var(--mf-type-sm);
}

.theme-audit-shell-v527a,
.theme-audit-shell-v527b {
  display: grid;
  gap: var(--mf-space-6);
}

.theme-audit-section-v527a,
.theme-audit-section-v527b {
  display: grid;
  gap: var(--mf-space-4);
}

.theme-audit-row-v527a,
.theme-audit-row-v527b {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--mf-space-2);
}

.theme-token-grid-v527a,
.theme-token-grid-v527b {
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

.theme-token-swatch-v527a,
.theme-token-swatch-v527b {
  min-height: 6rem;
  display: grid;
  align-content: end;
  gap: var(--mf-space-1);
  padding: var(--mf-space-4);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-md);
  background: var(--token-bg, var(--mf-bg-card));
  color: var(--token-fg, var(--mf-text-main));
}

.theme-token-swatch-v527a *,
.theme-token-swatch-v527b * {
  color: inherit;
}

.theme-token-page-v527a,
.theme-token-page-v527b {
  --token-bg: var(--mf-bg-page);
  --token-fg: var(--mf-text-main);
}

.theme-token-card-v527a,
.theme-token-card-v527b {
  --token-bg: var(--mf-bg-card);
  --token-fg: var(--mf-text-main);
}

.theme-token-panel-v527a,
.theme-token-panel-v527b {
  --token-bg: var(--mf-bg-panel);
  --token-fg: var(--mf-text-main);
}

.theme-token-sidebar-v527a,
.theme-token-sidebar-v527b {
  --token-bg: var(--mf-bg-sidebar);
  --token-fg: var(--mf-text-inverted);
}

.theme-token-accent-v527a,
.theme-token-accent-v527b {
  --token-bg: var(--mf-accent);
  --token-fg: var(--mf-text-on-accent);
}

.theme-token-success-v527a,
.theme-token-success-v527b {
  --token-bg: var(--mf-success-soft);
  --token-fg: var(--mf-success);
}

.theme-token-warning-v527a,
.theme-token-warning-v527b {
  --token-bg: var(--mf-warning-soft);
  --token-fg: var(--mf-warning);
}

.theme-token-danger-v527a,
.theme-token-danger-v527b {
  --token-bg: var(--mf-danger-soft);
  --token-fg: var(--mf-danger);
}

.theme-audit-contrast-grid-v527a,
.theme-audit-contrast-grid-v527b {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: var(--mf-space-3);
}

.theme-audit-status-v527a,
.theme-audit-status-v527b,
.theme-audit-panel-v527a,
.theme-audit-panel-v527b {
  padding: var(--mf-space-4);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-md);
  background: var(--mf-bg-panel);
  color: var(--mf-text-main);
}

.theme-audit-status-v527a.is-success,
.theme-audit-status-v527b.is-success {
  background: var(--mf-success-soft);
  color: var(--mf-success);
  border-color: var(--mf-success-border);
}

.theme-audit-status-v527a.is-warning,
.theme-audit-status-v527b.is-warning {
  background: var(--mf-warning-soft);
  color: var(--mf-warning);
  border-color: var(--mf-warning-border);
}

.theme-audit-status-v527a.is-danger,
.theme-audit-status-v527b.is-danger {
  background: var(--mf-danger-soft);
  color: var(--mf-danger);
  border-color: var(--mf-danger-border);
}

.theme-audit-mini-sidebar-v527a,
.theme-audit-mini-sidebar-v527b {
  display: grid;
  gap: var(--mf-space-2);
  padding: var(--mf-space-4);
  border-radius: var(--mf-radius-lg);
  background: var(--mf-bg-sidebar);
  color: var(--mf-text-inverted);
}

.theme-audit-mini-sidebar-v527a *,
.theme-audit-mini-sidebar-v527b * {
  color: inherit;
}

.theme-audit-footer-sample-v527a,
.theme-audit-footer-sample-v527b {
  min-height: var(--mf-footer-height);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--mf-space-3);
  padding: var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-md);
  background: var(--mf-bg-footer);
}

.auth-card,
.account-card,
.account-password-card,
.account-warning {
  padding: var(--mf-card-pad);
}

.account-grid,
.ai-test-layout-v51a,
.ai-task-layout-v52a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, .7fr);
  gap: var(--mf-space-5);
}

.account-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: var(--mf-space-3);
}

.account-facts div {
  padding: var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-md);
  background: var(--mf-bg-panel);
}

.mf-action-stack-v526c4,
.module-hero-actions-v524b,
.quick-side-actions {
  display: grid;
  gap: var(--mf-space-2);
  align-items: start;
}

.mf-action-stack-v526c4 .btn:not(.mf-btn-icon-only-v524i),
.module-hero-actions-v524b .btn,
.quick-side-actions .btn {
  width: 100%;
}

.mf-action-stack-v526c4 .mf-btn-icon-only-v524i {
  justify-self: end;
}

.mf-toast-region {
  inset: auto var(--mf-space-4) var(--mf-space-4) auto;
  display: grid;
  gap: var(--mf-space-2);
  pointer-events: none;
}

.mf-toast {
  width: min(24rem, calc(100vw - var(--mf-space-8)));
  padding: var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-md);
  background: var(--mf-bg-card);
  color: var(--mf-text-main);
  box-shadow: var(--mf-shadow-modal);
}

.mf-inline-form {
  display: inline;
}

.mf-zero-margin {
  margin: 0;
}

.mf-mt-sm {
  margin-top: var(--mf-space-3);
}

.mf-mt-md {
  margin-top: var(--mf-space-4);
}

.mf-mb-sm {
  margin-bottom: var(--mf-space-3);
}

.mf-mb-md {
  margin-bottom: var(--mf-space-4);
}

.mf-block-chip {
  display: block;
  margin-bottom: var(--mf-space-2);
}

.mf-min-h-sm {
  min-height: 5.5rem;
}

.mf-min-h-md {
  min-height: 5.75rem;
}

.mf-divider {
  border: 0;
  border-top: 1px solid var(--mf-border-soft);
  margin: var(--mf-space-5) 0;
}

.mf-flex-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--mf-space-2);
}

.mf-flex-between {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--mf-space-3);
}

.mf-grid-span-2 {
  grid-column: span 2;
}

.price-grid-v515,
.smart-grid-v513,
.local-ai-info-grid-v510,
.history-grid-v512,
.snapshot-list-v512 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: var(--mf-space-3);
}

.price-stat-v515,
.smart-mini-v513,
.local-ai-badge-v510,
.local-ai-info-grid-v510 > div,
.history-card-v512,
.snapshot-pill-v512 {
  display: grid;
  gap: var(--mf-space-1);
  min-width: 0;
  padding: var(--mf-space-4);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-md);
  background: var(--mf-bg-panel);
  color: var(--mf-text-main);
}

.price-stat-v515 span,
.price-stat-v515 small,
.smart-mini-v513 span,
.local-ai-badge-v510 span,
.local-ai-info-grid-v510 span,
.metric-v511 span,
.snapshot-pill-v512 span {
  color: var(--mf-text-muted);
  font-size: var(--mf-type-xs);
  font-weight: var(--mf-weight-black);
  letter-spacing: var(--mf-track-label);
  text-transform: uppercase;
}

.price-stat-v515 strong,
.smart-mini-v513 strong,
.local-ai-badge-v510 strong,
.local-ai-info-grid-v510 strong,
.history-card-v512 strong,
.snapshot-pill-v512 strong {
  color: var(--mf-text-heading);
  font-size: var(--mf-type-xl);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.price-filter-v515 {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) minmax(12rem, 1fr) minmax(13rem, 1.2fr) auto auto;
  gap: var(--mf-space-3);
  align-items: end;
}

.price-table-v515,
.local-ai-model-list-v510,
.local-ai-log-v519b,
.smart-cost-v514 {
  display: grid;
  gap: var(--mf-space-3);
}

.price-row-v515,
.local-ai-model-v510,
.local-ai-log-row-v519b {
  display: grid;
  grid-template-columns: minmax(14rem, .9fr) minmax(0, 1.45fr);
  gap: var(--mf-space-5);
  align-items: start;
  padding: var(--mf-space-4);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-md);
  background: var(--mf-bg-panel);
}

.price-row-v515.is-inactive {
  opacity: .72;
}

.price-fields-v515,
.price-row-fields-v515 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  gap: var(--mf-space-3);
}

.local-ai-wrap-v510,
.smart-v513,
.server-cockpit-v511 {
  display: grid;
  gap: var(--mf-space-5);
}

.local-ai-main-v510,
.smart-main-v513,
.cockpit-hero-v511 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, var(--mf-side-panel-width));
  gap: var(--mf-space-4);
  align-items: start;
}

.local-ai-panel-v510,
.smart-card-v513,
.cockpit-card-v511,
.history-card-v512 {
  padding: var(--mf-card-pad);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-lg);
  background: var(--mf-bg-card);
  color: var(--mf-text-main);
  box-shadow: var(--mf-shadow-card);
}

.local-ai-status-v510 {
  align-content: center;
}

.local-ai-badge-v510.online,
.smart-rec-v513.ok,
.smart-badge-v513.ok,
.smart-ok-v513,
.ok-box-v511,
.status-pill-v511 {
  background: var(--mf-success-soft);
  color: var(--mf-success);
  border-color: var(--mf-success-border);
}

.local-ai-badge-v510.offline,
.smart-rec-v513.danger,
.smart-badge-v513.danger,
.smart-danger-v514,
.offline-box-v511,
.status-pill-v511.critical,
.status-pill-v511.offline {
  background: var(--mf-danger-soft);
  color: var(--mf-danger);
  border-color: var(--mf-danger-border);
}

.smart-rec-v513.warn,
.smart-badge-v513.warn,
.smart-warn-v513,
.warn-box-v511,
.status-pill-v511.warn {
  background: var(--mf-warning-soft);
  color: var(--mf-warning);
  border-color: var(--mf-warning-border);
}

.smart-rec-v513,
.smart-badge-v513.neutral,
.status-pill-v511.muted {
  background: var(--mf-info-soft);
  color: var(--mf-info);
  border-color: var(--mf-info-border);
}

.smart-rec-v513 {
  border-left-width: var(--mf-status-rail);
}

.local-ai-model-head-v510,
.local-ai-meta-v510,
.local-ai-sync-v519a,
.smart-cost-head-v514,
.smart-pill-list-v513,
.mini-list-v511,
.history-head-v512,
.service-v511 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--mf-space-2);
}

.local-ai-model-head-v510,
.history-head-v512,
.service-v511 {
  justify-content: space-between;
}

.local-ai-pill-v510,
.smart-pill-v513,
.smart-badge-v513,
.status-pill-v511 {
  display: inline-flex;
  align-items: center;
  gap: var(--mf-space-2);
  padding: var(--mf-space-2) var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-pill);
  background: var(--mf-bg-chip);
  color: var(--mf-text-main);
  font-size: var(--mf-type-xs);
  font-weight: var(--mf-weight-black);
}

.local-ai-pill-v510.good,
.smart-pill-v513.good {
  background: var(--mf-success-soft);
  color: var(--mf-success);
  border-color: var(--mf-success-border);
}

.local-ai-pill-v510.warn,
.smart-pill-v513.warn {
  background: var(--mf-warning-soft);
  color: var(--mf-warning);
  border-color: var(--mf-warning-border);
}

.local-ai-form-v510,
.smart-form-v513 {
  display: grid;
  gap: var(--mf-space-3);
}

.local-ai-answer-v510 {
  white-space: pre-wrap;
}

.smart-list-v513 {
  margin: 0;
  padding-left: var(--mf-space-5);
  color: var(--mf-text-main);
}

.smart-list-v513 li + li {
  margin-top: var(--mf-space-1);
}

.smart-table-v513,
.table-v511 {
  width: 100%;
}

.cockpit-grid-v511,
.cockpit-grid-3-v511,
.service-list-v511 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: var(--mf-space-3);
}

.metric-v511 {
  min-height: 7rem;
}

.metric-v511 strong {
  display: block;
  margin: var(--mf-space-1) 0;
  color: var(--mf-text-heading);
  font-size: var(--mf-type-xl);
}

.service-v511 {
  padding: var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-md);
  background: var(--mf-bg-panel);
}

.warn-box-v511,
.ok-box-v511,
.offline-box-v511,
.smart-warn-v513,
.smart-danger-v514,
.smart-ok-v513 {
  padding: var(--mf-space-4);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-md);
}

.mono-v511 {
  font-family: var(--mf-font-mono);
  font-size: var(--mf-type-sm);
}

.truncate-v511 {
  max-width: 32rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-v512 {
  width: 100%;
  height: 7.5rem;
  margin-top: var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-md);
  background: var(--mf-bg-panel);
}

.chart-v512 polyline {
  fill: none;
  stroke: var(--mf-cyan);
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-v512 .grid {
  stroke: var(--mf-border-soft);
  stroke-width: .6;
}

@keyframes mf-spark {
  0%,
  100% {
    transform: scale(.75);
    opacity: .55;
  }
  50% {
    transform: scale(1.35);
    opacity: 1;
  }
}

@keyframes mf-login-load {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(80%);
  }
  100% {
    transform: translateX(220%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms;
    animation-iteration-count: 1;
    scroll-behavior: auto;
    transition-duration: .01ms;
  }
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .top-status,
  .top-user,
  .top-actions {
    justify-self: start;
  }

  .detail-grid,
  .detail-page-grid,
  .editor-layout,
  .editor-layout-wide,
  .editor-layout-v55a,
  .series-workspace,
  .knowledge-layout,
  .ai-layout-v50,
  .ai-test-layout-v51,
  .module-hero-v524b,
  .account-grid,
  .ai-test-layout-v51a,
  .ai-task-layout-v52a {
    grid-template-columns: 1fr;
  }

  .editor-layout-v55a .project-index-card,
  .series-workspace-side,
  .editor-context-panel,
  .context-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 960px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    min-height: auto;
    height: auto;
    max-height: none;
    padding: var(--mf-space-3) var(--mf-space-4);
    border-right: 0;
    border-bottom: 1px solid var(--mf-border-inverted);
  }

  .brand {
    grid-template-columns: var(--mf-brand-logo-mobile-size) minmax(0, 1fr) auto;
  }

  .brand-logo,
  .brand-mark {
    width: var(--mf-brand-logo-mobile-size);
    height: var(--mf-brand-logo-mobile-size);
  }

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--mf-space-2);
    position: absolute;
    right: var(--mf-space-4);
    top: var(--mf-space-4);
    min-height: var(--mf-control-height);
    border: 1px solid var(--mf-border-inverted);
    border-radius: var(--mf-radius-sm);
    background: var(--mf-sidebar-control-bg);
    color: var(--mf-text-inverted);
    padding: var(--mf-space-2) var(--mf-space-3);
    font-weight: var(--mf-weight-black);
  }

  .mobile-nav-toggle i {
    width: 1rem;
    height: .75rem;
    border-top: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    position: relative;
  }

  .mobile-nav-toggle i::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: calc(50% - 1px);
    border-top: 2px solid currentColor;
  }

  .side-nav,
  .sidebar-bottom {
    display: none;
  }

  .sidebar.is-mobile-open .side-nav,
  .sidebar.is-mobile-open .sidebar-bottom {
    display: grid;
  }

  .content-wrap {
    min-height: auto;
  }

  .topbar {
    position: static;
    padding: var(--mf-space-4);
  }

  .container {
    padding: var(--mf-space-4) var(--mf-space-4) calc(var(--mf-footer-height) + var(--mf-space-7));
  }

  .footer {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: var(--mf-space-2);
  }

  .footer-center-v522h,
  .footer-health-v522h {
    justify-content: stretch;
  }

  .footer-health-chip-v522h,
  .footer-center-v522h > * {
    flex: 1 1 auto;
  }

  .two-col-fields,
  .overview-grid,
  .series-preview-grid,
  .theme-audit-grid-v527a,
  .theme-audit-grid-v527b {
    grid-template-columns: 1fr;
  }

  .filter-form,
  .knowledge-filter-v20 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :root {
    --mf-page-pad-x: var(--mf-space-3);
    --mf-page-pad-y: var(--mf-space-4);
  }

  .card,
  .small-card,
  .form-card,
  .empty-state,
  .project-card,
  .volume-card,
  .series-header,
  .knowledge-card,
  .storycontrol-card-v44,
  .server-cockpit-card,
  .cockpit-card-v511,
  .metric-v511,
  .module-entry-card-v524e,
  .hero-card,
  .series-hero-polished,
  .detail-hero-row,
  .project-index-head,
  .editor-head-v10,
  .clean-title,
  .cockpit-hero-v511,
  .ai-hero-v50,
  .ai-test-hero-v51,
  .delete-impact-hero-v58a,
  .module-hero-v524b {
    border-radius: var(--mf-radius-md);
    padding: var(--mf-space-4);
  }

  #chapterText,
  .writing-textarea,
  .writing-textarea-v10,
  .writing-textarea-v11 {
    min-height: 58vh;
    padding: var(--mf-space-4);
    font-size: var(--mf-type-md);
  }

  .transfer-file-row {
    grid-template-columns: 1fr;
  }

  .project-index-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mf-modal-actions,
  .mf-app-modal-actions-v524m1,
  .form-actions,
  .mf-form-page-actions-v524m5 {
    grid-template-columns: 1fr;
  }

  .module-detail-actions-side-v524i,
  .mf-form-page-actions-right-v524m5 {
    justify-content: stretch;
  }

  .module-detail-actions-side-v524i .btn,
  .mf-form-page-actions-v524m5 .btn,
  .top-actions .btn {
    width: 100%;
  }

  .mf-login-card {
    padding: var(--mf-space-5);
  }
}

/*
  v5.27c UI library repair
  Central regression fixes for MagicFeather layout zones, action groups,
  modals, book covers, manuscript structure, editor comfort and bottom bar.
*/

body {
  overflow-x: hidden;
}

body.mf-authenticated {
  height: 100vh;
  overflow: hidden;
}

.app-shell {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  transition: grid-template-columns var(--mf-motion-normal);
}

.content-wrap {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

body.mf-sidebar-collapsed .app-shell {
  grid-template-columns: 5.4rem minmax(0, 1fr);
}

body.mf-sidebar-collapsed .sidebar {
  padding-inline: var(--mf-space-3);
}

body.mf-sidebar-collapsed .brand {
  grid-template-columns: var(--mf-brand-logo-mobile-size);
  justify-content: center;
}

body.mf-sidebar-collapsed .brand div,
body.mf-sidebar-collapsed .side-nav span,
body.mf-sidebar-collapsed .sidebar-bottom span,
body.mf-sidebar-collapsed .sidebar-bottom small,
body.mf-sidebar-collapsed .nav-label,
body.mf-sidebar-collapsed .nav-group summary::after,
body.mf-sidebar-collapsed .mf-theme-switcher-v522i {
  display: none;
}

body.mf-sidebar-collapsed .side-nav a,
body.mf-sidebar-collapsed .sidebar-bottom a,
body.mf-sidebar-collapsed .sidebar-bottom button,
body.mf-sidebar-collapsed .nav-group summary {
  justify-content: center;
  padding-inline: var(--mf-space-2);
}

.sidebar-collapse-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: var(--mf-space-3);
  top: 6rem;
  background: var(--mf-sidebar-control-bg);
  color: var(--mf-text-inverted);
  border-color: var(--mf-border-inverted);
}

.sidebar-collapse-toggle span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.container {
  min-height: 0;
  overflow: auto;
  padding-bottom: var(--mf-page-pad-y);
}

.footer,
.footer-v522h {
  position: relative;
  min-height: var(--mf-footer-height);
  max-height: min(28vh, 10rem);
  overflow: auto;
  align-self: end;
}

.footer-brand {
  white-space: nowrap;
}

.footer-left-v527c {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--mf-space-3);
  min-width: 0;
}

.footer-health-v522h,
.footer-center-v522h {
  min-width: 0;
}

/* v7.0.0.7-sb004-style-guide-integration */
.editor-style-guide-card-sb004 {
  display: grid;
  gap: var(--mf-space-3);
}

.style-guide-status-sb004 {
  padding: .3rem .55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--mf-success, #167451) 12%, var(--mf-bg-card));
  color: var(--mf-success, #167451);
  font-size: .72rem;
  font-weight: 800;
}

.style-guide-status-sb004.is-empty {
  background: color-mix(in srgb, var(--mf-warning, #9a5d00) 12%, var(--mf-bg-card));
  color: var(--mf-warning, #9a5d00);
}

.style-guide-sections-sb004 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .5rem;
}

.style-guide-sections-sb004 article {
  min-width: 0;
  padding: .65rem;
  border: 1px solid var(--mf-border);
  border-radius: .7rem;
  background: var(--mf-bg-soft);
}

.style-guide-sections-sb004 span,
.style-guide-sections-sb004 strong,
.style-guide-sections-sb004 small {
  display: block;
}

.style-guide-sections-sb004 span {
  overflow: hidden;
  color: var(--mf-muted);
  font-size: .68rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.style-guide-sections-sb004 strong {
  margin-top: .2rem;
  font-size: 1.15rem;
}

.style-guide-sections-sb004 small {
  color: var(--mf-muted);
  font-size: .62rem;
}

.style-guide-sections-sb004 article.is-ready {
  border-color: color-mix(in srgb, var(--mf-success, #167451) 36%, var(--mf-border));
}

.style-guide-rule-list-sb004 {
  display: grid;
  gap: .5rem;
}

.style-guide-rule-list-sb004 article {
  padding: .7rem .75rem;
  border-left: 3px solid var(--mf-accent);
  border-radius: .3rem .65rem .65rem .3rem;
  background: var(--mf-bg-soft);
}

.style-guide-rule-list-sb004 article > div {
  display: flex;
  justify-content: space-between;
  gap: .65rem;
}

.style-guide-rule-list-sb004 article span,
.style-guide-rule-list-sb004 article p,
.style-guide-empty-sb004 p {
  color: var(--mf-muted);
  font-size: .68rem;
}

.style-guide-rule-list-sb004 article p,
.style-guide-empty-sb004 p {
  margin: .3rem 0 0;
  line-height: 1.45;
}

.style-guide-empty-sb004 {
  padding: .8rem;
  border: 1px dashed var(--mf-border-strong);
  border-radius: .7rem;
}

.style-guide-actions-sb004 {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

@media (max-width: 900px) {
  .style-guide-sections-sb004 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.footer-health-chip-v522h {
  white-space: nowrap;
}

.footer-backup-form {
  margin: 0;
}

.inline-trash-form-icon-v524i {
  display: inline-flex;
  width: var(--mf-icon-button-size);
  min-width: var(--mf-icon-button-size);
}

.section-title,
.clean-title,
.series-main-panel > .section-title,
.manuscript-section-board > .section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--mf-space-4);
  margin: 0 0 var(--mf-space-4);
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.section-title p,
.clean-title p {
  max-width: 70ch;
}

.hero-card,
.series-header,
.series-hero-polished,
.mf-volume-hero-v526c2,
.module-hero-v524b {
  display: grid;
  gap: var(--mf-space-5);
  align-items: start;
}

.hero-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

.hero-card > :only-child {
  grid-column: 1 / -1;
}

/* UI Library: Hero-Stack-Grundregel v5.27h
   Hero-Karten sollen Text/Badges/Aktionen als klare Inhaltsgruppe führen.
   Lose direkte Kinder in mehrspaltigen Hero-Grids können Auto-Placement-Brüche
   erzeugen; dieser generische Stack-Baustein hält Hero-Inhalte stabil. */
.mf-hero-copy-stack,
.mf-hero-copy-stack-v527h {
  display: grid;
  gap: var(--mf-space-4);
  min-width: 0;
}

.mf-hero-copy-stack > :first-child,
.mf-hero-copy-stack-v527h > :first-child {
  margin-top: 0;
}

.series-hero-polished {
  grid-template-columns: auto minmax(0, 1fr) minmax(12rem, auto);
}

.mf-volume-hero-v526c2 {
  grid-template-columns: minmax(8rem, var(--mf-book-cover-hero)) minmax(0, 1fr) minmax(12rem, auto);
}

.module-hero-v524b {
  grid-template-columns: minmax(0, 1fr) minmax(12rem, 18rem);
}

.series-hero-copy,
.mf-volume-hero-main-v526c,
.module-hero-copy-v524b {
  min-width: 0;
  display: grid;
  gap: var(--mf-space-3);
}

.hero-inline-actions,
.detail-hero-actions-v524k4,
.top-actions,
.module-hero-actions-v524b,
.mf-volume-hero-actions-v526c2,
.mf-manuscript-actions-v526c2,
.mf-action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--mf-space-2);
}

.module-hero-actions-v524b,
.mf-volume-hero-actions-v526c2,
.mf-manuscript-actions-v526c2 {
  align-content: start;
}

.module-hero-actions-v524b .btn,
.mf-volume-hero-actions-v526c2 .btn,
.mf-manuscript-actions-v526c2 .btn {
  width: auto;
}

.mf-action-stack-v526c4 {
  justify-items: stretch;
}

.mf-action-stack-v526c4 .mf-btn-icon-only-v524i,
.hero-inline-actions .mf-btn-icon-only-v524i,
.detail-hero-actions-v524k4 .mf-btn-icon-only-v524i {
  width: var(--mf-icon-button-size);
  justify-self: end;
}

.btn.ghost,
.btn.helper,
.link-button.ghost {
  background: transparent;
  color: var(--mf-control-text);
  box-shadow: none;
}

.btn.secondary,
.btn.helper {
  background: var(--mf-bg-panel);
}

.project-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--mf-space-4);
  min-height: 8rem;
  text-align: left;
}

.project-card.card,
button.project-card {
  width: 100%;
  border: 1px solid var(--mf-border-soft);
}

.project-card .cover-thumb,
.logo-thumb {
  width: var(--mf-book-cover-thumb);
  max-width: var(--mf-book-cover-thumb);
}

/* UI Library: Media-Fit-Grundregel v5.27g
   Hochgeladene Logos, Cover und Nutzerbilder werden vollständig sichtbar
   dargestellt. Seitenverhältnis bleibt erhalten; bewusste Crops nutzen eigene
   dekorative Cover-/Background-Bausteine statt dieser Standardkomponenten. */
.cover-thumb img,
.logo-thumb img,
.series-logo img,
.book-cover-image,
.volume-hero-cover > img,
.mf-cover-asset,
.mf-media-fit-contain {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
}

.mf-media-fit-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.volume-book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 23rem), 1fr));
  gap: var(--mf-space-4);
}

.volume-book-card {
  display: grid;
  grid-template-columns: var(--mf-book-cover-card) minmax(0, 1fr);
  align-items: stretch;
  gap: var(--mf-space-4);
  min-height: 9rem;
  padding: var(--mf-space-4);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-lg);
  background: var(--mf-bg-card);
  color: var(--mf-text-main);
  box-shadow: var(--mf-shadow-card);
}

.book-cover-frame,
.volume-hero-cover,
.mf-cover-asset-wrap {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-md);
  background: var(--mf-bg-panel);
  box-shadow: var(--mf-shadow-control);
}

.book-cover-frame,
.mf-cover-asset-wrap {
  width: var(--mf-book-cover-card);
  aspect-ratio: 3 / 4;
}

.volume-hero-cover {
  width: min(var(--mf-book-cover-hero), 24vw);
  max-width: var(--mf-book-cover-hero);
  max-height: var(--mf-book-cover-hero-max-h);
  aspect-ratio: 3 / 4;
  justify-self: start;
}

.mf-cover-asset-wrap-hero {
  width: 100%;
  height: 100%;
}

.mf-cover-asset-series-logo {
  position: absolute;
  left: 50%;
  top: 24%;
  width: 38%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  object-fit: contain;
  border-radius: var(--mf-radius-sm);
  box-shadow: var(--mf-shadow-brand);
}

.book-card-copy,
.book-card-topline,
.book-card-pills {
  min-width: 0;
}

.book-card-copy {
  display: grid;
  gap: var(--mf-space-2);
}

.book-card-topline,
.book-card-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mf-space-2);
  align-items: center;
}

.book-badge,
.book-card-pills span {
  display: inline-flex;
  align-items: center;
  min-height: var(--mf-chip-height);
  padding: var(--mf-space-1) var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-pill);
  background: var(--mf-bg-chip);
  color: var(--mf-text-main);
  font-size: var(--mf-type-xs);
  font-weight: var(--mf-weight-black);
}

.manuscript-section-board {
  display: grid;
  gap: var(--mf-space-4);
}

.manuscript-structure-group-v518a {
  display: grid;
  gap: var(--mf-space-4);
  padding: var(--mf-space-4);
  border: 1px solid var(--mf-border-soft);
  border-left: var(--mf-status-rail) solid var(--mf-border-accent);
  border-radius: var(--mf-radius-lg);
  background: var(--mf-bg-panel);
}

.manuscript-structure-group-v518a.is-act {
  background: var(--mf-bg-card);
}

.manuscript-structure-group-v518a.is-internal {
  border-left-color: var(--mf-violet);
}

.manuscript-structure-group-v518a.is-special {
  border-left-color: var(--mf-accent);
}

.manuscript-structure-group-v518a.is-unassigned {
  border-left-color: var(--mf-warning);
}

.manuscript-group-head-v518a {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--mf-space-3);
}

.manuscript-group-head-v518a p {
  max-width: 78ch;
  color: var(--mf-text-muted);
}

.manuscript-group-meta-v518a {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mf-space-2);
}

.manuscript-group-meta-v518a span {
  display: inline-flex;
  align-items: center;
  min-height: var(--mf-chip-height);
  padding: var(--mf-space-1) var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-pill);
  background: var(--mf-bg-chip);
  color: var(--mf-text-main);
  font-size: var(--mf-type-xs);
  font-weight: var(--mf-weight-black);
}

.manuscript-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: var(--mf-space-3);
}

.manuscript-section-tile {
  min-height: 10rem;
  display: grid;
  align-content: start;
  gap: var(--mf-space-3);
  padding: var(--mf-space-4);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-md);
  background: var(--mf-bg-card);
  color: var(--mf-text-main);
  box-shadow: var(--mf-shadow-control);
}

.manuscript-section-tile:hover {
  transform: translateY(-1px);
  border-color: var(--mf-border-accent);
  box-shadow: var(--mf-shadow-card-hover);
}

.tile-topline,
.section-tile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--mf-space-2);
}

.section-tile-meta span {
  display: inline-flex;
  align-items: center;
  min-height: var(--mf-chip-height);
  padding: var(--mf-space-1) var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-pill);
  background: var(--mf-bg-chip);
  color: var(--mf-text-muted);
  font-size: var(--mf-type-xs);
  font-weight: var(--mf-weight-bold);
}

.manuscript-structure-group-v518a ol {
  margin: 0;
  padding-left: var(--mf-space-5);
}

.manuscript-structure-group-v518a li + li {
  margin-top: var(--mf-space-2);
}

.inline-empty,
.manuscript-group-empty-v518a {
  padding: var(--mf-space-4);
  border: 1px dashed var(--mf-border-medium);
  border-radius: var(--mf-radius-md);
  background: var(--mf-bg-card-soft);
}

.project-index-card {
  max-height: min(58rem, calc(100vh - var(--mf-topbar-height) - var(--mf-runtime-footer-height, var(--mf-footer-height)) - var(--mf-space-5)));
  display: flex;
  flex-direction: column;
}

.project-index-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--mf-space-3);
  background: var(--mf-bg-card);
  border-radius: 0;
  box-shadow: none;
}

.project-index-head h2 {
  font-size: var(--mf-type-xl);
}

.index-count {
  display: grid;
  place-items: center;
  min-width: var(--mf-icon-button-size);
  height: var(--mf-icon-button-size);
  border-radius: var(--mf-radius-pill);
  background: var(--mf-bg-chip);
  color: var(--mf-text-heading);
  font-weight: var(--mf-weight-black);
}

.project-index-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-index-tabs button {
  min-height: var(--mf-control-height-sm);
  white-space: normal;
}

.knowledge-index-filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mf-space-2);
  padding: var(--mf-space-3) var(--mf-space-4);
  border-bottom: 1px solid var(--mf-border-soft);
}

.knowledge-filter-chip em {
  min-width: var(--mf-chip-height);
  height: var(--mf-chip-height);
  display: grid;
  place-items: center;
  padding: 0 var(--mf-space-2);
  border-radius: var(--mf-radius-pill);
  background: var(--mf-bg-card);
  color: var(--mf-text-heading);
  font-style: normal;
}

.project-index-list {
  min-height: 0;
  overflow: auto;
}

.index-entry {
  display: grid;
  min-height: 4rem;
  padding: var(--mf-space-3);
  background: var(--mf-bg-card);
}

.context-mode-pill:empty {
  display: none;
}

.project-index-drawer[hidden] {
  display: none;
}

.project-index-drawer {
  position: fixed;
  inset: 0;
  z-index: var(--mf-z-modal);
}

.drawer-panel {
  position: absolute;
  inset: var(--mf-space-5) var(--mf-space-5) var(--mf-space-5) auto;
  width: min(32rem, calc(100vw - var(--mf-space-10)));
}

.drawer-actions,
.index-modal-actions,
.module-detail-actions-main-v524i {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--mf-space-2);
}

dialog.mf-modal-dialog[open],
.mf-modal-dialog[open] {
  display: grid;
  place-items: center;
}

.mf-modal-card,
.mf-app-modal-card-v524m1 {
  width: 100%;
  max-height: min(44rem, calc(100vh - var(--mf-space-8)));
}

.mf-modal-card > .mf-modal-form,
.mf-app-modal-card-v524m1 > .mf-modal-form,
.mf-app-modal-card-v524m1 > .mf-app-modal-form-v524m1 {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.mf-modal-body,
.mf-app-modal-body-v524m1 {
  flex: 1 1 auto;
  min-height: 0;
}

.mf-modal-actions,
.mf-app-modal-actions-v524m1 {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--mf-space-3);
}

.mf-modal-actions .module-detail-actions-start-v524i,
.mf-app-modal-actions-v524m1 .module-detail-actions-start-v524i {
  grid-column: 1;
  justify-self: start;
}

.mf-modal-actions .module-detail-actions-main-v524i,
.mf-modal-actions .module-detail-actions-end-v524i,
.mf-app-modal-actions-v524m1 .module-detail-actions-main-v524i,
.mf-app-modal-actions-v524m1 .module-detail-actions-end-v524i {
  grid-column: 2;
  justify-self: end;
}

.mf-modal-actions .module-detail-actions-main-v524i:empty,
.mf-modal-actions .module-detail-actions-end-v524i:empty,
.mf-app-modal-actions-v524m1 .module-detail-actions-main-v524i:empty,
.mf-app-modal-actions-v524m1 .module-detail-actions-end-v524i:empty,
.module-detail-actions-end-v524i.mf-modal-footer-close-v525e {
  display: none;
}

.mf-modal-close-x-v525e,
.drawer-close {
  font-size: var(--mf-type-xl);
  line-height: 1;
}

.mf-project-modal-backdrop[hidden] {
  display: none;
}

.mf-project-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--mf-z-modal);
  display: grid;
  place-items: center;
  padding: var(--mf-space-4);
  background: var(--mf-bg-scrim);
  backdrop-filter: var(--mf-backdrop-blur);
}

.mf-project-modal-card {
  width: min(var(--mf-modal-width), calc(100vw - var(--mf-space-6)));
  max-height: calc(100vh - var(--mf-space-6));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--mf-modal-bg);
  color: var(--mf-text-main);
  border: 1px solid var(--mf-border-strong);
  border-radius: var(--mf-radius-xl);
  box-shadow: var(--mf-shadow-modal);
}

.mf-project-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--mf-space-4);
}

.mf-project-modal-form {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.mf-project-modal-body {
  min-height: 0;
  overflow: auto;
}

.project-type-hints,
.project-type-hint,
.codex-create-type-section-v523b,
.codex-create-type-grid-v523b {
  display: grid;
  gap: var(--mf-space-3);
}

.project-type-hint,
.codex-create-type-card-v523b {
  padding: var(--mf-space-4);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-md);
  background: var(--mf-bg-panel);
  color: var(--mf-text-main);
}

.codex-create-type-grid-v523b {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}

.codex-create-type-card-v523b {
  text-align: left;
  cursor: pointer;
}

.codex-create-type-card-v523b.is-active {
  border-color: var(--mf-border-accent);
  background: var(--mf-accent-soft);
}

.editor-layout,
.editor-layout-wide,
.editor-layout-v55a {
  grid-template-columns: minmax(34rem, 1fr) minmax(19rem, var(--mf-side-panel-width));
  gap: var(--mf-space-4);
}

.editor-stats-grid,
.editor-stats-v10,
.editor-stats-v11,
.editor-stats-v56 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--mf-space-3);
}

.editor-main,
.editor-writing-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.editor-head,
.editor-head-v10,
.editor-head-v11 {
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}

.editor-toolbar,
.editor-toolbar-v11 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--mf-space-3);
  padding: var(--mf-space-4);
  border-bottom: 1px solid var(--mf-border-soft);
  background: var(--mf-bg-card);
}

.toolbar-info {
  display: grid;
  gap: var(--mf-space-1);
  min-width: min(100%, 18rem);
}

.toolbar-info span {
  color: var(--mf-text-muted);
  font-size: var(--mf-type-sm);
}

.toolbar-actions,
.toolbar-actions-v56 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--mf-space-2);
}

#chapterText,
.writing-textarea,
.writing-textarea-v10,
.writing-textarea-v11 {
  min-height: min(var(--mf-editor-min-height), calc(100vh - var(--mf-topbar-height) - var(--mf-runtime-footer-height, var(--mf-footer-height)) - 18rem));
  flex: 1 1 auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.editor-stat-card strong {
  font-size: var(--mf-type-xl);
  color: var(--mf-text-heading);
}

.editor-cockpit-strip {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
}

.cockpit-chip,
.cockpit-chip-v55a {
  min-width: 0;
  display: grid;
  gap: var(--mf-space-1);
  align-content: center;
  overflow: hidden;
  text-align: left;
}

.cockpit-chip strong,
.cockpit-chip small {
  min-width: 0;
  line-height: 1.2;
}

.cockpit-chip small {
  color: var(--mf-text-muted);
  font-size: var(--mf-type-xs);
}

.cockpit-value-pair {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--mf-space-1);
}

.cockpit-chip.status-ok {
  border-left-color: var(--mf-success);
}

.cockpit-chip.status-warn {
  border-left-color: var(--mf-warning);
}

.cockpit-chip.status-danger {
  border-left-color: var(--mf-danger);
}

.cockpit-chip.status-accent {
  border-left-color: var(--mf-accent);
}

.mf-editor-comfort-v59 {
  position: relative;
  display: inline-flex;
}

.mf-editor-comfort-popover-v59,
.mf-editor-comfort-popover-v522i {
  position: absolute;
  right: 0;
  top: calc(100% + var(--mf-space-2));
  z-index: var(--mf-z-modal);
  width: min(28rem, calc(100vw - var(--mf-space-6)));
  max-height: min(70vh, 38rem);
  overflow: auto;
  display: grid;
  gap: var(--mf-space-4);
  padding: var(--mf-space-4);
  border: 1px solid var(--mf-border-strong);
  border-radius: var(--mf-radius-lg);
  background: var(--mf-modal-bg);
  color: var(--mf-text-main);
  box-shadow: var(--mf-shadow-modal);
}

.mf-editor-comfort-popover-v59[hidden],
.mf-editor-comfort-popover-v522i[hidden] {
  display: none;
}

.mf-editor-comfort-popover-head-v59,
.mf-editor-comfort-head-v522i {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--mf-space-3);
}

.mf-editor-comfort-close-v59 {
  width: var(--mf-icon-button-size);
  height: var(--mf-icon-button-size);
  border: 1px solid var(--mf-control-border);
  border-radius: var(--mf-radius-md);
  background: var(--mf-control-bg);
  color: var(--mf-control-text);
  font-size: var(--mf-type-xl);
  line-height: 1;
}

.mf-comfort-section-v522i {
  display: grid;
  gap: var(--mf-space-3);
  padding: var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-md);
  background: var(--mf-bg-panel);
}

.mf-comfort-grid-v522i {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: var(--mf-space-3);
}

.mf-comfort-control-v522i,
.mf-comfort-select-v522i,
.mf-comfort-check-v522i {
  display: grid;
  gap: var(--mf-space-2);
}

.mf-segment-v522i,
.mf-icon-options-v522i,
.mf-text-options-v522i,
.mf-editor-comfort-buttons-v522i {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mf-space-2);
}

.mf-segment-v522i button,
.mf-icon-options-v522i button,
.mf-text-options-v522i button {
  min-height: var(--mf-control-height-sm);
  padding: var(--mf-space-2) var(--mf-space-3);
  border: 1px solid var(--mf-control-border);
  border-radius: var(--mf-radius-sm);
  background: var(--mf-control-bg);
  color: var(--mf-control-text);
  font-weight: var(--mf-weight-bold);
}

.mf-segment-v522i button.is-active,
.mf-segment-v522i button[aria-pressed="true"],
.mf-icon-options-v522i button.is-active,
.mf-icon-options-v522i button[aria-pressed="true"],
.mf-text-options-v522i button.is-active,
.mf-text-options-v522i button[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--mf-accent), var(--mf-accent-hover));
  color: var(--mf-text-on-accent);
  border-color: var(--mf-accent-strong);
}

.editor-footer-nav-v522h {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) auto minmax(8rem, 1fr);
  gap: var(--mf-space-2);
  align-items: center;
  width: min(42rem, 100%);
}

.editor-footer-nav-link-v522h,
.editor-footer-nav-current-v522h {
  min-height: var(--mf-control-height-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--mf-space-2) var(--mf-space-3);
  border: 1px solid var(--mf-control-border);
  border-radius: var(--mf-radius-pill);
  background: var(--mf-control-bg);
  color: var(--mf-control-text);
  font-size: var(--mf-type-xs);
  font-weight: var(--mf-weight-black);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-footer-nav-link-v522h.is-disabled {
  opacity: var(--mf-opacity-disabled);
}

.editor-footer-nav-current-v522h {
  background: linear-gradient(135deg, var(--mf-accent), var(--mf-accent-hover));
  color: var(--mf-text-on-accent);
  border-color: var(--mf-accent-strong);
}

.textproof-persistent-marker-v521a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--mf-space-3);
  align-items: center;
  margin: var(--mf-space-4) var(--mf-space-6);
  padding: var(--mf-space-4);
  border: 1px solid var(--mf-warning-border);
  border-left: var(--mf-status-rail) solid var(--mf-warning);
  border-radius: var(--mf-radius-lg);
  background: var(--mf-warning-soft);
  color: var(--mf-text-main);
  box-shadow: var(--mf-shadow-card);
}

.textproof-persistent-marker-v521a[hidden] {
  display: none;
}

.textproof-marker-icon-v521a {
  display: grid;
  place-items: center;
  width: var(--mf-icon-button-size);
  height: var(--mf-icon-button-size);
  border: 1px solid var(--mf-warning-border);
  border-radius: var(--mf-radius-md);
  background: var(--mf-bg-card);
}

.textproof-marker-main-v521a,
.textproof-marker-head-v521a {
  min-width: 0;
}

.textproof-marker-main-v521a {
  display: grid;
  gap: var(--mf-space-2);
}

.textproof-marker-head-v521a,
.textproof-marker-actions-v521a {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--mf-space-2);
}

.textproof-marker-actions-v521a {
  justify-content: flex-end;
}

.textproof-marker-eyebrow-v521a {
  color: var(--mf-text-muted);
  font-size: var(--mf-type-xs);
  font-weight: var(--mf-weight-black);
  letter-spacing: var(--mf-track-label);
  text-transform: uppercase;
}

.textproof-marker-main-v521a p,
.textproof-marker-reason-v521a {
  margin: 0;
  padding: var(--mf-space-2) var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-sm);
  background: var(--mf-bg-card);
  color: var(--mf-text-main);
}

.story-logic-rule-v42.is-ignored-v521a {
  display: none;
}

#chapterText.textproof-selection-active-v521a,
#chapterText.mf-issue-active-v521a {
  outline: var(--mf-focus-ring);
  outline-offset: var(--mf-focus-offset);
}

.mf-issue-marker-v521a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--mf-space-3);
  align-items: center;
  margin: var(--mf-space-4) var(--mf-space-6);
  padding: var(--mf-space-4);
  border: 1px solid var(--mf-warning-border);
  border-left: var(--mf-status-rail) solid var(--mf-warning);
  border-radius: var(--mf-radius-lg);
  background: var(--mf-warning-soft);
  color: var(--mf-text-main);
  box-shadow: var(--mf-shadow-card);
}

.mf-issue-marker-v521a[hidden] {
  display: none;
}


/* v6.2i17b: globale Treffer-Navigation bleibt erhalten, aber als Dock ausserhalb des Schreibbereichs. */
.mf-issue-marker-v521a.mf-issue-navigation-dock-v62i17b {
  position: fixed;
  z-index: 80;
  left: clamp(16rem, 20vw, 22rem);
  right: clamp(1rem, 3vw, 2rem);
  bottom: calc(var(--mf-runtime-footer-height, var(--mf-footer-height, 4rem)) + var(--mf-space-3));
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 0;
  padding: var(--mf-space-3);
  border-left-width: var(--mf-status-rail-sm, 0.25rem);
  background: var(--mf-bg-card);
  box-shadow: var(--mf-shadow-float, var(--mf-shadow-card));
  max-width: min(58rem, calc(100vw - 2rem));
}

.mf-issue-marker-v521a.mf-issue-navigation-dock-v62i17b .mf-issue-marker-icon-v521a {
  display: none;
}

.mf-issue-marker-v521a.mf-issue-navigation-dock-v62i17b .mf-issue-marker-main-v521a {
  gap: var(--mf-space-1);
}

.mf-issue-marker-v521a.mf-issue-navigation-dock-v62i17b .mf-issue-marker-snippet-v521a,
.mf-issue-marker-v521a.mf-issue-navigation-dock-v62i17b .mf-issue-marker-reason-v521a {
  max-width: 42rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0;
  border: 0;
  background: transparent;
}

.mf-issue-marker-v521a.mf-issue-navigation-dock-v62i17b .mf-issue-marker-reason-v521a {
  display: none;
}

.mf-issue-marker-v521a.mf-issue-navigation-dock-v62i17b .mf-issue-marker-actions-v521a {
  justify-content: flex-end;
  align-self: center;
}

.mf-issue-marker-v521a.mf-issue-navigation-dock-v62i17b .mf-issue-marker-actions-v521a .btn[disabled] {
  opacity: .48;
  cursor: not-allowed;
}

.mf-issue-marker-icon-v521a {
  display: grid;
  place-items: center;
  width: var(--mf-icon-button-size);
  height: var(--mf-icon-button-size);
  border: 1px solid var(--mf-warning-border);
  border-radius: var(--mf-radius-md);
  background: var(--mf-bg-card);
}

.mf-issue-marker-main-v521a {
  display: grid;
  gap: var(--mf-space-2);
  min-width: 0;
}

.mf-issue-marker-head-v521a,
.mf-issue-marker-actions-v521a,
.mf-issue-row-actions-v521a,
.textproof-local-actions,
.textproof-lt-actions,
.story-logic-rule-actions-v42 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--mf-space-2);
}

.mf-issue-marker-actions-v521a {
  justify-content: flex-end;
}

.mf-issue-row-actions-v521a,
.textproof-local-actions,
.textproof-lt-actions,
.story-logic-rule-actions-v42 {
  align-items: stretch;
  margin-top: var(--mf-space-3);
}

.mf-issue-marker-source-v521a,
.mf-issue-marker-count-v521a {
  display: inline-flex;
  align-items: center;
  min-height: var(--mf-chip-height);
  padding: var(--mf-space-1) var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-pill);
  background: var(--mf-bg-card);
  color: var(--mf-text-muted);
  font-size: var(--mf-type-xs);
  font-weight: var(--mf-weight-black);
  letter-spacing: var(--mf-track-label);
  text-transform: uppercase;
}

.mf-issue-marker-title-v521a {
  color: var(--mf-text-heading);
  font-weight: var(--mf-weight-black);
}

.mf-issue-marker-snippet-v521a,
.mf-issue-marker-reason-v521a {
  margin: 0;
  padding: var(--mf-space-2) var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-sm);
  background: var(--mf-bg-card);
  color: var(--mf-text-main);
}

.mf-issue-marker-reason-v521a {
  color: var(--mf-text-muted);
}

.textproof-issue.mf-ignored-v521a,
.textproof-issue.is-ignored-v521a,
.story-logic-rule-v42.mf-ignored-v521a {
  display: none;
}

.mf-ignored-box-v521a {
  margin-top: var(--mf-space-4);
  padding: var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-md);
  background: var(--mf-bg-card);
}

.mf-ignored-box-v521a summary {
  cursor: pointer;
  color: var(--mf-text-heading);
  font-weight: var(--mf-weight-black);
}

.mf-ignored-list-v521a {
  display: grid;
  gap: var(--mf-space-2);
  margin-top: var(--mf-space-3);
}

.mf-ignored-item-v521a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--mf-space-2);
  align-items: center;
  padding: var(--mf-space-2) var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-sm);
  background: var(--mf-bg-panel);
}

@media (max-width: 1180px) {
  .hero-card,
  .series-hero-polished,
  .mf-volume-hero-v526c2,
  .module-hero-v524b,
  .editor-layout,
  .editor-layout-wide,
  .editor-layout-v55a {
    grid-template-columns: 1fr;
  }

  .volume-hero-cover {
    width: min(10rem, 42vw);
  }

  .project-index-card {
    max-height: none;
  }

  .editor-stats-grid,
  .editor-stats-v10,
  .editor-stats-v11,
  .editor-stats-v56 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  body.mf-authenticated {
    height: 100vh;
    overflow: hidden;
  }

  .app-shell {
    height: 100vh;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .content-wrap {
    height: auto;
    min-height: 0;
    overflow: hidden;
  }

  .container {
    min-height: 0;
    overflow: auto;
    padding-bottom: var(--mf-space-4);
  }

  .sidebar-collapse-toggle {
    display: none;
  }

  .section-title,
  .clean-title,
  .hero-inline-actions,
  .detail-hero-actions-v524k4,
  .top-actions,
  .module-hero-actions-v524b,
  .mf-volume-hero-actions-v526c2,
  .mf-manuscript-actions-v526c2 {
    justify-content: flex-start;
  }

  .footer,
  .footer-v522h {
    position: relative;
    max-height: 34vh;
  }

  .editor-footer-nav-v522h {
    grid-template-columns: 1fr auto 1fr;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .series-hero-polished,
  .mf-volume-hero-v526c2 {
    justify-items: start;
  }

  .project-card,
  .volume-book-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .volume-book-card {
    padding: var(--mf-space-3);
  }

  .book-cover-frame,
  .volume-book-card .mf-cover-asset-wrap {
    width: 4.8rem;
  }

  .manuscript-group-head-v518a,
  .section-title,
  .clean-title {
    display: grid;
  }

  .mf-modal-actions,
  .mf-app-modal-actions-v524m1,
  .mf-project-modal-actions {
    grid-template-columns: 1fr;
  }

  .mf-modal-actions .module-detail-actions-start-v524i,
  .mf-modal-actions .module-detail-actions-main-v524i,
  .mf-modal-actions .module-detail-actions-end-v524i,
  .mf-app-modal-actions-v524m1 .module-detail-actions-start-v524i,
  .mf-app-modal-actions-v524m1 .module-detail-actions-main-v524i,
  .mf-app-modal-actions-v524m1 .module-detail-actions-end-v524i {
    grid-column: 1;
    justify-self: stretch;
  }

  .module-detail-actions-main-v524i,
  .module-detail-actions-end-v524i,
  .mf-form-page-actions-right-v524m5 {
    justify-content: stretch;
  }

  .module-detail-actions-main-v524i .btn,
  .module-detail-actions-end-v524i .btn,
  .mf-project-modal-actions .btn {
    flex: 1 1 auto;
  }

  .drawer-panel {
    inset: var(--mf-space-3);
    width: auto;
  }

  .mf-editor-comfort-popover-v59,
  .mf-editor-comfort-popover-v522i {
    position: fixed;
    inset: auto var(--mf-space-3) calc(var(--mf-runtime-footer-height, var(--mf-footer-height)) + var(--mf-space-3));
    width: auto;
    max-height: 62vh;
  }

  .textproof-persistent-marker-v521a {
    grid-template-columns: 1fr;
    margin-inline: var(--mf-space-3);
  }

  .mf-issue-marker-v521a {
    grid-template-columns: 1fr;
    margin-inline: var(--mf-space-3);
  }

  .mf-issue-marker-v521a.mf-issue-navigation-dock-v62i17b {
    left: var(--mf-space-3);
    right: var(--mf-space-3);
    bottom: calc(var(--mf-runtime-footer-height, var(--mf-footer-height, 4rem)) + var(--mf-space-2));
    grid-template-columns: 1fr;
    margin-inline: 0;
  }

  .mf-ignored-item-v521a {
    grid-template-columns: 1fr;
  }

  .textproof-marker-icon-v521a,
  .mf-issue-marker-icon-v521a {
    display: none;
  }
}

@media (max-width: 520px) {
  .brand {
    padding-right: calc(var(--mf-icon-button-size) + var(--mf-space-5));
  }

  .brand span {
    max-width: 11.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .project-card {
    grid-template-columns: 1fr;
  }

  .editor-stats-grid,
  .editor-stats-v10,
  .editor-stats-v11,
  .editor-stats-v56 {
    grid-template-columns: 1fr;
  }

  .project-card .cover-thumb,
  .logo-thumb {
    width: 4.6rem;
  }

  .editor-footer-nav-v522h {
    display: flex;
    flex-wrap: nowrap;
    width: max-content;
    min-width: 100%;
    overflow-x: auto;
  }

  .editor-footer-nav-link-v522h,
  .editor-footer-nav-current-v522h {
    flex: 0 0 auto;
    min-width: 9rem;
  }

  .footer,
  .footer-v522h {
    max-height: 9.5rem;
    overflow: auto;
  }

  .footer-center-v522h,
  .footer-health-v522h {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .footer-health-chip-v522h,
  .footer-center-v522h > *,
  .footer-health-v522h > * {
    width: auto;
    flex: 0 0 auto;
  }
}


/*
  v5.27d UI polish
  Sidebar zones, compact theme switcher, editor fixed workspace,
  compact cockpit, list/card library repair and control cleanup.
*/

button,
.btn,
summary,
[role="button"],
.side-nav a,
.sidebar-bottom a,
.footer-health-chip-v522h,
.knowledge-dashboard-card,
.knowledge-card,
.project-card,
.volume-book-card,
.index-entry {
  caret-color: transparent;
  user-select: none;
}

input,
textarea,
select,
[contenteditable="true"],
#chapterText {
  caret-color: auto;
  user-select: text;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.mf-btn-icon-only-v524i .ui-icon,
.trash-icon-button .ui-icon,
.danger-soft-v58.mf-btn-icon-only-v524i .ui-icon {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mf-btn-icon-only-v524i .ui-icon use,
.trash-icon-button .ui-icon use {
  fill: none;
  stroke: currentColor;
}

.sidebar {
  overflow: hidden;
  gap: var(--mf-space-4);
}

.brand,
.mobile-nav-toggle,
.sidebar-collapse-toggle,
.sidebar-bottom {
  flex: 0 0 auto;
}

.side-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: var(--mf-space-1);
  scrollbar-width: thin;
}

.sidebar-bottom {
  margin-top: 0;
  padding-top: var(--mf-space-3);
  gap: var(--mf-space-2);
}

.mf-theme-switcher-v522i {
  gap: var(--mf-space-1);
  margin-top: var(--mf-space-2);
  padding-top: var(--mf-space-2);
}

.mf-theme-toggle-group-v522i {
  gap: var(--mf-space-1);
}

.mf-theme-toggle-group-v522i button {
  min-height: 2.35rem;
  padding: var(--mf-space-1) var(--mf-space-2);
  font-size: var(--mf-type-xs);
}

body.mf-sidebar-collapsed .side-nav {
  padding-right: 0;
}

.module-hero-actions-v524b.is-vertical,
.module-hero-actions-v524b:has(a[href*="knowledge-states"]),
.module-hero-actions-v524b:has(a[href*="timeline"]):has(a[href*="characters"]),
.module-hero-actions-v524b:has(a[href*="secrets"]):has(a[href*="characters"]) {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: stretch;
  min-width: min(18rem, 100%);
}

.module-hero-actions-v524b.is-vertical .btn,
.module-hero-actions-v524b:has(a[href*="knowledge-states"]) .btn,
.module-hero-actions-v524b:has(a[href*="timeline"]):has(a[href*="characters"]) .btn,
.module-hero-actions-v524b:has(a[href*="secrets"]):has(a[href*="characters"]) .btn {
  width: 100%;
  justify-content: center;
}

.chapter-editor-page-v527d {
  height: calc(100vh - var(--mf-topbar-height) - var(--mf-runtime-footer-height, var(--mf-footer-height)) - var(--mf-space-4));
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--mf-space-3);
  overflow: hidden;
}

.chapter-editor-page-v527d > .editor-breadcrumb,
.chapter-editor-page-v527d > .editor-stats-grid {
  flex: 0 0 auto;
}

.chapter-editor-page-v527d .editor-stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.chapter-editor-page-v527d .editor-layout-v55a {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow: hidden;
  align-items: stretch;
}

.chapter-editor-page-v527d .editor-main,
.chapter-editor-page-v527d .editor-side-stack,
.chapter-editor-page-v527d .editor-context-panel {
  min-height: 0;
  max-height: none;
  overflow: hidden;
}

.chapter-editor-page-v527d .editor-main {
  height: 100%;
}

.chapter-editor-page-v527d .editor-side-stack,
.chapter-editor-page-v527d .editor-context-panel {
  overflow-y: auto;
  padding-bottom: var(--mf-space-4);
  scrollbar-width: thin;
}

.chapter-editor-page-v527d #chapterText {
  min-height: 0;
  height: auto;
  flex: 1 1 auto;
  overflow-y: auto;
  padding-bottom: var(--mf-space-6);
}

.editor-cockpit-panel-v527d {
  flex: 0 0 auto;
  border-top: 1px solid var(--mf-border-soft);
  border-bottom: 1px solid var(--mf-border-soft);
  background: var(--mf-bg-panel);
}

.editor-cockpit-panel-v527d > summary {
  list-style: none;
  cursor: pointer;
}

.editor-cockpit-panel-v527d > summary::-webkit-details-marker {
  display: none;
}

.editor-cockpit-summary-v527d {
  min-height: 3.25rem;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--mf-space-3);
  padding: var(--mf-space-3) var(--mf-space-4);
  color: var(--mf-text-main);
}

.editor-cockpit-lamp-v527d {
  width: .85rem;
  height: .85rem;
  border-radius: var(--mf-radius-pill);
  background: var(--mf-success);
  box-shadow: var(--mf-shadow-control);
}

.editor-cockpit-summary-v527d.is-warn .editor-cockpit-lamp-v527d {
  background: var(--mf-warning);
}

.editor-cockpit-summary-v527d.is-danger .editor-cockpit-lamp-v527d {
  background: var(--mf-danger);
}

.editor-cockpit-summary-v527d small {
  min-width: 0;
  overflow: hidden;
  color: var(--mf-text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-cockpit-summary-v527d em {
  color: var(--mf-text-accent);
  font-style: normal;
  font-size: var(--mf-type-xs);
  font-weight: var(--mf-weight-black);
}

.editor-cockpit-panel-v527d:not([open]) .editor-cockpit-strip {
  display: none;
}

.editor-cockpit-panel-v527d[open] .editor-cockpit-summary-v527d em::before {
  content: "Details ausblenden";
}

.editor-cockpit-panel-v527d[open] .editor-cockpit-summary-v527d em {
  font-size: 0;
}

.editor-cockpit-panel-v527d[open] .editor-cockpit-summary-v527d em::before {
  font-size: var(--mf-type-xs);
}

.editor-cockpit-panel-v527d .editor-cockpit-strip {
  padding: 0 var(--mf-space-4) var(--mf-space-4);
}

.editor-cockpit-strip {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: var(--mf-space-2);
}

.cockpit-chip,
.cockpit-chip-v55a {
  min-height: 4.15rem;
  padding: var(--mf-space-3);
}

.project-index-card {
  max-height: 100%;
}

.project-index-head,
.project-index-search,
.project-index-tabs,
.project-index-filters {
  padding: var(--mf-space-3);
}

.project-index-head h2 {
  font-size: var(--mf-type-lg);
  line-height: 1.05;
}

.index-count {
  min-width: 2.35rem;
  height: 2.35rem;
  font-size: var(--mf-type-sm);
}

.project-index-tabs {
  gap: var(--mf-space-1);
}

.project-index-tabs button,
.knowledge-filter-chip {
  min-height: 2.35rem;
  padding: var(--mf-space-1) var(--mf-space-2);
  font-size: var(--mf-type-xs);
  line-height: 1.15;
}

.knowledge-index-filter-strip {
  gap: var(--mf-space-1);
  padding: var(--mf-space-2) var(--mf-space-3);
}

.knowledge-filter-chip em,
.mention-pill {
  min-width: 1.85rem;
  height: 1.85rem;
  padding: 0 var(--mf-space-1);
  font-size: var(--mf-type-xs);
}

.index-entry {
  min-height: 3.25rem;
  padding: var(--mf-space-2) var(--mf-space-3);
}

.knowledge-guidance-v21 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: var(--mf-space-3);
  margin-block: var(--mf-space-4);
}

.knowledge-guidance-v21 > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--mf-space-2) var(--mf-space-3);
  align-items: start;
  padding: var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-md);
  background: var(--mf-bg-card);
  box-shadow: var(--mf-shadow-control);
}

.knowledge-guidance-v21 strong {
  display: contents;
}

.knowledge-guidance-v21 .ui-icon,
.knowledge-guidance-v21 strong > svg,
.knowledge-guidance-v21 strong::first-letter {
  grid-column: 1;
}

.knowledge-guidance-v21 span {
  grid-column: 2;
  color: var(--mf-text-muted);
}

.storylogic-stats-v40a,
.knowledge-stats-v43,
.timeline-stats-v520e,
.storycontrol-stats-v44 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  gap: var(--mf-space-3);
  margin-block: var(--mf-space-4);
}

.storylogic-stats-v40a > span,
.storycontrol-stats-v44 > article {
  display: grid;
  gap: var(--mf-space-1);
  padding: var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-md);
  background: var(--mf-bg-card);
  box-shadow: var(--mf-shadow-control);
}

.storylogic-filter-v40a,
.knowledge-filter-v43,
.timeline-filter-v520e,
.storycontrol-filter-v44,
.story-check-filter-v520h {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: var(--mf-space-3);
  align-items: end;
  margin-block: var(--mf-space-4);
  padding: var(--mf-space-4);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-lg);
  background: var(--mf-bg-card);
  box-shadow: var(--mf-shadow-card);
}

.timeline-hints-v520e,
.story-check-summary-v520h,
.story-check-problem-list-v520h {
  display: grid;
  gap: var(--mf-space-3);
  margin-block: var(--mf-space-4);
}

.timeline-hint-v520e,
.story-check-alert-v520h,
.story-check-problem-card-v520h {
  display: grid;
  gap: var(--mf-space-2);
  padding: var(--mf-space-4);
  border: 1px solid var(--mf-border-soft);
  border-left: var(--mf-status-rail) solid var(--mf-warning);
  border-radius: var(--mf-radius-md);
  background: var(--mf-bg-card);
  color: var(--mf-text-main);
}

.timeline-hint-v520e.danger,
.story-check-problem-card-v520h.danger,
.story-check-problem-card-v520h.critical {
  border-left-color: var(--mf-danger);
}

.timeline-grouped-list-v520e,
.knowledge-group-list-v43,
.storycontrol-groups-v44 {
  display: grid;
  gap: var(--mf-space-5);
}

.timeline-group-v520e,
.knowledge-character-group-v43,
.storycontrol-group-v44 {
  display: grid;
  gap: var(--mf-space-3);
}

.timeline-group-head-v520e,
.knowledge-character-head-v43,
.storycontrol-group-v44 > .section-title {
  display: flex;
  justify-content: space-between;
  gap: var(--mf-space-4);
  align-items: flex-end;
  padding: var(--mf-space-4);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-lg);
  background: var(--mf-bg-panel);
}

.timeline-list-inner-v520e,
.storylogic-list-v40a,
.storycontrol-grid-v44,
.knowledge-grid-v43,
.storylogic-grid-v40a {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
  gap: var(--mf-space-4);
}

.storylogic-card-v40a,
.timeline-card-v520e,
.knowledge-card-v43,
.storycontrol-card-v44,
.story-check-problem-card-v520h {
  display: grid;
  gap: var(--mf-space-3);
  padding: var(--mf-space-4);
  border: 1px solid var(--mf-border-soft);
  border-left: var(--mf-status-rail) solid var(--mf-border-accent);
  border-radius: var(--mf-radius-lg);
  background: var(--mf-bg-card);
  color: var(--mf-text-main);
  box-shadow: var(--mf-shadow-card);
}

.timeline-card-v520e.importance-critical,
.storylogic-card-v40a.importance-critical,
.knowledge-card-v43.has-conflict-v43,
.storycontrol-card-v44.status-hidden,
.story-check-problem-card-v520h.danger,
.story-check-problem-card-v520h.critical {
  border-left-color: var(--mf-danger);
}

.timeline-card-v520e.importance-high,
.storylogic-card-v40a.importance-high,
.storycontrol-card-v44.status-hinting {
  border-left-color: var(--mf-warning);
}

.storylogic-card-top-v40a,
.timeline-card-top-v520e,
.knowledge-card-top-v43,
.storycontrol-card-head-v44,
.story-check-problem-head-v520h {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--mf-space-3);
}

.timeline-card-actions-v520a,
.knowledge-card-actions-v43,
.storycontrol-card-head-v44 > .btn,
.story-check-problem-actions-v520h {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--mf-space-2);
}

.storylogic-chip-row-v40a,
.timeline-chip-row-v520e,
.knowledge-state-badges-v43,
.storycontrol-chip-row-v44,
.story-check-affected-v520h,
.story-check-result-meta-v520g {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mf-space-2);
  align-items: center;
}

.storylogic-chip-row-v40a > span,
.timeline-chip-row-v520e > span,
.knowledge-state-badges-v43 > span,
.storycontrol-chip-row-v44 > span,
.story-check-affected-v520h a,
.story-check-affected-v520h em {
  display: inline-flex;
  align-items: center;
  gap: var(--mf-space-1);
  min-height: var(--mf-chip-height);
  padding: var(--mf-space-1) var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-pill);
  background: var(--mf-bg-chip);
  color: var(--mf-text-main);
  font-size: var(--mf-type-xs);
  font-weight: var(--mf-weight-bold);
}

.storylogic-desc-v40a,
.storylogic-small-v40a,
.knowledge-warning-v43,
.storycontrol-desc-v44,
.story-check-recommendation-v520h,
.story-check-problem-body-v520h p {
  color: var(--mf-text-muted);
}

.timeline-drag-panel-v520a,
.timeline-drag-panel-v520e,
.storycontrol-warning-panel-v44,
.storycontrol-chapter-map-v44,
.story-check-hero-v520f,
.story-check-ai-card-v520f,
.story-ai-prompt-v54,
.story-ai-history-v54,
.story-ai-answer-v54 {
  display: grid;
  gap: var(--mf-space-4);
  padding: var(--mf-space-4);
}

.timeline-drag-actions-v520a,
.storycontrol-issue-list-v44,
.story-check-copy-row-v520g,
.story-check-actions-v520g {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--mf-space-2);
}

.knowledge-character-meta-v43,
.storycontrol-timeline-v44,
.story-check-stats-v520f {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mf-space-2);
}

.knowledge-character-meta-v43 span,
.storycontrol-timeline-v44 > div,
.story-check-stats-v520f span {
  display: grid;
  gap: var(--mf-space-1);
  padding: var(--mf-space-2) var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-sm);
  background: var(--mf-bg-panel);
}

.storycontrol-status-form-v44 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--mf-space-2);
  align-items: end;
  margin-top: var(--mf-space-2);
  padding-top: var(--mf-space-3);
  border-top: 1px solid var(--mf-border-soft);
}

.storycontrol-issues-v44 {
  display: grid;
  gap: var(--mf-space-2);
}

.storycontrol-issues-v44 > div {
  display: grid;
  gap: var(--mf-space-1);
  padding: var(--mf-space-2) var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-sm);
  background: var(--mf-bg-panel);
}

.story-check-layout-v520f,
.story-check-layout-v520h {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 26rem);
  gap: var(--mf-space-4);
  align-items: start;
}

.story-check-problem-list-v520h {
  grid-template-columns: 1fr;
}

.story-check-problem-card-v520h {
  border-left-color: var(--mf-danger);
}

.story-check-problem-actions-v520h {
  justify-content: flex-end;
  padding-top: var(--mf-space-3);
  border-top: 1px solid var(--mf-border-soft);
}

.story-check-jumpbar-v520g {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mf-space-2);
  margin-block: var(--mf-space-4);
}

.story-check-jumpbar-v520g a {
  min-height: var(--mf-control-height-sm);
  display: inline-flex;
  align-items: center;
  padding: var(--mf-space-2) var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-pill);
  background: var(--mf-bg-chip);
  color: var(--mf-control-text);
  font-weight: var(--mf-weight-bold);
}

.story-ai-prompt-box-v54,
.story-ai-answer-box-v54 {
  width: 100%;
  max-height: 28rem;
  overflow: auto;
  padding: var(--mf-space-4);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-md);
  background: var(--mf-bg-input);
  color: var(--mf-text-main);
}

@media (max-width: 1180px) {
  .chapter-editor-page-v527d {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .chapter-editor-page-v527d .editor-layout-v55a,
  .chapter-editor-page-v527d .editor-main,
  .chapter-editor-page-v527d .editor-side-stack,
  .chapter-editor-page-v527d .editor-context-panel {
    height: auto;
    overflow: visible;
  }

  .chapter-editor-page-v527d #chapterText {
    min-height: min(70vh, 42rem);
  }

  .story-check-layout-v520f,
  .story-check-layout-v520h {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .sidebar {
    height: auto;
    max-height: 100dvh;
    overflow: hidden;
  }

  .side-nav,
  .sidebar-bottom {
    display: none;
  }

  .sidebar.is-mobile-open {
    height: 100dvh;
  }

  .sidebar.is-mobile-open .side-nav {
    display: grid;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }

  .sidebar.is-mobile-open .sidebar-bottom {
    display: grid;
    flex: 0 0 auto;
  }

  .module-hero-actions-v524b,
  .module-hero-actions-v524b:has(a[href*="knowledge-states"]),
  .module-hero-actions-v524b:has(a[href*="timeline"]):has(a[href*="characters"]),
  .module-hero-actions-v524b:has(a[href*="secrets"]):has(a[href*="characters"]) {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .editor-cockpit-summary-v527d {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .editor-cockpit-summary-v527d small {
    grid-column: 2 / -1;
    white-space: normal;
  }
}

@media (max-width: 720px) {
  .storylogic-card-top-v40a,
  .timeline-card-top-v520e,
  .knowledge-card-top-v43,
  .storycontrol-card-head-v44,
  .story-check-problem-head-v520h,
  .knowledge-character-head-v43,
  .timeline-group-head-v520e {
    display: grid;
  }

  .storycontrol-status-form-v44 {
    grid-template-columns: 1fr;
  }
}

/* v5.27d-hotfix-sidebar-nav: Sidebar-Navigation wieder kompakt halten */
.app-sidebar nav a,
.app-sidebar .sidebar-nav a,
.app-sidebar .sidebar-link,
.app-sidebar .nav-link,
.mf-sidebar nav a,
.mf-sidebar .sidebar-nav a,
.mf-sidebar .sidebar-link,
.mf-sidebar .nav-link,
aside[class*="sidebar"] nav a,
aside[class*="sidebar"] .sidebar-nav a,
aside[class*="sidebar"] .sidebar-link,
aside[class*="sidebar"] .nav-link {
  min-height: 2.75rem;
  height: auto;
  max-height: 3.25rem;
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
}

.app-sidebar nav a[aria-current="page"],
.app-sidebar nav a.is-active,
.app-sidebar nav a.active,
.app-sidebar .sidebar-link[aria-current="page"],
.app-sidebar .sidebar-link.is-active,
.app-sidebar .sidebar-link.active,
.mf-sidebar nav a[aria-current="page"],
.mf-sidebar nav a.is-active,
.mf-sidebar nav a.active,
.mf-sidebar .sidebar-link[aria-current="page"],
.mf-sidebar .sidebar-link.is-active,
.mf-sidebar .sidebar-link.active,
aside[class*="sidebar"] nav a[aria-current="page"],
aside[class*="sidebar"] nav a.is-active,
aside[class*="sidebar"] nav a.active,
aside[class*="sidebar"] .sidebar-link[aria-current="page"],
aside[class*="sidebar"] .sidebar-link.is-active,
aside[class*="sidebar"] .sidebar-link.active {
  min-height: 2.75rem;
  max-height: 3.25rem;
}

.app-sidebar nav li,
.app-sidebar .sidebar-nav li,
.mf-sidebar nav li,
.mf-sidebar .sidebar-nav li,
aside[class*="sidebar"] nav li,
aside[class*="sidebar"] .sidebar-nav li {
  min-height: 0;
  height: auto;
}

.app-sidebar nav,
.app-sidebar .sidebar-nav,
.mf-sidebar nav,
.mf-sidebar .sidebar-nav,
aside[class*="sidebar"] nav,
aside[class*="sidebar"] .sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* UI Library: App Sidebar Layout
   Allgemeiner Navigationsbaustein für MagicFeather.

   Regel:
   - Sidebar ist ein dreigeteilter App-Rahmen.
   - Kopfbereich mit Logo/App-Name bleibt oben fix.
   - Mittlere Navigation scrollt intern, wenn viele Punkte vorhanden sind.
   - Konto/Abmelden/Darstellung bleiben unten fix.
   - Navigationsschrift ist lesbar, nicht überfettet.
   - Aktive Navigation ist sichtbar, aber nie als riesige Karte.
*/

.app-sidebar,
.mf-sidebar,
aside[class*="sidebar"] {
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-sidebar > header,
.app-sidebar .sidebar-header,
.app-sidebar .brand,
.app-sidebar .brand-area,
.app-sidebar .app-brand,
.mf-sidebar > header,
.mf-sidebar .sidebar-header,
.mf-sidebar .brand,
.mf-sidebar .brand-area,
.mf-sidebar .app-brand,
aside[class*="sidebar"] > header,
aside[class*="sidebar"] .sidebar-header,
aside[class*="sidebar"] .brand,
aside[class*="sidebar"] .brand-area,
aside[class*="sidebar"] .app-brand {
  flex: 0 0 auto;
}

.app-sidebar nav,
.app-sidebar .sidebar-nav,
.app-sidebar .sidebar-main,
.app-sidebar .nav-main,
.mf-sidebar nav,
.mf-sidebar .sidebar-nav,
.mf-sidebar .sidebar-main,
.mf-sidebar .nav-main,
aside[class*="sidebar"] nav,
aside[class*="sidebar"] .sidebar-nav,
aside[class*="sidebar"] .sidebar-main,
aside[class*="sidebar"] .nav-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: var(--space-1);
  scrollbar-width: thin;
}

.app-sidebar .sidebar-footer,
.app-sidebar .sidebar-bottom,
.app-sidebar .account-area,
.app-sidebar .theme-switcher,
.app-sidebar .sidebar-account,
.mf-sidebar .sidebar-footer,
.mf-sidebar .sidebar-bottom,
.mf-sidebar .account-area,
.mf-sidebar .theme-switcher,
.mf-sidebar .sidebar-account,
aside[class*="sidebar"] .sidebar-footer,
aside[class*="sidebar"] .sidebar-bottom,
aside[class*="sidebar"] .account-area,
aside[class*="sidebar"] .theme-switcher,
aside[class*="sidebar"] .sidebar-account {
  flex: 0 0 auto;
}

.app-sidebar .brand img,
.app-sidebar .brand-area img,
.app-sidebar .app-brand img,
.app-sidebar .sidebar-header img,
.mf-sidebar .brand img,
.mf-sidebar .brand-area img,
.mf-sidebar .app-brand img,
.mf-sidebar .sidebar-header img,
aside[class*="sidebar"] .brand img,
aside[class*="sidebar"] .brand-area img,
aside[class*="sidebar"] .app-brand img,
aside[class*="sidebar"] .sidebar-header img {
  width: 3.25rem;
  height: 3.25rem;
  max-width: 3.25rem;
  max-height: 3.25rem;
}

.app-sidebar .brand,
.app-sidebar .brand-area,
.app-sidebar .app-brand,
.app-sidebar .sidebar-header,
.mf-sidebar .brand,
.mf-sidebar .brand-area,
.mf-sidebar .app-brand,
.mf-sidebar .sidebar-header,
aside[class*="sidebar"] .brand,
aside[class*="sidebar"] .brand-area,
aside[class*="sidebar"] .app-brand,
aside[class*="sidebar"] .sidebar-header {
  gap: var(--space-3);
}

.app-sidebar nav a,
.app-sidebar .sidebar-nav a,
.app-sidebar .sidebar-link,
.app-sidebar .nav-link,
.mf-sidebar nav a,
.mf-sidebar .sidebar-nav a,
.mf-sidebar .sidebar-link,
.mf-sidebar .nav-link,
aside[class*="sidebar"] nav a,
aside[class*="sidebar"] .sidebar-nav a,
aside[class*="sidebar"] .sidebar-link,
aside[class*="sidebar"] .nav-link {
  min-height: 2.4rem;
  max-height: 2.9rem;
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
  font-weight: var(--font-weight-medium);
  line-height: 1.25;
}

.app-sidebar nav a[aria-current="page"],
.app-sidebar nav a.is-active,
.app-sidebar nav a.active,
.app-sidebar .sidebar-link[aria-current="page"],
.app-sidebar .sidebar-link.is-active,
.app-sidebar .sidebar-link.active,
.mf-sidebar nav a[aria-current="page"],
.mf-sidebar nav a.is-active,
.mf-sidebar nav a.active,
.mf-sidebar .sidebar-link[aria-current="page"],
.mf-sidebar .sidebar-link.is-active,
.mf-sidebar .sidebar-link.active,
aside[class*="sidebar"] nav a[aria-current="page"],
aside[class*="sidebar"] nav a.is-active,
aside[class*="sidebar"] nav a.active,
aside[class*="sidebar"] .sidebar-link[aria-current="page"],
aside[class*="sidebar"] .sidebar-link.is-active,
aside[class*="sidebar"] .sidebar-link.active {
  min-height: 2.4rem;
  max-height: 2.9rem;
  font-weight: var(--font-weight-semibold);
}

.app-sidebar nav li,
.app-sidebar .sidebar-nav li,
.mf-sidebar nav li,
.mf-sidebar .sidebar-nav li,
aside[class*="sidebar"] nav li,
aside[class*="sidebar"] .sidebar-nav li {
  min-height: 0;
  height: auto;
}

.app-sidebar nav,
.app-sidebar .sidebar-nav,
.mf-sidebar nav,
.mf-sidebar .sidebar-nav,
aside[class*="sidebar"] nav,
aside[class*="sidebar"] .sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.app-sidebar h2,
.app-sidebar h3,
.app-sidebar .sidebar-section-title,
.app-sidebar .nav-section-title,
.mf-sidebar h2,
.mf-sidebar h3,
.mf-sidebar .sidebar-section-title,
.mf-sidebar .nav-section-title,
aside[class*="sidebar"] h2,
aside[class*="sidebar"] h3,
aside[class*="sidebar"] .sidebar-section-title,
aside[class*="sidebar"] .nav-section-title {
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-wide);
}

.app-sidebar .sidebar-footer a,
.app-sidebar .sidebar-bottom a,
.app-sidebar .account-area a,
.app-sidebar .sidebar-account a,
.mf-sidebar .sidebar-footer a,
.mf-sidebar .sidebar-bottom a,
.mf-sidebar .account-area a,
.mf-sidebar .sidebar-account a,
aside[class*="sidebar"] .sidebar-footer a,
aside[class*="sidebar"] .sidebar-bottom a,
aside[class*="sidebar"] .account-area a,
aside[class*="sidebar"] .sidebar-account a {
  font-weight: var(--font-weight-medium);
}

/* UI Library: App Sidebar Layout */
/* Allgemeiner Navigationsbaustein: Header fix, Navigation scrollt, Footer fix. */
.sidebar {
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-header {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-2);
}
.sidebar-header .brand {
  min-width: 0;
}
.brand {
  display: grid;
  grid-template-columns: 3.35rem minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
}
.brand-logo {
  width: 3.35rem;
  height: 3.35rem;
  max-width: 3.35rem;
  max-height: 3.35rem;
}
.brand-copy {
  min-width: 0;
}
.brand strong {
  line-height: 1.15;
  font-weight: var(--font-weight-semibold);
}
.brand span {
  line-height: 1.35;
  letter-spacing: var(--letter-spacing-wide);
}
.sidebar-collapse-toggle {
  grid-column: 2;
  grid-row: 1;
}
.mobile-nav-toggle {
  grid-column: 1 / -1;
}
.side-nav.sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  padding-right: var(--space-1);
}
.sidebar-footer,
.sidebar-bottom {
  flex: 0 0 auto;
}
.side-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.side-nav a,
.nav-group summary,
.sidebar-bottom a,
.sidebar-bottom button {
  font-weight: var(--font-weight-medium);
  line-height: 1.25;
}
.side-nav a {
  min-height: 2.4rem;
  max-height: 2.9rem;
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
}
.side-nav a[aria-current="page"],
.side-nav a.is-active,
.side-nav a.active {
  font-weight: var(--font-weight-semibold);
}
.side-nav .sidebar-primary-link {
  min-height: 2.8rem;
  max-height: 3.25rem;
  font-weight: var(--font-weight-semibold);
  background: linear-gradient(135deg, var(--mf-sidebar-active-bg), var(--mf-surface-raised));
  border-color: var(--mf-sidebar-active-border);
  box-shadow: var(--mf-shadow-soft);
}
.side-nav .sidebar-primary-link .ui-icon {
  color: var(--mf-accent);
}
.nav-label,
.nav-section-title,
.sidebar-section-title {
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-wide);
}
.nav-group summary {
  min-height: 2.4rem;
  max-height: 2.9rem;
  padding-block: var(--space-2);
}
body.mf-sidebar-collapsed .sidebar-header {
  display: flex;
  flex-direction: column;
  align-items: center;
}
body.mf-sidebar-collapsed .brand {
  grid-template-columns: 1fr;
}
body.mf-sidebar-collapsed .brand-logo {
  width: var(--mf-brand-logo-mobile-size);
  height: var(--mf-brand-logo-mobile-size);
}
body.mf-sidebar-collapsed .brand-copy,
body.mf-sidebar-collapsed .mobile-nav-toggle,
body.mf-sidebar-collapsed .sidebar-footer {
  display: none;
}

/* UI Library: App Sidebar Layout Final v5.27e-sb3
   Allgemeine Sidebar-Regel für MagicFeather, keine seitenbezogene Sonderregel.
   Kopf und Fuß bleiben fix, nur .side-nav.sidebar-scroll scrollt.
   Bücher & Reihen ist die primäre Hauptfunktion und wird aktionsähnlich hervorgehoben.
*/

.sidebar {
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand collapse"
    "mobile mobile";
  align-items: start;
  gap: var(--space-2);
  padding-bottom: var(--space-3);
}

.sidebar-header .brand {
  grid-area: brand;
}

.sidebar-collapse-toggle {
  grid-area: collapse;
  align-self: center;
}

.mobile-nav-toggle {
  grid-area: mobile;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  min-width: 0;
}

.brand-logo {
  width: 4.25rem;
  height: 4.25rem;
  max-width: 4.25rem;
  max-height: 4.25rem;
}

.brand-copy {
  min-width: 0;
}

.brand strong {
  display: block;
  line-height: 1.12;
}

.brand span {
  display: block;
  line-height: 1.35;
  letter-spacing: var(--letter-spacing-wide);
  max-width: 11rem;
}

.side-nav.sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  padding-right: var(--space-1);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.sidebar-bottom.sidebar-footer,
.sidebar-footer,
.sidebar-bottom {
  flex: 0 0 auto;
}

.side-nav a,
.nav-group summary,
.sidebar-bottom a,
.sidebar-bottom button {
  font-weight: var(--font-weight-medium);
  line-height: 1.25;
}

.side-nav a {
  min-height: 2.25rem;
  max-height: 2.75rem;
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
}

.side-nav a[aria-current="page"],
.side-nav a.is-active,
.side-nav a.active {
  font-weight: var(--font-weight-semibold);
}

.side-nav .sidebar-primary-link,
.sidebar-primary-link {
  min-height: 2.65rem;
  max-height: 3rem;
  font-weight: var(--font-weight-semibold);
  background: linear-gradient(135deg, var(--mf-accent), var(--mf-accent-soft));
  color: var(--mf-on-accent);
  border-color: var(--mf-accent-border);
  box-shadow: var(--mf-shadow-soft);
}

.side-nav .sidebar-primary-link:hover,
.sidebar-primary-link:hover {
  background: linear-gradient(135deg, var(--mf-accent-strong), var(--mf-accent));
  color: var(--mf-on-accent);
}

.sidebar-primary-link .ui-icon,
.sidebar-primary-link span {
  color: currentColor;
}

.nav-label,
.nav-section-title,
.sidebar-section-title {
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-wide);
}

.nav-group summary {
  min-height: 2.35rem;
  max-height: 2.85rem;
  padding-block: var(--space-2);
  font-weight: var(--font-weight-medium);
}

.nav-group[open] summary {
  font-weight: var(--font-weight-semibold);
}

body.mf-sidebar-collapsed .sidebar-header {
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.mf-sidebar-collapsed .brand {
  align-items: center;
}

body.mf-sidebar-collapsed .brand-logo {
  width: var(--mf-brand-logo-mobile-size);
  height: var(--mf-brand-logo-mobile-size);
}

body.mf-sidebar-collapsed .brand-copy,
body.mf-sidebar-collapsed .mobile-nav-toggle,
body.mf-sidebar-collapsed .sidebar-footer {
  display: none;
}

/* UI Library: App Sidebar Polish Final v5.27e-sb4
   Präzisierung der allgemeinen Sidebar-Bibliothek.
   Ziel: Markenblock oben zentriert, Hauptfunktion sichtbar, Collapse sauber.
*/

.sidebar-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand collapse"
    "mobile mobile";
  align-items: start;
  gap: var(--space-2);
  padding-top: var(--space-1);
}

.sidebar-header .brand {
  grid-area: brand;
}

.sidebar-header .sidebar-collapse-toggle {
  grid-area: collapse;
  align-self: center;
  justify-self: end;
}

.sidebar-header .mobile-nav-toggle {
  grid-area: mobile;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-2);
  min-width: 0;
  padding-inline: var(--space-1);
}

.brand-logo {
  width: 4.6rem;
  height: 4.6rem;
  max-width: 4.6rem;
  max-height: 4.6rem;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}

.brand-copy strong {
  font-size: var(--font-size-lg);
  line-height: 1.1;
  letter-spacing: var(--letter-spacing-tight);
}

.brand-copy span {
  max-width: 10rem;
  line-height: 1.25;
  letter-spacing: var(--letter-spacing-wide);
}

.sidebar-collapse-toggle {
  width: 2.65rem;
  height: 2.65rem;
  min-width: 2.65rem;
  min-height: 2.65rem;
  border-radius: var(--radius-xl);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--mf-shadow-soft);
}

.sidebar-collapse-toggle i {
  font-size: var(--font-size-lg);
  line-height: 1;
}

.sidebar-primary-link {
  min-height: 2.9rem;
  max-height: 3.35rem;
  border-width: 1px;
  border-style: solid;
  border-color: var(--mf-accent-border);
  background: linear-gradient(135deg, var(--mf-accent-soft), var(--mf-sidebar-active-bg));
  box-shadow: var(--mf-shadow-soft);
  font-weight: var(--font-weight-semibold);
}

.sidebar-primary-link span {
  font-weight: var(--font-weight-semibold);
}

.sidebar-primary-link .ui-icon {
  color: var(--mf-accent);
}

.side-nav a:not(.sidebar-primary-link),
.nav-group summary,
.sidebar-bottom a,
.sidebar-bottom button {
  font-weight: var(--font-weight-medium);
}

body.mf-sidebar-collapsed .sidebar-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

body.mf-sidebar-collapsed .brand {
  padding-inline: 0;
}

body.mf-sidebar-collapsed .brand-logo {
  width: 3.6rem;
  height: 3.6rem;
  max-width: 3.6rem;
  max-height: 3.6rem;
}

body.mf-sidebar-collapsed .sidebar-collapse-toggle {
  width: 2.4rem;
  height: 2.4rem;
  min-width: 2.4rem;
  min-height: 2.4rem;
}

body.mf-sidebar-collapsed .sidebar-primary-link {
  min-height: 3rem;
  justify-content: center;
}

/* UI Library: App Sidebar Brand Final v5.27e-sb5
   Finaler Markenblock-Feinschliff: Logo groß, zentriert, Claim darunter.
   Allgemeine Sidebar-Regel, kein seitenbezogener Hotfix.
*/

.sidebar-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding-block: var(--space-4) var(--space-3);
}

.sidebar-header .brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  text-align: center;
}

.sidebar-header .brand-logo {
  width: 7rem;
  height: 7rem;
  max-width: 7rem;
  max-height: 7rem;
  margin-inline: auto;
}

.sidebar-header .brand-copy {
  text-align: center;
  width: 100%;
}

.sidebar-header .brand strong {
  display: block;
  font-size: var(--font-size-lg);
  line-height: 1.1;
}

.sidebar-header .brand span {
  display: block;
  margin-top: var(--space-1);
  text-align: center;
  line-height: 1.35;
  letter-spacing: var(--letter-spacing-wide);
}

.sidebar-collapse-toggle {
  align-self: center;
  min-width: 2.65rem;
  min-height: 2.65rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-primary-link {
  min-height: 3rem;
  max-height: 3.4rem;
  font-weight: var(--font-weight-semibold);
  border-width: 1px;
  box-shadow: var(--mf-shadow-soft);
}

.sidebar-primary-link .ui-icon {
  transform: scale(1.08);
}

body.mf-sidebar-collapsed .sidebar-header {
  padding-block: var(--space-3);
}

body.mf-sidebar-collapsed .sidebar-header .brand-logo {
  width: 4.25rem;
  height: 4.25rem;
  max-width: 4.25rem;
  max-height: 4.25rem;
}

body.mf-sidebar-collapsed .sidebar-collapse-toggle {
  min-width: 2.5rem;
  min-height: 2.5rem;
}

/* UI Library: App Sidebar Logo Scale Final v5.27e-sb6 */
.sidebar .sidebar-header {
  justify-items: center;
  text-align: center;
  padding-top: var(--space-3);
}

.sidebar .brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-2);
  width: 100%;
}

.sidebar .brand-logo {
  width: 10.5rem;
  height: 10.5rem;
  max-width: 10.5rem;
  max-height: 10.5rem;
  object-fit: contain;
}

.sidebar .brand-copy {
  text-align: center;
}

.sidebar .brand strong {
  display: block;
  text-align: center;
  line-height: 1.1;
}

.sidebar .brand span {
  display: block;
  text-align: center;
  line-height: 1.25;
}

.sidebar .sidebar-collapse-toggle {
  justify-self: center;
  align-self: center;
  margin-top: var(--space-2);
}

body.mf-sidebar-collapsed .sidebar .brand-logo {
  width: 5rem;
  height: 5rem;
  max-width: 5rem;
  max-height: 5rem;
}

body.mf-sidebar-collapsed .sidebar .sidebar-header {
  padding-top: var(--space-2);
}

/* UI Library: App Shell Bottom + Layer Foundation v5.27i */
.content-wrap {
  position: relative;
  isolation: isolate;
}

.container {
  scroll-padding-bottom: calc(var(--mf-runtime-bottom-reserve, var(--mf-footer-height)) + var(--mf-space-8));
  padding-bottom: calc(var(--mf-runtime-bottom-reserve, var(--mf-footer-height)) + var(--mf-space-8));
}

.footer,
.footer-v522h,
.mf-bottom-bar,
.mf-shell-bottom-bar,
.mf-fixed-bottom-actions,
.editor-bottom-actions,
.editor-footer-nav-shell {
  z-index: var(--mf-z-bottom-bar);
}

.footer,
.footer-v522h {
  bottom: 0;
  min-height: var(--mf-footer-height);
  padding-bottom: calc(var(--mf-space-2) + var(--mf-safe-area-bottom));
  box-shadow: 0 -.7rem 1.6rem rgba(7, 27, 74, .06);
}

.footer-left-v527c,
.footer-center-v522h,
.footer-health-v522h {
  min-width: 0;
}

.footer-center-v522h {
  justify-self: center;
  width: min(48rem, 100%);
}

.footer-health-v522h {
  justify-self: end;
}

.footer-center-v522h:empty {
  display: block;
}

.editor-footer-nav-v522h {
  width: 100%;
  max-width: 48rem;
}

.editor-footer-nav-link-v522h,
.editor-footer-nav-current-v522h {
  min-width: 0;
}

.mf-bottom-bar,
.mf-shell-bottom-bar,
.mf-fixed-bottom-actions,
.editor-bottom-actions,
.editor-footer-nav-shell {
  position: sticky;
  bottom: calc(var(--mf-runtime-footer-height, var(--mf-footer-height)) + var(--mf-shell-bottom-gap));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--mf-space-2);
  padding: var(--mf-space-2);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-pill);
  background: var(--mf-bg-footer);
  box-shadow: var(--mf-shadow-control);
  backdrop-filter: var(--mf-backdrop-blur);
}

.project-index-column,
.editor-layout-v55a > aside,
.editor-layout-v56 > aside,
.series-workspace-side,
.quick-side-actions {
  position: relative;
  z-index: var(--mf-z-side-panel);
}

.drawer,
.drawer-backdrop,
.project-index-drawer,
.mf-confirm-backdrop,
.mf-project-modal-backdrop,
.mf-app-modal-backdrop-v524m1,
.mf-toast-region {
  position: fixed;
}

.project-index-drawer {
  inset: 0;
  z-index: var(--mf-z-drawer-backdrop);
  background: var(--mf-bg-scrim);
  backdrop-filter: var(--mf-backdrop-blur);
  isolation: isolate;
}

.drawer-panel {
  z-index: var(--mf-z-drawer);
  max-height: calc(100vh - var(--mf-space-10) - var(--mf-safe-area-bottom));
  overflow: auto;
}

.drawer,
.drawer-backdrop {
  z-index: var(--mf-z-drawer-backdrop);
}

.mf-project-modal-backdrop,
.mf-app-modal-backdrop-v524m1,
.mf-confirm-backdrop {
  z-index: var(--mf-z-modal-backdrop);
}

dialog.mf-modal-dialog[open],
.mf-modal-dialog[open],
.mf-project-modal-card,
.mf-app-modal-card-v524m1,
.mf-modal-card {
  z-index: var(--mf-z-modal);
}

.mf-project-modal-card,
.mf-app-modal-card-v524m1,
.mf-modal-card {
  max-height: calc(100vh - var(--mf-space-8) - var(--mf-safe-area-bottom));
}

.mf-editor-comfort-popover-v59,
.mf-editor-comfort-popover-v522i {
  position: fixed;
  top: calc(var(--mf-topbar-height) + var(--mf-space-4));
  right: max(var(--mf-page-pad-x), var(--mf-space-4));
  bottom: auto;
  z-index: var(--mf-z-popover);
  max-height: calc(100vh - var(--mf-topbar-height) - var(--mf-runtime-bottom-reserve, var(--mf-footer-height)) - var(--mf-space-7));
}

.mf-toast-region {
  z-index: var(--mf-z-toast);
  bottom: calc(var(--mf-runtime-bottom-reserve, var(--mf-footer-height)) + var(--mf-space-3));
}

.theme-audit-layer-stack-v527i,
.theme-audit-bottom-stack-v527i {
  display: grid;
  gap: var(--mf-space-3);
}

.theme-audit-layer-row-v527i {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) auto;
  align-items: center;
  gap: var(--mf-space-3);
  padding: var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-md);
  background: var(--mf-bg-card-soft);
}

.theme-audit-bottom-stack-v527i .editor-footer-nav-v522h {
  width: min(42rem, 100%);
}

.theme-audit-bottom-note-v527i {
  padding: var(--mf-space-3);
  border: 1px dashed var(--mf-border-medium);
  border-radius: var(--mf-radius-md);
  color: var(--mf-text-muted);
  background: var(--mf-bg-card-soft);
}

@media (max-width: 960px) {
  .container {
    padding-bottom: calc(var(--mf-runtime-bottom-reserve, var(--mf-footer-height)) + var(--mf-space-6));
  }

  .footer,
  .footer-v522h {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .footer-left-v527c,
  .footer-center-v522h,
  .footer-health-v522h {
    justify-self: stretch;
    justify-content: center;
  }
}

@media (max-width: 720px) {
  .mf-editor-comfort-popover-v59,
  .mf-editor-comfort-popover-v522i {
    top: auto;
    right: var(--mf-space-3);
    left: var(--mf-space-3);
    bottom: calc(var(--mf-runtime-bottom-reserve, var(--mf-footer-height)) + var(--mf-space-3));
    width: auto;
    max-height: 62vh;
  }

  .drawer-panel {
    inset: var(--mf-space-3);
    width: auto;
    max-height: calc(100vh - var(--mf-space-6) - var(--mf-safe-area-bottom));
  }
}

/* UI Library: Foundation Cleanup v5.27j
   Grundobjekte statt Seitenspezialbau: kompakte Formularoptionen,
   klare Choice-Buttons, stabile Bottom-/Layer-Abstände. */

:where(input[type="checkbox"], input[type="radio"]),
:where(.field input[type="checkbox"], .field input[type="radio"]),
:where(.filter-form input[type="checkbox"], .filter-form input[type="radio"]) {
  width: 1.15rem;
  min-width: 1.15rem;
  max-width: 1.15rem;
  height: 1.15rem;
  min-height: 1.15rem;
  padding: 0;
  margin: 0;
  box-shadow: none;
  accent-color: var(--mf-accent);
  vertical-align: middle;
}

.mf-compact-check-list-v527j,
.volume-question-options-v46,
.volume-question-options-v53,
.story-ai-options-v54,
.story-ai-options-v54c {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--mf-space-2);
  align-items: stretch;
  margin: var(--mf-space-3) 0;
}

.mf-compact-check-list-v527j label,
.volume-question-options-v46 label,
.volume-question-options-v53 label,
.story-ai-options-v54 label,
.story-ai-options-v54c label,
.ai-cost-confirm-v518b {
  min-height: var(--mf-control-height-sm);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--mf-space-2);
  padding: var(--mf-space-2) var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-sm);
  background: var(--mf-bg-card-soft);
  color: var(--mf-text-main);
}

.mf-compact-check-list-v527j label span,
.volume-question-options-v46 label span,
.volume-question-options-v53 label span,
.story-ai-options-v54 label span,
.story-ai-options-v54c label span,
.ai-cost-confirm-v518b span {
  min-width: 0;
  color: var(--mf-text-heading);
  font-size: var(--mf-type-sm);
  font-weight: var(--mf-weight-black);
  line-height: 1.25;
}

.ai-cost-confirm-v518b small {
  display: block;
  margin-top: .18rem;
  color: var(--mf-text-muted);
  font-size: var(--mf-type-xs);
  font-weight: var(--mf-weight-regular);
}

.mf-choice-options-v527j {
  display: grid;
  gap: var(--mf-space-3);
}

.mf-choice-row-v527j,
.mf-choice-options-v527j .mf-icon-options-v522i,
.mf-choice-options-v527j .mf-text-options-v522i {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.25rem, 1fr));
  gap: var(--mf-space-2);
}

.mf-choice-row-v527j button,
.mf-choice-options-v527j .mf-icon-options-v522i button,
.mf-choice-options-v527j .mf-text-options-v522i button {
  min-height: 3.15rem;
  width: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: .12rem;
  padding: var(--mf-space-2) var(--mf-space-3);
  border: 1px solid var(--mf-control-border);
  border-radius: var(--mf-radius-sm);
  background: var(--mf-control-bg);
  color: var(--mf-control-text);
  text-align: center;
  box-shadow: var(--mf-shadow-control);
}

.mf-choice-row-v527j button strong,
.mf-choice-options-v527j button strong {
  font-size: var(--mf-type-sm);
  font-weight: var(--mf-weight-black);
  line-height: 1.05;
}

.mf-choice-row-v527j button small,
.mf-choice-options-v527j button small {
  color: var(--mf-text-muted);
  font-size: var(--mf-type-xs);
  font-weight: var(--mf-weight-bold);
  line-height: 1.05;
}

.mf-choice-row-v527j button.is-active,
.mf-choice-row-v527j button[aria-pressed="true"],
.mf-choice-options-v527j button.is-active,
.mf-choice-options-v527j button[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--mf-accent), var(--mf-accent-hover));
  border-color: var(--mf-accent-strong);
  color: var(--mf-text-on-accent);
}

.mf-choice-row-v527j button.is-active small,
.mf-choice-row-v527j button[aria-pressed="true"] small,
.mf-choice-options-v527j button.is-active small,
.mf-choice-options-v527j button[aria-pressed="true"] small {
  color: color-mix(in srgb, var(--mf-text-on-accent) 78%, transparent);
}

.mf-comfort-check-v522i {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-content: start;
  gap: var(--mf-space-2);
  min-height: var(--mf-control-height-sm);
  padding: var(--mf-space-2) var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-sm);
  background: var(--mf-bg-card-soft);
}

.mf-tool-teaser-v527j {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--mf-space-4);
}

.mf-tool-teaser-note-v527j {
  margin: 0;
  max-width: 18rem;
  padding: var(--mf-space-2) var(--mf-space-3);
  border: 1px dashed var(--mf-border-medium);
  border-radius: var(--mf-radius-sm);
  color: var(--mf-text-muted);
  background: var(--mf-bg-card-soft);
  font-size: var(--mf-type-sm);
}

.footer,
.footer-v522h {
  position: sticky;
  bottom: 0;
  z-index: var(--mf-z-bottom-bar);
  overflow: visible;
  max-height: none;
}

.container {
  padding-bottom: calc(var(--mf-runtime-bottom-reserve, var(--mf-footer-height)) + var(--mf-space-10));
  scroll-padding-bottom: calc(var(--mf-runtime-bottom-reserve, var(--mf-footer-height)) + var(--mf-space-10));
}

.chapter-editor-page-v527d {
  height: calc(100vh - var(--mf-topbar-height) - var(--mf-runtime-bottom-reserve, var(--mf-footer-height)) - var(--mf-space-5));
  padding-bottom: var(--mf-shell-bottom-gap);
}

.chapter-editor-page-v527d .editor-side-stack,
.chapter-editor-page-v527d .editor-context-panel,
.chapter-editor-page-v527d #chapterText {
  padding-bottom: calc(var(--mf-space-6) + var(--mf-shell-bottom-gap));
}

.project-index-drawer {
  position: fixed;
  inset: 0;
  z-index: var(--mf-z-drawer-backdrop);
  display: grid;
  justify-items: end;
  align-items: stretch;
  background: rgba(9, 21, 39, .42);
  backdrop-filter: var(--mf-backdrop-blur);
  isolation: isolate;
}

.project-index-drawer[hidden] {
  display: none !important;
}

.project-index-drawer .drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: transparent;
}

.project-index-drawer .drawer-panel {
  position: relative;
  z-index: 1;
  inset: auto;
  width: min(34rem, calc(100vw - var(--mf-space-6)));
  height: calc(100vh - var(--mf-space-6) - var(--mf-safe-area-bottom));
  max-height: calc(100vh - var(--mf-space-6) - var(--mf-safe-area-bottom));
  margin: var(--mf-space-3) var(--mf-space-3) calc(var(--mf-space-3) + var(--mf-safe-area-bottom)) 0;
  overflow: auto;
  background: var(--mf-bg-card);
  box-shadow: var(--mf-shadow-modal);
}

.mf-editor-comfort-popover-v59,
.mf-editor-comfort-popover-v522i {
  width: min(34rem, calc(100vw - var(--mf-space-6)));
  overflow: auto;
}

.story-cockpit-grid-v527d,
.editor-cockpit-grid-v527d,
.cockpit-grid-v55a {
  align-items: stretch;
}

.story-cockpit-card-v527d,
.cockpit-chip-v55a,
.cockpit-chip {
  min-height: 4rem;
  height: 100%;
}

.theme-audit-checks-v527j {
  grid-template-columns: 1fr;
}

@media (max-width: 900px) {
  .mf-tool-teaser-v527j {
    grid-template-columns: 1fr;
  }
  .mf-tool-teaser-note-v527j {
    max-width: none;
  }
  .mf-choice-row-v527j,
  .mf-choice-options-v527j .mf-icon-options-v522i,
  .mf-choice-options-v527j .mf-text-options-v522i,
  .mf-compact-check-list-v527j,
  .volume-question-options-v46,
  .volume-question-options-v53,
  .story-ai-options-v54,
  .story-ai-options-v54c {
    grid-template-columns: 1fr;
  }
}

/* UI Library: Foundation Stabilize v5.27k
   Globaler Unterbau nach Live-Prüfung: App-Shell, Footer-Abstand,
   Formulargrundobjekte, Editor-Werkzeugmodal und eindeutige Aktionszonen. */

body.mf-authenticated {
  height: 100vh;
  overflow: hidden;
}

body.mf-authenticated .app-shell {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

body.mf-authenticated .content-wrap {
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  isolation: isolate;
}

body.mf-authenticated .container {
  min-height: 0;
  overflow: auto;
  padding-bottom: var(--mf-page-pad-y) !important;
  scroll-padding-bottom: calc(var(--mf-footer-height) + var(--mf-space-4));
}

body.mf-authenticated .footer,
body.mf-authenticated .footer-v522h {
  position: relative !important;
  inset: auto !important;
  z-index: var(--mf-z-bottom-bar);
  min-height: var(--mf-footer-height);
  max-height: none;
  overflow: visible;
  align-self: stretch;
  box-shadow: 0 -.7rem 1.6rem rgba(7, 27, 74, .06);
}

.footer-center-v522h,
.footer-health-v522h,
.footer-left-v527c {
  min-width: 0;
}

.footer-center-v522h {
  justify-self: center;
  width: min(52rem, 100%);
}

.footer-health-v522h {
  justify-self: end;
}

.editor-footer-nav-v522h {
  width: 100%;
  max-width: 52rem;
}

.editor-footer-nav-link-v522h,
.editor-footer-nav-current-v522h,
.footer-health-chip-v522h {
  min-width: 0;
  white-space: nowrap;
}

/* Kompakte Formularauswahl: gewinnt bewusst gegen die globale input-Regel. */
input[type="checkbox"],
input[type="radio"],
.field input[type="checkbox"],
.field input[type="radio"],
.filter-form input[type="checkbox"],
.filter-form input[type="radio"],
.mf-compact-check-list-v527j input[type="checkbox"],
.mf-compact-check-list-v527j input[type="radio"],
.volume-question-options-v46 input[type="checkbox"],
.volume-question-options-v46 input[type="radio"],
.volume-question-options-v53 input[type="checkbox"],
.volume-question-options-v53 input[type="radio"],
.story-ai-options-v54 input[type="checkbox"],
.story-ai-options-v54 input[type="radio"],
.story-ai-options-v54c input[type="checkbox"],
.story-ai-options-v54c input[type="radio"],
.ai-cost-confirm-v518b input[type="checkbox"],
.ai-cost-confirm-v518b input[type="radio"],
.mf-comfort-check-v522i input[type="checkbox"],
.mf-comfort-check-v522i input[type="radio"] {
  width: 1.1rem !important;
  min-width: 1.1rem !important;
  max-width: 1.1rem !important;
  height: 1.1rem !important;
  min-height: 1.1rem !important;
  max-height: 1.1rem !important;
  display: inline-block;
  flex: 0 0 auto;
  padding: 0 !important;
  margin: 0;
  border-radius: .22rem;
  box-shadow: none !important;
  accent-color: var(--mf-accent);
}

.mf-compact-check-list-v527j,
.volume-question-options-v46,
.volume-question-options-v53,
.story-ai-options-v54,
.story-ai-options-v54c {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: var(--mf-space-2);
  align-items: stretch;
}

.mf-compact-check-list-v527j label,
.volume-question-options-v46 label,
.volume-question-options-v53 label,
.story-ai-options-v54 label,
.story-ai-options-v54c label,
.ai-cost-confirm-v518b,
.mf-comfort-check-v522i {
  min-height: var(--mf-control-height-sm);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--mf-space-2);
  padding: var(--mf-space-2) var(--mf-space-3);
  border: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-sm);
  background: var(--mf-bg-card-soft);
  color: var(--mf-text-main);
}

.mf-compact-check-list-v527j label span,
.volume-question-options-v46 label span,
.volume-question-options-v53 label span,
.story-ai-options-v54 label span,
.story-ai-options-v54c label span,
.ai-cost-confirm-v518b span,
.mf-comfort-check-v522i span {
  min-width: 0;
  color: var(--mf-text-heading);
  font-size: var(--mf-type-sm);
  font-weight: var(--mf-weight-bold);
  line-height: 1.25;
}

/* Editor-Werkzeuge: echte globale Modalebene, nicht halb im rechten Panel. */
.editor-tool-overlay-v55a {
  position: fixed;
  inset: 0;
  z-index: var(--mf-z-modal-backdrop);
  display: none;
  background: var(--mf-bg-scrim);
  backdrop-filter: var(--mf-backdrop-blur);
}

.editor-tool-overlay-v55a.is-open-v55a:not([hidden]) {
  display: block;
}

.editor-tool-card-v55a.is-open-v55a {
  position: fixed !important;
  top: max(var(--mf-space-4), calc(var(--mf-safe-area-bottom) + var(--mf-space-4)));
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  z-index: var(--mf-z-modal);
  width: min(64rem, calc(100vw - var(--mf-space-6)));
  max-height: calc(100vh - var(--mf-space-8) - var(--mf-safe-area-bottom));
  overflow: auto;
  margin: 0 !important;
  background: var(--mf-bg-card);
  color: var(--mf-text-main);
  border: 1px solid var(--mf-border-strong);
  border-radius: var(--mf-radius-xl);
  box-shadow: var(--mf-shadow-modal);
}

.editor-tool-card-v55a.is-open-v55a[open] {
  display: block;
}

.editor-popup-head-v55d {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--mf-space-4);
  margin: calc(var(--mf-card-pad) * -1) calc(var(--mf-card-pad) * -1) var(--mf-space-4);
  padding: var(--mf-space-4) var(--mf-card-pad);
  border-bottom: 1px solid var(--mf-border-soft);
  border-radius: var(--mf-radius-xl) var(--mf-radius-xl) 0 0;
  background: var(--mf-bg-card);
}

.editor-popup-title-v55d {
  display: grid;
  gap: var(--mf-space-1);
}

.editor-popup-title-v55d span {
  color: var(--mf-text-accent);
  font-size: var(--mf-type-xs);
  font-weight: var(--mf-weight-black);
  letter-spacing: var(--mf-track-label);
  text-transform: uppercase;
}

.editor-popup-title-v55d strong {
  color: var(--mf-text-heading);
  font-size: var(--mf-type-lg);
}

body.editor-tool-open-v55a .project-index-column,
body.editor-tool-open-v55a .editor-context-panel,
body.drawer-open .project-index-column,
body.drawer-open .editor-context-panel {
  z-index: var(--mf-z-side-panel);
}

/* Projectindex-Drawer: immer über rechter Leiste/Footer. */
.project-index-drawer {
  position: fixed !important;
  inset: 0 !important;
  z-index: var(--mf-z-drawer-backdrop) !important;
  display: grid;
  justify-items: end;
  align-items: stretch;
  background: var(--mf-bg-scrim);
  backdrop-filter: var(--mf-backdrop-blur);
  isolation: isolate;
}

.project-index-drawer[hidden] {
  display: none !important;
}

.project-index-drawer .drawer-panel {
  position: relative;
  z-index: var(--mf-z-drawer);
  width: min(34rem, calc(100vw - var(--mf-space-6)));
  height: calc(100vh - var(--mf-space-6) - var(--mf-safe-area-bottom));
  max-height: calc(100vh - var(--mf-space-6) - var(--mf-safe-area-bottom));
  margin: var(--mf-space-3) var(--mf-space-3) calc(var(--mf-space-3) + var(--mf-safe-area-bottom)) 0;
  overflow: auto;
  background: var(--mf-bg-card);
}

.project-index-drawer .drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: transparent;
}

/* Story-Cockpit-Kacheln: gleiche Grundform, gleiche Klickfläche. */
.editor-cockpit-strip-v55a,
.editor-cockpit-strip-v55f,
.story-cockpit-grid-v527d,
.cockpit-grid-v55a {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  align-items: stretch;
  gap: var(--mf-space-2);
}

.cockpit-chip,
.cockpit-chip-v55a,
.story-cockpit-card-v527d {
  width: 100%;
  min-height: 4.25rem;
  height: 100%;
  align-content: center;
  justify-content: start;
}

.cockpit-chip-v55a span,
.cockpit-chip-v55a strong,
.cockpit-chip-v55a small {
  max-width: 100%;
}

/* Werkzeugteaser: eine saubere Aktionszone rechts, keine doppelte Primäraktion. */
.mf-tool-teaser-v527j {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--mf-space-4);
}

.mf-tool-teaser-actions-v527k {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--mf-space-2);
}

.mf-tool-teaser-actions-v527k .btn {
  min-width: 12rem;
}

@media (max-width: 900px) {
  .mf-tool-teaser-v527j {
    grid-template-columns: 1fr;
  }
  .mf-tool-teaser-actions-v527k {
    justify-content: stretch;
  }
  .mf-tool-teaser-actions-v527k .btn {
    width: 100%;
  }
  .editor-tool-card-v55a.is-open-v55a {
    width: calc(100vw - var(--mf-space-4));
    max-height: calc(100vh - var(--mf-space-4) - var(--mf-safe-area-bottom));
  }
}

/* v6.2i17c: Treffer-Navigation ersetzt temporaer den Kapitel-Tools-&-Audit-Streifen. */
.mf-issue-navigation-host-v62i17c[hidden] {
  display: none;
}

.mf-issue-navigation-host-v62i17c {
  display: block;
  padding: var(--mf-space-3) var(--mf-space-4);
  border-top: 1px solid var(--mf-border-subtle, var(--mf-border));
  background: linear-gradient(180deg, var(--mf-bg-card), var(--mf-bg-soft));
}

.editor-cockpit-panel-v527d.mf-issue-navigation-active-v62i17c .editor-cockpit-summary-v527d em {
  color: var(--mf-text-muted);
}

.mf-issue-marker-v521a.mf-issue-navigation-audit-dock-v62i17c {
  position: static;
  z-index: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--mf-space-3);
  align-items: center;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: var(--mf-space-3);
  border: 1px solid var(--mf-border-subtle, var(--mf-border));
  border-left: var(--mf-status-rail-sm, 0.25rem) solid var(--mf-warning);
  border-radius: var(--mf-radius-lg);
  background: var(--mf-bg-card);
  box-shadow: none;
}

.mf-issue-marker-v521a.mf-issue-navigation-audit-dock-v62i17c[hidden] {
  display: none;
}

.mf-issue-marker-v521a.mf-issue-navigation-audit-dock-v62i17c .mf-issue-marker-icon-v521a {
  display: none;
}

.mf-issue-marker-v521a.mf-issue-navigation-audit-dock-v62i17c .mf-issue-marker-main-v521a {
  display: grid;
  gap: var(--mf-space-1);
  min-width: 0;
}

.mf-issue-marker-v521a.mf-issue-navigation-audit-dock-v62i17c .mf-issue-marker-head-v521a {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--mf-space-2);
}

.mf-issue-marker-v521a.mf-issue-navigation-audit-dock-v62i17c .mf-issue-marker-snippet-v521a,
.mf-issue-marker-v521a.mf-issue-navigation-audit-dock-v62i17c .mf-issue-marker-reason-v521a {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mf-issue-marker-v521a.mf-issue-navigation-audit-dock-v62i17c .mf-issue-marker-reason-v521a {
  display: none;
}

.mf-issue-marker-v521a.mf-issue-navigation-audit-dock-v62i17c .mf-issue-marker-actions-v521a {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--mf-space-2);
}

.mf-issue-marker-v521a.mf-issue-navigation-audit-dock-v62i17c .mf-issue-marker-actions-v521a .btn[disabled] {
  opacity: .48;
  cursor: not-allowed;
}

@media (max-width: 760px) {
  .mf-issue-marker-v521a.mf-issue-navigation-audit-dock-v62i17c {
    grid-template-columns: 1fr;
  }
  .mf-issue-marker-v521a.mf-issue-navigation-audit-dock-v62i17c .mf-issue-marker-actions-v521a {
    justify-content: flex-start;
  }
}

/* v6.2i17d-editor-navigation-rebuild: Toasts are a top-center overlay,
   not inline content at the editor footer. */
.mf-toast-root {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  left: 50%;
  z-index: var(--mf-z-toast, 1500);
  width: min(36rem, calc(100vw - 2rem));
  display: grid;
  justify-items: center;
  gap: .5rem;
  pointer-events: none;
  transform: translateX(-50%);
}

.mf-toast-root .mf-toast {
  width: auto;
  max-width: 100%;
  padding: .68rem .95rem;
  border: 1px solid var(--mf-border-soft, rgba(15, 23, 42, .12));
  border-radius: 999px;
  background: var(--mf-bg-card, #fff);
  color: var(--mf-text-main, #0f172a);
  box-shadow: var(--mf-shadow-modal, 0 18px 44px rgba(15, 23, 42, .18));
  opacity: 0;
  transform: translateY(-.45rem);
  transition: opacity .18s ease, transform .18s ease;
}

.mf-toast-root .mf-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.mf-toast-root .mf-toast.success {
  border-color: color-mix(in srgb, var(--mf-success, #16a34a) 38%, transparent);
}

.mf-toast-root .mf-toast.error,
.mf-toast-root .mf-toast.warn {
  border-color: color-mix(in srgb, var(--mf-danger, #dc2626) 38%, transparent);
}
/* BEGIN v6.2i17e-editor-navigation-controller-rebuild */

/* v6.2i17e-editor-navigation-controller-rebuild:
   Toasts liegen global oben mittig als Overlay und nicht im Editorfluss. */
#mfToastRoot.mf-toast-root,
.mf-toast-root {
  position: fixed !important;
  top: max(1rem, env(safe-area-inset-top)) !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translateX(-50%) !important;
  z-index: var(--mf-z-toast, 9999) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: .5rem !important;
  width: min(34rem, calc(100vw - 2rem)) !important;
  max-width: calc(100vw - 2rem) !important;
  margin: 0 !important;
  pointer-events: none !important;
}

#mfToastRoot.mf-toast-root .mf-toast,
.mf-toast-root .mf-toast {
  pointer-events: auto;
  max-width: 100%;
  border-radius: 999px;
  box-shadow: var(--mf-shadow-float, 0 1rem 2.5rem rgba(0,0,0,.18));
}

/* END v6.2i17e-editor-navigation-controller-rebuild */
/* BEGIN v6.2i17f-editor-navigation-controller-v2 */

/* v6.2i17f-editor-navigation-controller-v2:
   Toasts liegen global oben mittig als Overlay und nicht im Editorfluss. */
#mfToastRoot.mf-toast-root,
.mf-toast-root {
  position: fixed !important;
  top: max(1rem, env(safe-area-inset-top)) !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translateX(-50%) !important;
  z-index: var(--mf-z-toast, 9999) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: .5rem !important;
  width: min(34rem, calc(100vw - 2rem)) !important;
  max-width: calc(100vw - 2rem) !important;
  margin: 0 !important;
  pointer-events: none !important;
}

#mfToastRoot.mf-toast-root .mf-toast,
.mf-toast-root .mf-toast {
  pointer-events: auto;
  max-width: 100%;
  border-radius: 999px;
  box-shadow: var(--mf-shadow-float, 0 1rem 2.5rem rgba(0,0,0,.18));
}

/* END v6.2i17f-editor-navigation-controller-v2 */
/* BEGIN v6.2i17g-editor-navigation-anchor-scroll */

/* v6.2i17g-editor-navigation-anchor-scroll:
   Toasts liegen global oben mittig als Overlay und nicht im Editorfluss. */
#mfToastRoot.mf-toast-root,
.mf-toast-root {
  position: fixed !important;
  top: max(1rem, env(safe-area-inset-top)) !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translateX(-50%) !important;
  z-index: var(--mf-z-toast, 9999) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: .5rem !important;
  width: min(34rem, calc(100vw - 2rem)) !important;
  max-width: calc(100vw - 2rem) !important;
  margin: 0 !important;
  pointer-events: none !important;
}

#mfToastRoot.mf-toast-root .mf-toast,
.mf-toast-root .mf-toast {
  pointer-events: auto;
  max-width: 100%;
  border-radius: 999px;
  box-shadow: var(--mf-shadow-float, 0 1rem 2.5rem rgba(0,0,0,.18));
}

/* END v6.2i17g-editor-navigation-anchor-scroll */
/* BEGIN v6.2i17h-editor-navigation-hit-groups */

/* v6.2i17h-editor-navigation-hit-groups:
   Toasts liegen global oben mittig als Overlay und nicht im Editorfluss. */
#mfToastRoot.mf-toast-root,
.mf-toast-root {
  position: fixed !important;
  top: max(1rem, env(safe-area-inset-top)) !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translateX(-50%) !important;
  z-index: var(--mf-z-toast, 9999) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: .5rem !important;
  width: min(34rem, calc(100vw - 2rem)) !important;
  max-width: calc(100vw - 2rem) !important;
  margin: 0 !important;
  pointer-events: none !important;
}

#mfToastRoot.mf-toast-root .mf-toast,
.mf-toast-root .mf-toast {
  pointer-events: auto;
  max-width: 100%;
  border-radius: 999px;
  box-shadow: var(--mf-shadow-float, 0 1rem 2.5rem rgba(0,0,0,.18));
}

/* END v6.2i17h-editor-navigation-hit-groups */
/* BEGIN v6.2i17i-editor-navigation-term-locked-hits */

/* v6.2i17i-editor-navigation-term-locked-hits:
   Toasts liegen global oben mittig als Overlay und nicht im Editorfluss. */
#mfToastRoot.mf-toast-root,
.mf-toast-root {
  position: fixed !important;
  top: max(1rem, env(safe-area-inset-top)) !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translateX(-50%) !important;
  z-index: var(--mf-z-toast, 9999) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: .5rem !important;
  width: min(34rem, calc(100vw - 2rem)) !important;
  max-width: calc(100vw - 2rem) !important;
  margin: 0 !important;
  pointer-events: none !important;
}

#mfToastRoot.mf-toast-root .mf-toast,
.mf-toast-root .mf-toast {
  pointer-events: auto;
  max-width: 100%;
  border-radius: 999px;
  box-shadow: var(--mf-shadow-float, 0 1rem 2.5rem rgba(0,0,0,.18));
}

/* END v6.2i17i-editor-navigation-term-locked-hits */
/* BEGIN v6.2i17j-editor-navigation-plain-offset-map */

/* v6.2i17j-editor-navigation-plain-offset-map:
   Toasts liegen global oben mittig als Overlay und nicht im Editorfluss. */
#mfToastRoot.mf-toast-root,
.mf-toast-root {
  position: fixed !important;
  top: max(1rem, env(safe-area-inset-top)) !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translateX(-50%) !important;
  z-index: var(--mf-z-toast, 9999) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: .5rem !important;
  width: min(34rem, calc(100vw - 2rem)) !important;
  max-width: calc(100vw - 2rem) !important;
  margin: 0 !important;
  pointer-events: none !important;
}

#mfToastRoot.mf-toast-root .mf-toast,
.mf-toast-root .mf-toast {
  pointer-events: auto;
  max-width: 100%;
  border-radius: 999px;
  box-shadow: var(--mf-shadow-float, 0 1rem 2.5rem rgba(0,0,0,.18));
}

/* END v6.2i17j-editor-navigation-plain-offset-map */
/* BEGIN v6.2i17k-editor-navigation-expected-text-dom-map */

/* v6.2i17k-editor-navigation-expected-text-dom-map:
   Toasts liegen global oben mittig als Overlay und nicht im Editorfluss. */
#mfToastRoot.mf-toast-root,
.mf-toast-root {
  position: fixed !important;
  top: max(1rem, env(safe-area-inset-top)) !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translateX(-50%) !important;
  z-index: var(--mf-z-toast, 9999) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: .5rem !important;
  width: min(34rem, calc(100vw - 2rem)) !important;
  max-width: calc(100vw - 2rem) !important;
  margin: 0 !important;
  pointer-events: none !important;
}

#mfToastRoot.mf-toast-root .mf-toast,
.mf-toast-root .mf-toast {
  pointer-events: auto;
  max-width: 100%;
  border-radius: 999px;
  box-shadow: var(--mf-shadow-float, 0 1rem 2.5rem rgba(0,0,0,.18));
}

/* END v6.2i17k-editor-navigation-expected-text-dom-map */
/* BEGIN v6.2i17l-editor-navigation-owned-public-buttons */

/* v6.2i17l-editor-navigation-owned-public-buttons:
   Toasts liegen global oben mittig als Overlay und nicht im Editorfluss. */
#mfToastRoot.mf-toast-root,
.mf-toast-root {
  position: fixed !important;
  top: max(1rem, env(safe-area-inset-top)) !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translateX(-50%) !important;
  z-index: var(--mf-z-toast, 9999) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: .5rem !important;
  width: min(34rem, calc(100vw - 2rem)) !important;
  max-width: calc(100vw - 2rem) !important;
  margin: 0 !important;
  pointer-events: none !important;
}

#mfToastRoot.mf-toast-root .mf-toast,
.mf-toast-root .mf-toast {
  pointer-events: auto;
  max-width: 100%;
  border-radius: 999px;
  box-shadow: var(--mf-shadow-float, 0 1rem 2.5rem rgba(0,0,0,.18));
}

/* END v6.2i17l-editor-navigation-owned-public-buttons */
/* BEGIN v6.2i17m-editor-navigation-dock-persistence */

/* v6.2i17m-editor-navigation-dock-persistence:
   Toasts liegen global oben mittig als Overlay und nicht im Editorfluss. */
#mfToastRoot.mf-toast-root,
.mf-toast-root {
  position: fixed !important;
  top: max(1rem, env(safe-area-inset-top)) !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translateX(-50%) !important;
  z-index: var(--mf-z-toast, 9999) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: .5rem !important;
  width: min(34rem, calc(100vw - 2rem)) !important;
  max-width: calc(100vw - 2rem) !important;
  margin: 0 !important;
  pointer-events: none !important;
}

#mfToastRoot.mf-toast-root .mf-toast,
.mf-toast-root .mf-toast {
  pointer-events: auto;
  max-width: 100%;
  border-radius: 999px;
  box-shadow: var(--mf-shadow-float, 0 1rem 2.5rem rgba(0,0,0,.18));
}

/* END v6.2i17m-editor-navigation-dock-persistence */
/* BEGIN v6.2i17n-editor-navigation-scope-fix */

/* v6.2i17n-editor-navigation-scope-fix:
   Toasts liegen global oben mittig als Overlay und nicht im Editorfluss. */
#mfToastRoot.mf-toast-root,
.mf-toast-root {
  position: fixed !important;
  top: max(1rem, env(safe-area-inset-top)) !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translateX(-50%) !important;
  z-index: var(--mf-z-toast, 9999) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: .5rem !important;
  width: min(34rem, calc(100vw - 2rem)) !important;
  max-width: calc(100vw - 2rem) !important;
  margin: 0 !important;
  pointer-events: none !important;
}

#mfToastRoot.mf-toast-root .mf-toast,
.mf-toast-root .mf-toast {
  pointer-events: auto;
  max-width: 100%;
  border-radius: 999px;
  box-shadow: var(--mf-shadow-float, 0 1rem 2.5rem rgba(0,0,0,.18));
}

/* END v6.2i17n-editor-navigation-scope-fix */
/* BEGIN v6.2i17o-global-editor-navigation-consolidation */

/* v6.2i17o-global-editor-navigation-consolidation:
   Toasts liegen global oben mittig als Overlay und nicht im Editorfluss. */
#mfToastRoot.mf-toast-root,
.mf-toast-root {
  position: fixed !important;
  top: max(1rem, env(safe-area-inset-top)) !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translateX(-50%) !important;
  z-index: var(--mf-z-toast, 9999) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: .5rem !important;
  width: min(34rem, calc(100vw - 2rem)) !important;
  max-width: calc(100vw - 2rem) !important;
  margin: 0 !important;
  pointer-events: none !important;
}

#mfToastRoot.mf-toast-root .mf-toast,
.mf-toast-root .mf-toast {
  pointer-events: auto;
  max-width: 100%;
  border-radius: 999px;
  box-shadow: var(--mf-shadow-float, 0 1rem 2.5rem rgba(0,0,0,.18));
}

/* END v6.2i17o-global-editor-navigation-consolidation */

/* BEGIN v6.2i19-global-editor-navigation-source-anchored */
/* Source offsets are authoritative for Im-Text-anzeigen; hitIndex is dock-local only. */
/* END v6.2i19-global-editor-navigation-source-anchored */


/* v6.2i19f Toast Foreground Layer
   Toasts müssen immer über Editor-Docks, Tool-Popups, Modals und Overlays sichtbar sein. */
.mf-toast-root,
.toast-root,
[data-toast-root] {
  position: fixed !important;
  top: max(1rem, env(safe-area-inset-top, 0px)) !important;
  right: max(1rem, env(safe-area-inset-right, 0px)) !important;
  z-index: 2147483000 !important;
  pointer-events: none !important;
}

.mf-toast-root .mf-toast,
.toast-root .toast,
[data-toast-root] > * {
  pointer-events: auto !important;
  z-index: 2147483001 !important;
}


/* v6.2i19h Global Toast Body-Layer
   Toasts liegen global direkt auf body über Modals, Tool-Popups, Docks und Overlays. */
body > #mfToastRoot,
body > .mf-toast-root,
body > [data-toast-root],
body > [data-mf-toast-root] {
  position: fixed !important;
  top: max(1rem, env(safe-area-inset-top, 0px)) !important;
  right: max(1rem, env(safe-area-inset-right, 0px)) !important;
  left: auto !important;
  bottom: auto !important;
  z-index: 2147483647 !important;
  pointer-events: none !important;
  isolation: isolate !important;
}

body > #mfToastRoot > *,
body > .mf-toast-root > *,
body > [data-toast-root] > *,
body > [data-mf-toast-root] > * {
  z-index: 2147483647 !important;
  pointer-events: auto !important;
}


/* v6.2i19j1 Textproof Layout Repair
   Repariert den zu breiten v6.2i19i/v6.2i19j Action-Rail-CSS-Ansatz.
   Keine Grid-/Spaltenregeln mehr auf ganze Textproof-Karten. */
.editor-textproof-card .textproof-action-row,
.editor-textproof-card .textproof-issue-actions,
.editor-textproof-card [data-textproof-issue-actions] {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: .5rem;
  margin-left: auto;
}

.editor-textproof-card .textproof-action-row .btn,
.editor-textproof-card .textproof-issue-actions .btn,
.editor-textproof-card [data-textproof-issue-actions] .btn {
  white-space: nowrap;
}


/* v6.2i19k1 Textproof Issue Button Position
   Nur einzelne Hinweis-Karten, keine Gruppen/Sections: Aktionen bleiben rechts. */
.editor-textproof-card .textproof-issue {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 1rem;
  row-gap: .45rem;
  align-items: center;
}

.editor-textproof-card .textproof-issue > .textproof-issue-head,
.editor-textproof-card .textproof-issue > span,
.editor-textproof-card .textproof-issue > small {
  grid-column: 1;
  min-width: 0;
}

.editor-textproof-card .textproof-issue > .textproof-local-actions,
.editor-textproof-card .textproof-issue > .textproof-lt-actions {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: .5rem;
  margin-left: 0;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .editor-textproof-card .textproof-issue {
    grid-template-columns: 1fr;
  }

  .editor-textproof-card .textproof-issue > .textproof-local-actions,
  .editor-textproof-card .textproof-issue > .textproof-lt-actions {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
    white-space: normal;
  }
}
