/* mf6 components and standard object library */
body.mf6 .btn,
body.mf6 button.btn,
body.mf6 a.btn,
body.mf6 .mini-btn {
  min-height: 2.32rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .5rem .82rem;
  border: 1px solid var(--mf6-line-strong);
  border-radius: var(--mf6-radius-md);
  background: var(--mf6-surface);
  color: var(--mf6-text);
  font-size: var(--mf6-type-sm);
  font-weight: 780;
  line-height: 1.15;
  box-shadow: none;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}

body.mf6 .btn:hover,
body.mf6 .mini-btn:hover {
  border-color: #aebacc;
  background: var(--mf6-surface-soft);
  box-shadow: none;
}

body.mf6 .btn.primary,
body.mf6 button.primary,
body.mf6 a.primary {
  border-color: var(--mf6-navy-900);
  background: var(--mf6-navy-900);
  color: #fff;
}

body.mf6 .btn.danger,
body.mf6 .danger-btn-v58 {
  border-color: #e9b8b3;
  background: #fff5f3;
  color: var(--mf6-danger);
}

body.mf6 .btn.icon-btn,
body.mf6 .icon-btn {
  width: 2.45rem;
  padding-inline: 0;
}

body.mf6 .card,
body.mf6 .hero-card,
body.mf6 .small-card,
body.mf6 .project-card,
body.mf6 .knowledge-card,
body.mf6 .volume-book-card,
body.mf6 .dashboard-card,
body.mf6 .form-card,
body.mf6 .module-entry-card-v524e,
body.mf6 .server-cockpit-card,
body.mf6 .storycontrol-card-v44,
body.mf6 .metric-v511,
body.mf6 .cockpit-card-v511,
body.mf6 .mf6-panel {
  background: var(--mf6-paper) !important;
  border: 1px solid var(--mf6-line) !important;
  border-radius: var(--mf6-radius-md) !important;
  box-shadow: none !important;
  color: var(--mf6-text);
}

body.mf6 .hero-card,
body.mf6 .mf6-page-header {
  padding: var(--mf6-space-6) !important;
  background: #fff !important;
}

body.mf6 h1,
body.mf6 h2,
body.mf6 h3 {
  color: var(--mf6-text);
  letter-spacing: 0;
}

body.mf6 h1 {
  font-family: var(--mf6-font-editor);
  font-size: var(--mf6-type-hero);
  line-height: 1.06;
}

body.mf6 .eyebrow,
body.mf6 .mf6-label {
  margin: 0 0 .42rem;
  color: var(--mf6-muted);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

body.mf6 .muted,
body.mf6 small {
  color: var(--mf6-muted) !important;
}

body.mf6 .badge,
body.mf6 .status-pill,
body.mf6 .section-type-badge,
body.mf6 .mf6-chip {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  min-height: 1.8rem;
  padding: .32rem .64rem;
  border: 1px solid var(--mf6-line);
  border-radius: var(--mf6-radius-md);
  background: var(--mf6-surface-soft);
  color: var(--mf6-text);
  font-size: var(--mf6-type-xs);
  font-weight: 850;
  white-space: nowrap;
}

body.mf6 .mf6-chip.success { color: var(--mf6-success); }
body.mf6 .mf6-chip.warning { color: var(--mf6-warning); }
body.mf6 .mf6-chip.danger { color: var(--mf6-danger); }

body.mf6 input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
body.mf6 select,
body.mf6 textarea {
  border: 1px solid var(--mf6-line-strong);
  border-radius: var(--mf6-radius-md);
  background: #fff;
  color: var(--mf6-text);
  padding: .62rem .75rem;
  box-shadow: none;
}

body.mf6 textarea {
  line-height: 1.55;
}

body.mf6 input:focus,
body.mf6 select:focus,
body.mf6 textarea:focus,
body.mf6 .btn:focus-visible {
  outline: 3px solid rgba(217, 165, 58, .24);
  outline-offset: 2px;
  border-color: var(--mf6-gold-500);
}

/* v7-desktop-dark-touch-gate: every keyboard-reachable MF6 control keeps a
   solid, theme-independent focus boundary, including links and disclosures. */
body.mf6 :where(a[href], button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--mf6-info);
  outline-offset: 2px;
}

/* Disclosure rows are real desktop/tablet controls, not text-only links. */
body.mf6 details > summary {
  min-height: 2rem;
}

body.mf6 label,
body.mf6 .field span,
body.mf6 .form-field label {
  color: var(--mf6-text);
  font-weight: 820;
}

body.mf6 input[type="checkbox"],
body.mf6 input[type="radio"] {
  width: 1rem !important;
  height: 1rem !important;
  min-width: 1rem !important;
  min-height: 1rem !important;
  max-width: 1rem !important;
  max-height: 1rem !important;
  margin-right: .42rem;
  accent-color: var(--mf6-gold-500);
  vertical-align: -2px;
}

body.mf6 .form-actions,
body.mf6 .mf-form-page-actions-v524m5 {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--mf6-space-3);
  flex-wrap: wrap;
}

body.mf6 table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--mf6-line);
  border-radius: var(--mf6-radius-md);
}

body.mf6 th,
body.mf6 td {
  padding: .66rem .8rem;
  border-bottom: 1px solid var(--mf6-line);
  text-align: left;
}

body.mf6 th {
  background: #f8fafc;
  color: var(--mf6-muted);
  font-size: var(--mf6-type-xs);
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

body.mf6 .mf6-page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--mf6-space-6);
  margin-bottom: var(--mf6-space-5);
}

body.mf6 .mf6-page-header h1 {
  margin: 0 0 .35rem;
}

body.mf6 .mf6-card-grid,
body.mf6 .grid.cards,
body.mf6 .knowledge-grid,
body.mf6 .volume-book-grid,
body.mf6 .cockpit-grid-v511 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: var(--mf6-space-4);
}

body.mf6 .mf6-object-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: var(--mf6-space-4);
}

body.mf6 .mf6-object-card,
body.mf6 .index-entry,
body.mf6 .timeline-item-v520e,
body.mf6 .trash-item-v58,
body.mf6 .ai-model-row-v50 {
  display: grid;
  grid-template-columns: 2.45rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  width: 100%;
  padding: .72rem;
  border: 1px solid var(--mf6-line);
  border-radius: var(--mf6-radius-md);
  background: #fff;
  color: var(--mf6-text);
  text-align: left;
}

body.mf6 .mf6-object-icon,
body.mf6 .index-avatar {
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  border-radius: var(--mf6-radius-md);
  background: #eef4f8;
  color: var(--mf6-navy-800);
  font-weight: 900;
}

body.mf6 .mf6-object-card strong,
body.mf6 .index-entry strong {
  display: block;
  color: var(--mf6-text);
  font-weight: 880;
}

body.mf6 .mf6-object-card small,
body.mf6 .index-entry small {
  display: block;
  color: var(--mf6-muted);
  font-size: var(--mf6-type-xs);
}

body.mf6 .mf6-object-card.character .mf6-object-icon { color: #6941a5; }
body.mf6 .mf6-object-card.location .mf6-object-icon { color: #218a55; }
body.mf6 .mf6-object-card.codex .mf6-object-icon { color: #a66a13; }
body.mf6 .mf6-object-card.secret .mf6-object-icon { color: #b23a6d; }
body.mf6 .mf6-object-card.timeline .mf6-object-icon { color: #2e72c4; }
body.mf6 .mf6-object-card.knowledge .mf6-object-icon { color: #595fcb; }

body.mf6 .mf6-rail-card {
  margin: 0;
  padding: 1.05rem 1.15rem;
  border: 0;
  border-bottom: 1px solid var(--mf6-line);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

body.mf6 .mf-v6-rail-card {
  margin: 0;
  padding: 1.05rem 1.15rem;
  border: 0;
  border-bottom: 1px solid var(--mf6-line);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

body.mf6 .mf6-rail-card h2 {
  margin: 0 0 var(--mf6-space-3);
  font-size: 1.12rem;
}

body.mf6 .mf-v6-rail-card h2 {
  margin: 0 0 var(--mf6-space-3);
  font-size: 1.12rem;
}

body.mf6 .mf6-rail-stat {
  margin: var(--mf6-space-2) 0;
  padding: .68rem .78rem;
  border: 1px solid var(--mf6-line);
  border-radius: var(--mf6-radius-md);
  background: #fff;
}

body.mf6 .mf-v6-rail-stat {
  margin: var(--mf6-space-2) 0;
  padding: .68rem .78rem;
  border: 1px solid var(--mf6-line);
  border-radius: var(--mf6-radius-md);
  background: #fff;
}

body.mf6 .mf6-rail-stat span {
  display: block;
  color: var(--mf6-muted);
  font-size: var(--mf6-type-xs);
  font-weight: 850;
}

body.mf6 .mf-v6-rail-stat span {
  display: block;
  color: var(--mf6-muted);
  font-size: var(--mf6-type-xs);
  font-weight: 850;
}

body.mf6 .mf6-rail-stat strong {
  display: block;
  margin-top: .12rem;
}

body.mf6 .mf-v6-rail-stat strong {
  display: block;
  margin-top: .12rem;
}

body.mf6 .mf6-quick-list {
  display: grid;
  gap: var(--mf6-space-2);
}

body.mf6 .mf-v6-quick-list {
  display: grid;
  gap: var(--mf6-space-2);
}

body.mf6 .mf6-quick-list a,
body.mf6 .mf6-quick-action,
body.mf6 .mf-v6-quick-list a,
body.mf6 .mf-v6-quick-list button,
body.mf6 .mf-v6-quick-action {
  display: flex;
  justify-content: space-between;
  gap: var(--mf6-space-3);
  padding: .72rem .78rem;
  border: 1px solid var(--mf6-line);
  border-radius: var(--mf6-radius-md);
  background: #fff;
  font-weight: 820;
}

body.mf6 .cover-thumb,
body.mf6 .series-logo,
body.mf6 .book-cover-frame,
body.mf6 .volume-hero-cover,
body.mf6 .mf6-media-frame {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--mf6-line);
  border-radius: var(--mf6-radius-md);
  background: #f4f6f8;
}

body.mf6 .cover-thumb img,
body.mf6 .series-logo img,
body.mf6 .book-cover-frame img,
body.mf6 .volume-hero-cover img,
body.mf6 .mf6-media-frame img,
body.mf6 img.mf-cover-asset,
body.mf6 .mf-cover-asset-series-logo {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain !important;
}

body.mf6 .empty-state,
body.mf6 .mf6-empty-state,
body.mf6 .mf-v6-empty-state {
  padding: var(--mf6-space-8);
  border: 1px dashed var(--mf6-line-strong);
  border-radius: var(--mf6-radius-md);
  background: #fff;
  text-align: center;
}

body.mf6 .mf6-empty-icon,
body.mf6 .mf-v6-empty-icon {
  width: 4.4rem;
  height: 4.4rem;
  display: grid;
  place-items: center;
  margin: 0 auto var(--mf6-space-4);
  border-radius: 1.35rem;
  background: var(--mf6-navy-900);
  color: var(--mf6-gold-300);
  font-size: 2rem;
}

body.mf6 .mf-v6-empty-inline,
body.mf6 .mf6-empty-inline {
  padding: var(--mf6-space-4);
  border: 1px dashed var(--mf6-line-strong);
  border-radius: var(--mf6-radius-md);
  background: #fff;
  color: var(--mf6-muted);
  font-weight: 760;
}

/* mf6 canonical object library */
body.mf6 .mf6-page,
body.mf6 .mf6-module-page,
body.mf6 .mf6-stack {
  display: grid;
  gap: var(--mf6-space-5);
}

body.mf6 .mf6-page-header,
body.mf6 .mf6-module-header,
body.mf6 .module-hero-v524b,
body.mf6 .series-header,
body.mf6 .mf-v6-book-hero,
body.mf6 .mf-v6-page-hero,
body.mf6 .volume-question-hero-v46 {
  min-height: 0;
  border: 1px solid var(--mf6-line) !important;
  border-radius: var(--mf6-radius-md) !important;
  background: #fff !important;
  box-shadow: none !important;
}

body.mf6 .mf6-module-header,
body.mf6 .module-hero-v524b {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--mf6-space-5);
  padding: var(--mf6-space-5) var(--mf6-space-6) !important;
}

body.mf6 .mf6-module-header h1,
body.mf6 .mf6-module-header h2,
body.mf6 .module-hero-v524b h1,
body.mf6 .module-hero-v524b h2 {
  margin: 0 0 .35rem;
  font-family: var(--mf6-font-editor);
  font-size: clamp(1.7rem, 1.5rem + .5vw, 2.25rem);
  line-height: 1.08;
}

body.mf6 .mf6-module-actions,
body.mf6 .module-hero-actions-v524b,
body.mf6 .hero-inline-actions,
body.mf6 .detail-hero-actions-v524k4 {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--mf6-space-2);
}

body.mf6 .mf6-section,
body.mf6 .mf6-card,
body.mf6 .mf6-panel,
body.mf6 .series-main-panel,
body.mf6 .manuscript-panel,
body.mf6 .timeline-drag-panel-v520a,
body.mf6 .storycontrol-warning-panel-v44,
body.mf6 .storycontrol-chapter-map-v44 {
  border: 1px solid var(--mf6-line) !important;
  border-radius: var(--mf6-radius-md) !important;
  background: #fff !important;
  box-shadow: none !important;
}

body.mf6 .mf6-section,
body.mf6 .series-main-panel,
body.mf6 .manuscript-panel {
  padding: var(--mf6-space-5);
}

body.mf6 .mf6-section-head,
body.mf6 .section-title,
body.mf6 .mf-v6-section-head,
body.mf6 .clean-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--mf6-space-5);
  margin: 0 0 var(--mf6-space-4);
}

body.mf6 .mf6-section-head h2,
body.mf6 .section-title h2,
body.mf6 .mf-v6-section-head h2 {
  margin: 0;
  font-family: var(--mf6-font-ui);
  font-size: 1.2rem;
  line-height: 1.2;
}

body.mf6 .mf6-object-list,
body.mf6 .mf6-object-grid,
body.mf6 .module-card-grid-v524e,
body.mf6 .knowledge-grid,
body.mf6 .storycontrol-grid-v44,
body.mf6 .storylogic-grid-v40a,
body.mf6 .volume-book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: var(--mf6-space-3);
}

body.mf6 .mf6-object-row,
body.mf6 .mf6-object-card,
body.mf6 .module-entry-card-v524e,
body.mf6 .knowledge-card,
body.mf6 .storycontrol-card-v44,
body.mf6 .storylogic-card-v40a,
body.mf6 .timeline-card-v520e,
body.mf6 .knowledge-card-v43,
body.mf6 .secret-card,
body.mf6 .knowledge-state-card,
body.mf6 .volume-book-card,
body.mf6 .chapter-tile,
body.mf6 .manuscript-section-tile {
  border: 1px solid var(--mf6-line) !important;
  border-radius: var(--mf6-radius-md) !important;
  background: #fff !important;
  box-shadow: none !important;
}

body.mf6 button.mf6-object-card,
body.mf6 button.module-entry-card-v524e,
body.mf6 button.knowledge-card,
body.mf6 button.project-card {
  cursor: pointer;
}

body.mf6 .mf6-object-card:hover,
body.mf6 .module-entry-card-v524e:hover,
body.mf6 .knowledge-card:hover,
body.mf6 .volume-book-card:hover {
  border-color: #b8c2cf !important;
  background: #fbfcfe !important;
}

body.mf6 .mf6-stat-strip,
body.mf6 .storylogic-stats-v40a,
body.mf6 .storycontrol-stats-v44,
body.mf6 .timeline-stats-v520e,
body.mf6 .knowledge-stats-v43 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: var(--mf6-space-3);
}

body.mf6 .mf6-stat-strip > *,
body.mf6 .storylogic-stats-v40a > *,
body.mf6 .storycontrol-stats-v44 > * {
  padding: .82rem .9rem;
  border: 1px solid var(--mf6-line) !important;
  border-radius: var(--mf6-radius-md) !important;
  background: #fff !important;
  box-shadow: none !important;
}

body.mf6 .mf6-story-bible-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--mf6-space-2);
  margin-top: var(--mf6-space-3);
}

body.mf6 .mf6-story-bible-grid a {
  display: grid;
  gap: .15rem;
  padding: .7rem;
  border: 1px solid var(--mf6-line);
  border-radius: var(--mf6-radius-md);
  background: #fff;
}

body.mf6 .mf6-story-bible-grid span {
  color: var(--mf6-muted);
  font-size: var(--mf6-type-xs);
  font-weight: 850;
}

body.mf6 .mf6-story-bible-grid strong {
  font-size: 1.05rem;
}

body.mf6 .mf6-ki-result-card,
body.mf6 .ai-volume-answer-v53,
body.mf6 .volume-question-result-v46 {
  padding: var(--mf6-space-4);
  border: 1px solid var(--mf6-line);
  border-radius: var(--mf6-radius-md);
  background: #fff;
}

body.mf6 .volume-book-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 31rem), 1fr)) !important;
}

body.mf6 .volume-book-card {
  grid-template-columns: 7.25rem minmax(0, 1fr) !important;
  align-items: center !important;
  gap: var(--mf6-space-4) !important;
  min-height: 10rem !important;
  overflow: hidden;
}

body.mf6 .volume-book-card .book-cover-frame {
  width: 7.25rem !important;
  max-width: 7.25rem !important;
  min-width: 7.25rem !important;
}

body.mf6 .volume-book-card .book-card-copy {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

body.mf6 .volume-book-card .book-card-copy h3,
body.mf6 .volume-book-card .book-card-copy p {
  max-width: 100%;
  overflow-wrap: anywhere;
}

body.mf6 .sr-only,
body.mf6 .visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* v6.2e - Global object/action library normalization.
   This is intentionally app-wide: old module/card names are mapped onto the mf6 object library.
   No page-specific visual direction is introduced here. */
body.mf6 {
  --mf6-action-height: 2.16rem;
  --mf6-action-radius: .58rem;
  --mf6-object-title-size: 1.18rem;
  --mf6-object-body-size: .88rem;
  --mf6-object-line: 1.42;
}

body.mf6 .btn,
body.mf6 button.btn,
body.mf6 a.btn,
body.mf6 .mini-btn,
body.mf6 button[type="submit"].btn,
body.mf6 .module-hero-actions-v524b .btn,
body.mf6 .module-detail-actions-v524f .btn,
body.mf6 .knowledge-card-actions-v43 .btn,
body.mf6 .storycontrol-status-form-v44 .btn,
body.mf6 .textproof-action-row .btn,
body.mf6 .chapter-note-actions-v45 .btn {
  min-height: var(--mf6-action-height) !important;
  padding: .42rem .72rem !important;
  border-radius: var(--mf6-action-radius) !important;
  font-size: .82rem !important;
  line-height: 1.12 !important;
  font-weight: 820 !important;
  gap: .42rem !important;
}

body.mf6 .btn.mini,
body.mf6 .mini-btn,
body.mf6 .chapter-note-actions-v45 .btn.mini,
body.mf6 .textproof-action-row .btn.mini {
  min-height: 2rem !important;
  padding: .34rem .62rem !important;
  font-size: .78rem !important;
}

body.mf6 .mf-btn-icon-only-v524i,
body.mf6 .btn.icon-btn,
body.mf6 .icon-btn,
body.mf6 button[aria-label="Löschen"],
body.mf6 button[title="Löschen"] {
  width: var(--mf6-action-height) !important;
  min-width: var(--mf6-action-height) !important;
  max-width: var(--mf6-action-height) !important;
  height: var(--mf6-action-height) !important;
  min-height: var(--mf6-action-height) !important;
  padding: 0 !important;
}

body.mf6 .mf6-object-list,
body.mf6 .grid.cards,
body.mf6 .location-grid,
body.mf6 .knowledge-grid,
body.mf6 .module-card-grid-v524e,
body.mf6 .storycontrol-grid-v44,
body.mf6 .storylogic-grid-v40a,
body.mf6 .knowledge-grid-v43 {
  align-items: stretch !important;
  gap: var(--mf6-space-4) !important;
}

body.mf6 button.project-card,
body.mf6 button.knowledge-card,
body.mf6 button.module-entry-card-v524e,
body.mf6 .project-card.module-detail-trigger-v524f,
body.mf6 .knowledge-card.module-detail-trigger-v524f,
body.mf6 .module-entry-card-v524e.module-detail-trigger-v524f,
body.mf6 .mf6-object-card,
body.mf6 .storycontrol-card-v44,
body.mf6 .storylogic-card-v40a,
body.mf6 .knowledge-card-v43,
body.mf6 .secret-card,
body.mf6 .knowledge-state-card {
  position: static !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: .68rem !important;
  padding: 1rem !important;
  overflow: visible !important;
  text-align: left !important;
  line-height: var(--mf6-object-line) !important;
  white-space: normal !important;
}

body.mf6 button.project-card > *,
body.mf6 button.knowledge-card > *,
body.mf6 button.module-entry-card-v524e > *,
body.mf6 .storycontrol-card-v44 > *,
body.mf6 .storylogic-card-v40a > *,
body.mf6 .knowledge-card-v43 > *,
body.mf6 .secret-card > *,
body.mf6 .knowledge-state-card > * {
  position: static !important;
  inset: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  transform: none !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}

body.mf6 button.project-card h2,
body.mf6 button.knowledge-card h2,
body.mf6 button.module-entry-card-v524e h2,
body.mf6 .module-entry-card-v524e h2,
body.mf6 .knowledge-card h2,
body.mf6 .project-card h2,
body.mf6 .storycontrol-card-v44 h2,
body.mf6 .storycontrol-card-v44 h3,
body.mf6 .storylogic-card-v40a h2,
body.mf6 .storylogic-card-v40a h3,
body.mf6 .knowledge-card-v43 h2,
body.mf6 .knowledge-card-v43 h3,
body.mf6 .secret-card h2,
body.mf6 .secret-card h3,
body.mf6 .knowledge-state-card h2,
body.mf6 .knowledge-state-card h3 {
  margin: 0 !important;
  font-family: var(--mf6-font-ui) !important;
  font-size: var(--mf6-object-title-size) !important;
  line-height: 1.16 !important;
  letter-spacing: 0 !important;
}

body.mf6 button.project-card p,
body.mf6 button.knowledge-card p,
body.mf6 button.module-entry-card-v524e p,
body.mf6 .module-entry-card-v524e p,
body.mf6 .knowledge-card p,
body.mf6 .project-card p,
body.mf6 .storycontrol-card-v44 p,
body.mf6 .storylogic-card-v40a p,
body.mf6 .knowledge-card-v43 p,
body.mf6 .secret-card p,
body.mf6 .knowledge-state-card p,
body.mf6 .module-detail-body-v524f p {
  margin: 0 !important;
  font-size: var(--mf6-object-body-size) !important;
  line-height: var(--mf6-object-line) !important;
  color: var(--mf6-muted) !important;
}

body.mf6 .project-body,
body.mf6 .module-entry-head-v524e,
body.mf6 .knowledge-card-head-v20,
body.mf6 .knowledge-card-top-v43,
body.mf6 .storycontrol-card-head-v44,
body.mf6 .storylogic-card-top-v40a {
  position: static !important;
  width: 100% !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: .42rem !important;
  margin: 0 !important;
}

body.mf6 .module-entry-head-v524e > div,
body.mf6 .project-body > div,
body.mf6 .knowledge-card-head-v20 > div,
body.mf6 .knowledge-card-top-v43 > div,
body.mf6 .storycontrol-card-head-v44 > div,
body.mf6 .storylogic-card-top-v40a > div {
  min-width: 0 !important;
  width: 100% !important;
}

body.mf6 .module-entry-icon-v524e,
body.mf6 .cover-thumb,
body.mf6 .logo-thumb {
  flex: 0 0 auto !important;
}

body.mf6 .module-entry-badges-v524e,
body.mf6 .meta-row,
body.mf6 .knowledge-state-badges-v43,
body.mf6 .storycontrol-chip-row-v44,
body.mf6 .storylogic-chip-row-v40a,
body.mf6 .book-card-pills {
  position: static !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: .45rem !important;
  width: 100% !important;
}

body.mf6 .module-entry-badges-v524e span,
body.mf6 .meta-row span,
body.mf6 .knowledge-state-badges-v43 span,
body.mf6 .storycontrol-chip-row-v44 span,
body.mf6 .storylogic-chip-row-v40a span,
body.mf6 .book-card-pills span,
body.mf6 .knowledge-card-v43 .badge,
body.mf6 .storycontrol-card-v44 .badge,
body.mf6 .storylogic-card-v40a .badge {
  min-height: 1.55rem !important;
  padding: .22rem .48rem !important;
  border-radius: .52rem !important;
  font-size: .72rem !important;
  line-height: 1.1 !important;
  white-space: normal !important;
}


/* v6.2f - Global module action stack and object-card rhythm.
   No page-specific fix: every Story-Bible/Continuity module header uses the same compact action object. */
body.mf6 .mf6-module-header,
body.mf6 .module-hero-v524b,
body.mf6 .mf-v6-page-hero,
body.mf6 .mf-v6-book-hero {
  grid-template-columns: minmax(0, 1fr) clamp(8.75rem, 14vw, 11.25rem) !important;
  align-items: start !important;
}

body.mf6 .mf6-module-actions,
body.mf6 .module-hero-actions-v524b,
body.mf6 .hero-inline-actions,
body.mf6 .detail-hero-actions-v524k4 {
  justify-self: end !important;
  align-self: start !important;
  width: clamp(8.75rem, 14vw, 11.25rem) !important;
  max-width: 100% !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: .48rem !important;
  align-content: start !important;
}

body.mf6 .mf6-module-actions .btn,
body.mf6 .module-hero-actions-v524b .btn,
body.mf6 .hero-inline-actions .btn,
body.mf6 .detail-hero-actions-v524k4 .btn {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 2.12rem !important;
  justify-content: center !important;
  padding: .4rem .68rem !important;
  font-size: .8rem !important;
  line-height: 1.1 !important;
  white-space: normal !important;
}

body.mf6 .module-hero-copy-v524b,
body.mf6 .mf6-module-copy {
  min-width: 0 !important;
  max-width: 56rem !important;
}

body.mf6 .module-hero-copy-v524b p:not(.eyebrow),
body.mf6 .mf6-module-copy p:not(.eyebrow) {
  max-width: 48rem !important;
  line-height: 1.55 !important;
}

body.mf6 .module-entry-card-v524e,
body.mf6 .knowledge-card,
body.mf6 .project-card,
body.mf6 .secret-card,
body.mf6 .knowledge-state-card,
body.mf6 .storycontrol-card-v44,
body.mf6 .storylogic-card-v40a {
  gap: .72rem !important;
}

body.mf6 .module-entry-card-v524e .module-entry-head-v524e,
body.mf6 .knowledge-card .knowledge-card-head-v20,
body.mf6 .knowledge-card .knowledge-card-top-v43,
body.mf6 .project-card .project-body,
body.mf6 .secret-card .storycontrol-card-head-v44,
body.mf6 .knowledge-state-card .knowledge-card-top-v43 {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  gap: .65rem !important;
  align-items: start !important;
}

body.mf6 .project-card .project-body,
body.mf6 .knowledge-card .knowledge-card-head-v20 > div,
body.mf6 .module-entry-card-v524e .module-entry-head-v524e > div {
  min-width: 0 !important;
}

body.mf6 .module-entry-card-v524e h2,
body.mf6 .knowledge-card h2,
body.mf6 .project-card h2,
body.mf6 .secret-card h2,
body.mf6 .knowledge-state-card h2 {
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
}

body.mf6 .module-entry-card-v524e h2 span,
body.mf6 .knowledge-card h2 span,
body.mf6 .project-card h2 span {
  font-size: .78em !important;
  font-weight: 780 !important;
  color: var(--mf6-muted) !important;
}

@media (max-width: 980px) {
  body.mf6 .mf6-module-header,
  body.mf6 .module-hero-v524b,
  body.mf6 .mf-v6-page-hero,
  body.mf6 .mf-v6-book-hero {
    grid-template-columns: 1fr !important;
  }
  body.mf6 .mf6-module-actions,
  body.mf6 .module-hero-actions-v524b,
  body.mf6 .hero-inline-actions,
  body.mf6 .detail-hero-actions-v524k4 {
    justify-self: stretch !important;
    width: 100% !important;
  }
}


/* v6.2g - Global object library guardrail.
   Object cards may grow; text and badges must never overlap. */
body.mf6 .module-entry-card-v524e,
body.mf6 .knowledge-card,
body.mf6 .project-card,
body.mf6 .secret-card,
body.mf6 .knowledge-state-card,
body.mf6 .storycontrol-card-v44,
body.mf6 .storylogic-card-v40a,
body.mf6 .mf6-object-card,
body.mf6 .mf6-component-card {
  min-height: 0 !important;
  height: auto !important;
  align-content: start !important;
  overflow: visible !important;
}

body.mf6 .module-entry-card-v524e *,
body.mf6 .knowledge-card *,
body.mf6 .project-card *,
body.mf6 .secret-card *,
body.mf6 .knowledge-state-card *,
body.mf6 .storycontrol-card-v44 *,
body.mf6 .storylogic-card-v40a * {
  min-width: 0 !important;
  max-width: 100% !important;
}

/* BEGIN v6.2i-object-card-flow-contract */
.mf6 .mf6-object-card,
.mf6 .object-card,
.mf6 .story-bible-card,
.mf6 .continuity-card,
.mf6 .character-card,
.mf6 .location-card,
.mf6 .relationship-card,
.mf6 .secret-card,
.mf6 .knowledge-card,
.mf6 .codex-card,
.mf6 [data-mf6-object-card] {
  position: relative;
  overflow: visible;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--mf6-space-3, 12px);
  min-height: auto;
}

.mf6 .mf6-object-card *,
.mf6 .object-card *,
.mf6 .story-bible-card *,
.mf6 .continuity-card *,
.mf6 .character-card *,
.mf6 .location-card *,
.mf6 .relationship-card *,
.mf6 .secret-card *,
.mf6 .knowledge-card *,
.mf6 .codex-card *,
.mf6 [data-mf6-object-card] * {
  min-width: 0;
  max-width: 100%;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.mf6 .mf6-object-card h1,
.mf6 .mf6-object-card h2,
.mf6 .mf6-object-card h3,
.mf6 .mf6-object-card h4,
.mf6 .object-card h1,
.mf6 .object-card h2,
.mf6 .object-card h3,
.mf6 .object-card h4,
.mf6 .story-bible-card h1,
.mf6 .story-bible-card h2,
.mf6 .story-bible-card h3,
.mf6 .story-bible-card h4,
.mf6 .continuity-card h1,
.mf6 .continuity-card h2,
.mf6 .continuity-card h3,
.mf6 .continuity-card h4,
.mf6 .character-card h1,
.mf6 .character-card h2,
.mf6 .character-card h3,
.mf6 .character-card h4,
.mf6 .location-card h1,
.mf6 .location-card h2,
.mf6 .location-card h3,
.mf6 .location-card h4,
.mf6 .relationship-card h1,
.mf6 .relationship-card h2,
.mf6 .relationship-card h3,
.mf6 .relationship-card h4 {
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
  line-height: 1.08;
  margin-block: 0 var(--mf6-space-2, 8px);
}

.mf6 .mf6-object-card p,
.mf6 .object-card p,
.mf6 .story-bible-card p,
.mf6 .continuity-card p,
.mf6 .character-card p,
.mf6 .location-card p,
.mf6 .relationship-card p,
.mf6 .secret-card p,
.mf6 .knowledge-card p,
.mf6 .codex-card p {
  overflow-wrap: anywhere;
  line-height: 1.45;
  margin-block: 0;
}

.mf6 .mf6-object-card .badge,
.mf6 .mf6-object-card .chip,
.mf6 .mf6-object-card .mf6-badge,
.mf6 .mf6-object-card .mf6-chip,
.mf6 .mf6-object-card .status,
.mf6 .object-card .badge,
.mf6 .object-card .chip,
.mf6 .object-card .mf6-badge,
.mf6 .object-card .mf6-chip,
.mf6 .object-card .status,
.mf6 .story-bible-card .badge,
.mf6 .story-bible-card .chip,
.mf6 .story-bible-card .mf6-badge,
.mf6 .story-bible-card .mf6-chip,
.mf6 .continuity-card .badge,
.mf6 .continuity-card .chip,
.mf6 .continuity-card .mf6-badge,
.mf6 .continuity-card .mf6-chip,
.mf6 .character-card .badge,
.mf6 .character-card .chip,
.mf6 .character-card .mf6-badge,
.mf6 .character-card .mf6-chip,
.mf6 .relationship-card .badge,
.mf6 .relationship-card .chip,
.mf6 .relationship-card .mf6-badge,
.mf6 .relationship-card .mf6-chip {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: max-content;
  max-width: 100%;
  height: auto;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.mf6 .mf6-object-card .mf6-object-actions,
.mf6 .object-card .mf6-object-actions,
.mf6 .story-bible-card .mf6-object-actions,
.mf6 .continuity-card .mf6-object-actions,
.mf6 .character-card .mf6-object-actions,
.mf6 .location-card .mf6-object-actions,
.mf6 .relationship-card .mf6-object-actions,
.mf6 .secret-card .mf6-object-actions,
.mf6 .knowledge-card .mf6-object-actions,
.mf6 .codex-card .mf6-object-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--mf6-space-2, 8px);
  align-items: center;
  justify-content: flex-end;
}

.mf6 .mf6-object-media,
.mf6 .object-card .media,
.mf6 .character-card .media,
.mf6 .location-card .media,
.mf6 .story-bible-card .media {
  align-self: flex-start;
  flex: 0 0 auto;
}
/* END v6.2i-object-card-flow-contract */


/* BEGIN v6.2i-unsquash-badge-runtime */
.mf6 .mf6-unsquash-badge {
  position: static !important;
  display: inline-flex !important;
  width: auto !important;
  min-width: max-content !important;
  max-width: 100% !important;
  height: auto !important;
  white-space: nowrap !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
}
/* END v6.2i-unsquash-badge-runtime */

/* v6.2i-real-object-card-adoption-contract
   Real Story-Bible/Continuity list cards use the mf6 object-card flow.
   Legacy classes may remain as compatibility hooks, but the visible behavior is mf6. */
.mf6-object-card[data-mf6-object-card],
.mf6-object-card[data-mf6-object-card] *,
.mf6-object-card[data-mf6-object-card]::before,
.mf6-object-card[data-mf6-object-card]::after {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.mf6-object-card[data-mf6-object-card] {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--mf6-space-3, .75rem);
  min-width: 0;
  overflow: hidden;
}

.mf6-object-card[data-mf6-object-card] > * {
  min-width: 0;
}

.mf6-object-card[data-mf6-object-card] h2,
.mf6-object-card[data-mf6-object-card] h3,
.mf6-object-card[data-mf6-object-card] p {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.mf6-object-card[data-mf6-object-card] .knowledge-meta-badges,
.mf6-object-card[data-mf6-object-card] .knowledge-state-badges-v43,
.mf6-object-card[data-mf6-object-card] .storylogic-chip-row-v40a,
.mf6-object-card[data-mf6-object-card] .storycontrol-chip-row-v44,
.mf6-object-card[data-mf6-object-card] .storycontrol-workflow-v44,
.mf6-object-card[data-mf6-object-card] .storycontrol-timeline-v44,
.mf6-object-card[data-mf6-object-card] .timeline-chip-row-v520e {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .55rem;
  writing-mode: horizontal-tb;
}

.mf6-object-card[data-mf6-object-card] .knowledge-meta-badges > *,
.mf6-object-card[data-mf6-object-card] .knowledge-state-badges-v43 > *,
.mf6-object-card[data-mf6-object-card] .storylogic-chip-row-v40a > *,
.mf6-object-card[data-mf6-object-card] .storycontrol-chip-row-v44 > *,
.mf6-object-card[data-mf6-object-card] .timeline-chip-row-v520e > *,
.mf6-object-card[data-mf6-object-card] [class*="badge"],
.mf6-object-card[data-mf6-object-card] [class*="chip"] {
  width: auto;
  max-width: 100%;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  transform: none;
  white-space: normal;
}

.mf6-object-card[data-mf6-object-card] .timeline-marker-v40a,
.mf6-object-card[data-mf6-object-card] .timeline-marker-v520e,
.mf6-object-card[data-mf6-object-card] .timeline-drag-handle-v520a {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  transform: none;
}

.mf6-object-card[data-mf6-object-card] .timeline-card-actions-v520a,
.mf6-object-card[data-mf6-object-card] .knowledge-card-actions-v43,
.mf6-object-card[data-mf6-object-card] .storycontrol-status-form-v44,
.mf6-object-card[data-mf6-object-card] .mf6-object-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  margin-top: auto;
}

.mf6-object-card[data-mf6-object-card] button,
.mf6-object-card[data-mf6-object-card] .btn,
.mf6-object-card[data-mf6-object-card] .mini-btn {
  white-space: nowrap;
}


/* v6.2i-browser-object-card-badge-unsquash-contract
   Browser finding: old Story-Bible status badges such as "Lebend" may be positioned
   vertically at the card edge by legacy rules. Inside real mf6 object cards, all
   badges/chips/status labels must stay in normal horizontal card flow. */
.mf6-object-card[data-mf6-object-card] [class*="badge"],
.mf6-object-card[data-mf6-object-card] [class*="Badge"],
.mf6-object-card[data-mf6-object-card] [class*="chip"],
.mf6-object-card[data-mf6-object-card] [class*="Chip"],
.mf6-object-card[data-mf6-object-card] [class*="status"],
.mf6-object-card[data-mf6-object-card] [class*="Status"],
.mf6-object-card[data-mf6-object-card] [class*="life"],
.mf6-object-card[data-mf6-object-card] [class*="Life"] {
  position: static !important;
  inset: auto !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
  bottom: auto !important;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  transform: none !important;
  rotate: none !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  letter-spacing: normal !important;
}

.mf6-object-card[data-mf6-object-card] [class*="badge"]::before,
.mf6-object-card[data-mf6-object-card] [class*="badge"]::after,
.mf6-object-card[data-mf6-object-card] [class*="Badge"]::before,
.mf6-object-card[data-mf6-object-card] [class*="Badge"]::after,
.mf6-object-card[data-mf6-object-card] [class*="status"]::before,
.mf6-object-card[data-mf6-object-card] [class*="status"]::after,
.mf6-object-card[data-mf6-object-card] [class*="Status"]::before,
.mf6-object-card[data-mf6-object-card] [class*="Status"]::after,
.mf6-object-card[data-mf6-object-card] [class*="life"]::before,
.mf6-object-card[data-mf6-object-card] [class*="life"]::after,
.mf6-object-card[data-mf6-object-card] [class*="Life"]::before,
.mf6-object-card[data-mf6-object-card] [class*="Life"]::after {
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  transform: none !important;
  rotate: none !important;
}

.mf6-object-card[data-mf6-object-card] > [class*="status"],
.mf6-object-card[data-mf6-object-card] > [class*="Status"],
.mf6-object-card[data-mf6-object-card] > [class*="life"],
.mf6-object-card[data-mf6-object-card] > [class*="Life"] {
  align-self: flex-start !important;
  margin: 0 !important;
}


/* v6.2i-browser-object-card-meta-flow-contract
   Browser finding: legacy .project-body/.knowledge-card-head grids can push meta/status
   into a narrow right rail. In real mf6 object cards, body, title, meta rows and text
   must use one normal vertical content flow. */
body.mf6 .mf6-object-card[data-mf6-object-card] .project-body,
body.mf6 .mf6-object-card[data-mf6-object-card] .knowledge-card-head-v20,
body.mf6 .mf6-object-card[data-mf6-object-card] .module-entry-head-v524e,
body.mf6 .mf6-object-card[data-mf6-object-card] .storylogic-card-top-v40a,
body.mf6 .mf6-object-card[data-mf6-object-card] .knowledge-card-top-v43,
body.mf6 .mf6-object-card[data-mf6-object-card] .storycontrol-card-head-v44 {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: none !important;
  grid-template-areas: none !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: .46rem !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
}

body.mf6 .mf6-object-card[data-mf6-object-card] .meta-row,
body.mf6 .mf6-object-card[data-mf6-object-card] .knowledge-meta-badges,
body.mf6 .mf6-object-card[data-mf6-object-card] .module-entry-badges-v524e,
body.mf6 .mf6-object-card[data-mf6-object-card] .knowledge-state-badges-v43,
body.mf6 .mf6-object-card[data-mf6-object-card] .storycontrol-chip-row-v44,
body.mf6 .mf6-object-card[data-mf6-object-card] .storylogic-chip-row-v40a,
body.mf6 .mf6-object-card[data-mf6-object-card] .book-card-pills {
  position: static !important;
  inset: auto !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  align-self: flex-start !important;
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  gap: .42rem !important;
  margin: 0 !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  transform: none !important;
}

body.mf6 .mf6-object-card[data-mf6-object-card] .meta-row > *,
body.mf6 .mf6-object-card[data-mf6-object-card] .knowledge-meta-badges > *,
body.mf6 .mf6-object-card[data-mf6-object-card] .module-entry-badges-v524e > *,
body.mf6 .mf6-object-card[data-mf6-object-card] .knowledge-state-badges-v43 > *,
body.mf6 .mf6-object-card[data-mf6-object-card] .storycontrol-chip-row-v44 > *,
body.mf6 .mf6-object-card[data-mf6-object-card] .storylogic-chip-row-v40a > *,
body.mf6 .mf6-object-card[data-mf6-object-card] .book-card-pills > * {
  position: static !important;
  inset: auto !important;
  display: inline-flex !important;
  flex: 0 1 auto !important;
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  transform: none !important;
  rotate: none !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}


/* v6.2i-legacy-editor-comfort-disabled-contract
   The old v5/v522 editor comfort popover is not a release component.
   Future comfort settings must be rebuilt as a compact mf6 toolbar menu / view panel. */
body.mf6.mf-route-editor [data-mf-editor-comfort-v59],
body.mf6.mf-route-editor [data-mf-editor-comfort-popover],
body.mf6.mf-route-editor .mf-editor-comfort-popover-v59,
body.mf6.mf-route-editor .mf-editor-comfort-popover-v522i {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}


/* v6.2i2-canonical-object-body-meta-contract
   Canonical object-card structure. Object cards may still carry old compatibility classes,
   but visible body/meta/chips use mf6-object-body, mf6-object-meta and mf6-object-chip. */
body.mf6 .mf6-object-card[data-mf6-object-card] .mf6-object-media {
  flex: 0 0 auto !important;
  position: static !important;
}

body.mf6 .mf6-object-card[data-mf6-object-card] .mf6-object-body {
  position: static !important;
  inset: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: .45rem !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  transform: none !important;
  rotate: none !important;
}

body.mf6 .mf6-object-card[data-mf6-object-card] .mf6-object-meta {
  position: static !important;
  inset: auto !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  align-self: flex-start !important;
  gap: .42rem !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  transform: none !important;
  rotate: none !important;
}

body.mf6 .mf6-object-card[data-mf6-object-card] .mf6-object-chip {
  position: static !important;
  inset: auto !important;
  display: inline-flex !important;
  flex-direction: row !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: max-content !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 1.55rem !important;
  padding: .22rem .5rem !important;
  border: 1px solid var(--mf6-border, rgba(120, 140, 170, .28)) !important;
  border-radius: 999px !important;
  background: var(--mf6-surface-muted, rgba(248, 250, 252, .9)) !important;
  color: var(--mf6-muted, #65758b) !important;
  font-size: .72rem !important;
  line-height: 1.1 !important;
  font-weight: 800 !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  transform: none !important;
  rotate: none !important;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  word-break: keep-all !important;
  letter-spacing: normal !important;
}

/* v6.2i8-global-system-surface-audit-contract
   Global app-surface bridge: remaining legacy page surfaces are classified into
   existing mf6 system objects (cards, forms, filters, inline actions, empty states,
   meta rows and rail elements). This is a central compatibility contract, not a
   page-specific special fix. */
body.mf6 :is(
  .card,
  .account-card,
  .auth-card,
  .form-card,
  .small-card,
  .ai-hero-v50,
  .ai-provider-card-v50,
  .ai-task-group-v52,
  .ai-discover-card-v50a,
  .ai-test-result-v51,
  .ai-usage-card-v51,
  .smart-card-v513,
  .cockpit-card-v511,
  .history-card-v512,
  .fullbook-card-v520d,
  .fullbook-preview-v520d,
  .fullbook-info-card-v520d,
  .fullbook-protocol-v520d,
  .export-main-card,
  .import-preview-card,
  .import-fullbook-card-v520c,
  .delete-impact-card-v58a,
  .delete-impact-confirm-v58a,
  .story-ai-hero-v54,
  .story-ai-form-card-v54,
  .story-ai-answer-v54,
  .story-ai-prompt-v54,
  .story-ai-history-v54,
  .knowledge-dashboard-card,
  .secret-help-panel-v44,
  .storycontrol-warning-panel-v44,
  .storycontrol-chapter-map-v44,
  .timeline-drag-panel-v520a,
  .editor-stat-card,
  .editor-writing-card,
  .editor-meta-card,
  .editor-tool-card-v55a,
  .mf-v6-project-card
) {
  border: 1px solid var(--mf6-line) !important;
  border-radius: var(--mf6-radius-lg) !important;
  background: #fff !important;
  box-shadow: none !important;
}

/* IM-008: visible, touch-safe confirmation and provenance for signed imports. */
body.mf6 .import-contract-confirm-im008 {
  display: flex;
  flex: 1 1 100%;
  align-items: flex-start;
  gap: .65rem;
  min-width: 0;
  padding: .7rem .8rem;
  border: 1px solid color-mix(in srgb, var(--mf6-info) 42%, var(--mf6-line));
  border-radius: var(--mf6-radius-md);
  background: color-mix(in srgb, var(--mf6-info) 7%, var(--mf6-surface-raised));
  color: var(--mf6-text);
  font-size: .78rem;
  font-weight: 720;
  line-height: 1.45;
}

body.mf6 .import-contract-confirm-im008 input {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: .05rem;
  accent-color: var(--mf6-info);
}

body.mf6 .import-contract-proof-im008 {
  overflow-wrap: anywhere;
  margin: .75rem 0 0;
  padding: .55rem .7rem;
  border-radius: var(--mf6-radius-sm);
  background: var(--mf6-surface-muted);
  color: var(--mf6-muted);
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.4;
}

body.mf6 :is(
  .form-card,
  .ai-form-card-v50,
  .chapter-note-form-v45,
  .story-ai-form-v54,
  .smart-form-v513,
  .local-ai-form-v510,
  .fullbook-form-v520d,
  .fullbook-apply-form-v520d,
  .import-form,
  .import-apply-form,
  .export-form,
  .auth-form,
  .account-password-form,
  .compact-form
) {
  min-width: 0 !important;
}

body.mf6 :is(
  .form-actions,
  .auth-actions,
  .volume-question-actions-v53,
  .stacked-actions-v53,
  .story-check-actions-v520g,
  .delete-impact-actions-v58a,
  .trash-actions-v58,
  .price-actions-v515,
  .ai-discover-actions-v50a,
  .ai-route-actions-v52a,
  .ai-provider-actions-v50,
  .ai-model-actions-v54b,
  .editor-meta-actions-v16,
  .chapter-note-actions-v45,
  .story-logic-rule-actions-v42,
  .outline-item-actions,
  .ai-context-actions,
  .transfer-list-actions,
  .timeline-drag-actions-v520a,
  .timeline-card-actions-v520a,
  .knowledge-card-actions-v43,
  .story-check-problem-actions-v520h,
  .mf-content-actions-v525c,
  .fullbook-actions-v520d,
  .fullbook-apply-actions-v520d
) {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: var(--mf6-space-3) !important;
}

body.mf6 :is(
  .form-actions,
  .auth-actions,
  .volume-question-actions-v53,
  .stacked-actions-v53,
  .story-check-actions-v520g,
  .delete-impact-actions-v58a
) {
  justify-content: flex-end !important;
}

body.mf6 :is(
  .filter-form,
  .compact-search,
  .price-filter-v515,
  .story-check-filterbar-v520h,
  .storylogic-filter-v40a,
  .knowledge-filter-v20,
  .knowledge-filter-v43,
  .timeline-filter-v520e
) {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: end !important;
  gap: var(--mf6-space-3) !important;
  padding: .8rem !important;
  border: 1px solid var(--mf6-line) !important;
  border-radius: var(--mf6-radius-lg) !important;
  background: var(--mf6-surface-muted) !important;
}

body.mf6 :is(
  .empty-state,
  .inline-empty,
  .compact-empty-v51,
  .storylogic-empty-v40a,
  .delete-impact-empty-v58a,
  .mf-v6-empty-state,
  .mf-v6-empty-inline,
  .empty-index-card,
  .transfer-lock-note
) {
  display: grid !important;
  place-items: center !important;
  gap: var(--mf6-space-3) !important;
  padding: 1.35rem !important;
  border: 1px dashed rgba(15, 35, 62, .22) !important;
  border-radius: var(--mf6-radius-lg) !important;
  background: var(--mf6-surface-muted) !important;
  color: var(--mf6-muted) !important;
  text-align: center !important;
}

body.mf6 :is(
  .meta-row,
  .book-card-topline,
  .book-card-pills,
  .module-entry-badges-v524e,
  .knowledge-meta-badges,
  .knowledge-state-badges-v43,
  .storycontrol-chip-row-v44,
  .storylogic-chip-row-v40a
) {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: .4rem !important;
  min-width: 0 !important;
}

body.mf6 :is(.mf-v6-rail-card, .mf6-rail-card) :is(.btn, a.btn, button.btn) {
  width: 100%;
  justify-content: center;
}

@media (max-width: 760px) {
  body.mf6 :is(
    .form-actions,
    .auth-actions,
    .volume-question-actions-v53,
    .stacked-actions-v53,
    .story-check-actions-v520g,
    .delete-impact-actions-v58a,
    .trash-actions-v58,
    .price-actions-v515,
    .ai-discover-actions-v50a,
    .ai-route-actions-v52a,
    .ai-provider-actions-v50,
    .ai-model-actions-v54b,
    .editor-meta-actions-v16,
    .chapter-note-actions-v45,
    .outline-item-actions,
    .ai-context-actions,
    .transfer-list-actions,
    .timeline-drag-actions-v520a,
    .timeline-card-actions-v520a,
    .knowledge-card-actions-v43,
    .story-check-problem-actions-v520h,
    .mf-content-actions-v525c
  ) > :is(a.btn, button.btn, .btn, form) {
    flex: 1 1 100% !important;
  }
}


/* v6.2i12-mf6-dark-surface-audit-contract
   Global MF6 Dark Surface Audit: remaining legacy surfaces are mapped to the
   existing mf6 surface tokens. This is intentionally broad and component-based:
   no individual page receives a special color rule. */
body.mf6 {
  background: var(--mf6-page);
  color: var(--mf6-text);
}

body.mf6 :is(
  .card,
  .hero-card,
  .small-card,
  .project-card,
  .knowledge-card,
  .volume-book-card,
  .dashboard-card,
  .form-card,
  .module-entry-card-v524e,
  .server-cockpit-card,
  .storycontrol-card-v44,
  .metric-v511,
  .cockpit-card-v511,
  .mf6-panel,
  .mf6-card,
  .mf6-section,
  .mf6-component-card,
  .mf6-object-card,
  .index-entry,
  .timeline-item-v520e,
  .trash-item-v58,
  .ai-model-row-v50,
  .mf6-ki-result-card,
  .ai-volume-answer-v53,
  .volume-question-result-v46,
  .mf6-rail-stat,
  .mf-v6-rail-stat,
  .mf-v6-empty-inline,
  .mf6-empty-inline,
  .mf6-rule,
  .theme-audit-panel-v527a,
  .theme-audit-panel-v527b,
  .account-card,
  .auth-card,
  .price-stat-v515,
  .smart-mini-v513,
  .local-ai-badge-v510,
  .local-ai-info-grid-v510 > div,
  .history-card-v512,
  .snapshot-pill-v512
) {
  background: var(--mf6-surface-raised) !important;
  color: var(--mf6-text) !important;
  border-color: var(--mf6-line) !important;
}

body.mf6 :is(
  .mf6-page-header,
  .mf6-module-header,
  .module-hero-v524b,
  .series-header,
  .mf-v6-book-hero,
  .mf-v6-page-hero,
  .volume-question-hero-v46,
  .series-main-panel,
  .manuscript-panel,
  .timeline-drag-panel-v520a,
  .storycontrol-warning-panel-v44,
  .storycontrol-chapter-map-v44,
  .knowledge-dashboard-card,
  .fullbook-card-v520d,
  .fullbook-preview-v520d,
  .fullbook-info-card-v520d,
  .fullbook-protocol-v520d,
  .export-main-card,
  .import-preview-card,
  .import-fullbook-card-v520c,
  .delete-impact-card-v58a,
  .delete-impact-confirm-v58a,
  .story-ai-hero-v54,
  .story-ai-form-card-v54,
  .story-ai-answer-v54,
  .story-ai-prompt-v54,
  .story-ai-history-v54,
  .secret-help-panel-v44,
  .editor-stat-card,
  .editor-writing-card,
  .editor-meta-card,
  .editor-tool-card-v55a,
  .mf-v6-project-card
) {
  background: var(--mf6-surface-raised) !important;
  color: var(--mf6-text) !important;
  border-color: var(--mf6-line) !important;
}

body.mf6 :is(
  .mf6-section-head,
  .section-title,
  .mf-v6-section-head,
  .clean-title,
  .filter-form,
  .compact-search,
  .price-filter-v515,
  .story-check-filterbar-v520h,
  .storylogic-filter-v40a,
  .knowledge-filter-v20,
  .knowledge-filter-v43,
  .timeline-filter-v520e,
  .empty-state,
  .inline-empty,
  .compact-empty-v51,
  .storylogic-empty-v40a,
  .delete-impact-empty-v58a,
  .mf-v6-empty-state,
  .empty-index-card,
  .transfer-lock-note
) {
  background: var(--mf6-surface-soft) !important;
  color: var(--mf6-text) !important;
  border-color: var(--mf6-line) !important;
}

body.mf6 :is(
  .btn,
  button.btn,
  a.btn,
  .mini-btn,
  .download-link,
  .auth-link,
  .project-index-tabs button,
  .knowledge-filter-chip,
  .cockpit-chip,
  .footer-health-chip-v522h
) {
  background: var(--mf6-surface-control) !important;
  color: var(--mf6-text) !important;
  border-color: var(--mf6-line-strong) !important;
}

body.mf6 :is(.btn, button.btn, a.btn, .mini-btn):hover,
body.mf6 :is(.download-link, .auth-link, .project-index-tabs button, .knowledge-filter-chip, .cockpit-chip):hover {
  background: var(--mf6-surface-control-hover) !important;
  color: var(--mf6-text) !important;
  border-color: var(--mf6-line-strong) !important;
}

body.mf6 :is(.btn.primary, button.primary, a.primary, .primary, .project-index-tabs button.active, .knowledge-filter-chip.active) {
  background: var(--mf6-navy-900) !important;
  color: #071126 !important;
  border-color: var(--mf6-gold-300) !important;
}

html:not([data-mf-theme="dark"]) body.mf6 :is(.btn.primary, button.primary, a.primary, .primary, .project-index-tabs button.active, .knowledge-filter-chip.active) {
  background: var(--mf6-navy-900) !important;
  color: #fff !important;
  border-color: var(--mf6-navy-900) !important;
}

body.mf6 :is(.btn.danger, .danger-btn-v58, .danger-soft-v58, .danger-soft-v54b, .danger-chip-v40a) {
  background: var(--mf6-surface-danger) !important;
  color: var(--mf6-danger) !important;
  border-color: rgba(255, 142, 130, .34) !important;
}

body.mf6 :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select,
  textarea,
  .field input,
  .field select,
  .field textarea,
  .filter-form input,
  .filter-form select,
  #chapterText,
  .writing-textarea,
  .writing-textarea-v10,
  .writing-textarea-v11
) {
  background: var(--mf6-surface-field) !important;
  color: var(--mf6-text) !important;
  border-color: var(--mf6-line-strong) !important;
}

body.mf6 :is(input, textarea)::placeholder {
  color: var(--mf6-faint) !important;
  opacity: 1 !important;
}

body.mf6 :is(table, .mf-table-scroll) {
  background: var(--mf6-surface-raised) !important;
  color: var(--mf6-text) !important;
  border-color: var(--mf6-line) !important;
}

body.mf6 :is(th, .transfer-file-row-head) {
  background: var(--mf6-surface-table-head) !important;
  color: var(--mf6-muted) !important;
  border-color: var(--mf6-line) !important;
}

body.mf6 :is(td, th) {
  border-color: var(--mf6-line) !important;
}

body.mf6 :is(
  .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,
  .mf6-chip,
  .mf6-object-chip,
  .knowledge-meta-badges span,
  .meta-row span,
  .drawer-meta span,
  .drawer-facts span,
  .mini-chip-v511
) {
  background: var(--mf6-surface-soft) !important;
  color: var(--mf6-text) !important;
  border-color: var(--mf6-line) !important;
}

body.mf6 :is(.mf6-object-icon, .index-avatar, .cover-thumb, .series-logo, .book-cover-frame, .volume-hero-cover, .mf6-media-frame, .module-entry-icon-v524e, .detail-icon, .drawer-icon, .side-nav-icon, .empty-icon, .knowledge-type-icon) {
  background: var(--mf6-surface-icon) !important;
  color: var(--mf6-navy-800) !important;
  border-color: var(--mf6-line) !important;
}

body.mf6 :is(.mf6-rail-card, .mf-v6-rail-card) {
  background: var(--mf6-surface-raised) !important;
  color: var(--mf6-text) !important;
  border-color: var(--mf6-line) !important;
}

body.mf6 :is(.mf6-quick-list a, .mf6-quick-action, .mf-v6-quick-list a, .mf-v6-quick-list button, .mf-v6-quick-action, .mf6-story-bible-grid a) {
  background: var(--mf6-surface-control) !important;
  color: var(--mf6-text) !important;
  border-color: var(--mf6-line) !important;
}

body.mf6 :is(h1, h2, h3, h4, h5, h6, strong, label, .field span, .form-field label) {
  color: var(--mf6-text) !important;
}

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

html[data-mf-theme="dark"] body.mf6 :is(.mf6-component-card:hover, .mf6-object-card:hover, .module-entry-card-v524e:hover, .knowledge-card:hover, .volume-book-card:hover, .index-entry:hover) {
  background: var(--mf6-surface-hover) !important;
  border-color: var(--mf6-line-strong) !important;
}

html[data-mf-theme="dark"] body.mf6 :is(.btn.primary, button.primary, a.primary, .primary, .project-index-tabs button.active, .knowledge-filter-chip.active) {
  background: var(--mf6-gold-500) !important;
  color: #071126 !important;
  border-color: var(--mf6-gold-300) !important;
}

/* v7.0.0.12 · RV-002 continuity and BR-009 reader-share surfaces */
body.mf6 .continuity-stats-v70012 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .8rem;
}

body.mf6 .continuity-stats-v70012 > div {
  display: grid;
  gap: .2rem;
  padding: 1rem;
  border: 1px solid var(--mf6-line);
  border-radius: var(--mf6-radius-md);
  background: var(--mf6-surface-soft);
}

body.mf6 .continuity-stats-v70012 strong { font-size: 1.55rem; }
body.mf6 .continuity-stats-v70012 span { color: var(--mf6-muted); font-size: var(--mf6-type-sm); }

body.mf6 .continuity-layout-v70012,
body.mf6 .reader-center-layout-v70012 {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(19rem, .8fr);
  gap: 1rem;
  align-items: start;
}

body.mf6 .continuity-layout-v70012 > :is(main, aside) { display: grid; gap: 1rem; }
body.mf6 .continuity-relationship-list-v70012,
body.mf6 .continuity-boundary-list-v70012,
body.mf6 .continuity-issue-list-v70012,
body.mf6 .continuity-secret-list-v70012,
body.mf6 .reader-share-list-v70012 { display: grid; gap: .8rem; }

body.mf6 .continuity-relationship-card-v70012,
body.mf6 .continuity-boundary-card-v70012,
body.mf6 .continuity-issue-v70012,
body.mf6 .continuity-secret-list-v70012 article,
body.mf6 .reader-share-card-v70012 {
  border: 1px solid var(--mf6-line);
  border-radius: var(--mf6-radius-md);
  background: var(--mf6-surface-raised);
  padding: 1rem;
}

body.mf6 :is(.continuity-relationship-card-v70012, .reader-share-card-v70012) > header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

body.mf6 .continuity-development-list-v70012 { list-style: none; margin: 1rem 0 0; padding: 0; }
body.mf6 .continuity-development-list-v70012 li { position: relative; display: grid; grid-template-columns: 1rem 1fr; gap: .7rem; padding-bottom: 1.15rem; }
body.mf6 .continuity-development-list-v70012 li:not(:last-child)::before { content: ""; position: absolute; left: .32rem; top: .75rem; bottom: 0; border-left: 2px solid var(--mf6-line-strong); }
body.mf6 .continuity-development-marker-v70012 { width: .72rem; height: .72rem; margin-top: .35rem; border-radius: 50%; background: var(--mf6-navy-700); z-index: 1; }
body.mf6 .continuity-development-list-v70012 h4 { margin: .1rem 0 .35rem; }
body.mf6 .continuity-development-list-v70012 blockquote { margin: .65rem 0; padding: .7rem .85rem; border-left: 3px solid var(--mf6-gold-500); background: var(--mf6-surface-soft); }
body.mf6 .continuity-boundary-card-v70012 { overflow-x: auto; }
body.mf6 .continuity-boundary-card-v70012 table { min-width: 42rem; width: 100%; }
body.mf6 .continuity-issue-v70012.critical { border-left: 4px solid var(--mf6-danger); }
body.mf6 .continuity-issue-v70012.warning { border-left: 4px solid #c78a16; }
body.mf6 .continuity-issue-v70012.note { border-left: 4px solid var(--mf6-navy-700); }

body.mf6 .reader-created-v70012 { border-color: var(--mf6-gold-500); }
body.mf6 .reader-link-copy-v70012 { display: grid; grid-template-columns: 1fr auto; gap: .65rem; }
body.mf6 .reader-link-copy-v70012 input { width: 100%; min-width: 0; }
body.mf6 .reader-share-card-v70012.success { border-left: 4px solid #25825a; }
body.mf6 .reader-share-card-v70012.warning { border-left: 4px solid #c78a16; }
body.mf6 .reader-share-card-v70012.muted { opacity: .78; }
body.mf6 .reader-share-card-v70012 code { max-width: 12rem; overflow-wrap: anywhere; }
body.mf6 [data-br009-create-form] #id_chapters { display: grid; gap: .45rem; max-height: 23rem; overflow: auto; padding: .75rem; border: 1px solid var(--mf6-line); border-radius: var(--mf6-radius-md); background: var(--mf6-surface-soft); }
body.mf6 [data-br009-create-form] #id_chapters label { display: grid; grid-template-columns: auto 1fr; gap: .55rem; align-items: start; }

@media (max-width: 1100px) {
  body.mf6 .continuity-layout-v70012,
  body.mf6 .reader-center-layout-v70012 { grid-template-columns: 1fr; }
}

@media (max-width: 850px) {
  body.mf6 .continuity-stats-v70012 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.mf6 .reader-link-copy-v70012 { grid-template-columns: 1fr; }
  body.mf6 :is(.continuity-relationship-card-v70012, .reader-share-card-v70012) > header { flex-direction: column; }
}
.mf-language-selector {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-width: 0;
  margin: 0;
  font: 700 .75rem/1.2 Inter, system-ui, sans-serif;
}
.mf-language-selector label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.mf-language-selector select {
  max-width: 8.5rem;
  min-height: 2.35rem;
  border: 1px solid var(--mf6-border, #cbd5df);
  border-radius: 999px;
  padding: .35rem 1.8rem .35rem .65rem;
  background: var(--mf6-surface, #fff);
  color: var(--mf6-text, #17243a);
  font: inherit;
  cursor: pointer;
}
.mf-language-selector.is-public {
  position: fixed;
  z-index: 40;
  top: max(.75rem, env(safe-area-inset-top, 0px));
  right: max(.75rem, env(safe-area-inset-right, 0px));
}
