:root {
    --ink: #212a35;
    --ink-soft: #46515e;
    --muted: #747b83;
    --paper: #f8f6f1;
    --paper-deep: #efece3;
    --white: #ffffff;
    --line: #e4e0d6;
    --line-strong: #d4cdbd;
    --navy: #172432;
    --navy-soft: #263645;
    --gold: #b68c48;
    --gold-deep: #8e6a31;
    --gold-pale: #f3ead9;
    --red: #9f4c44;
    --red-pale: #faeeeb;
    --green: #476c59;
    --shadow: 0 18px 44px rgba(25, 34, 43, .075);
    --serif: Georgia, 'Times New Roman', serif;
    --sans: 'Segoe UI', Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 26px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.65; }
a { color: var(--gold-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #674b20; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.site-header { background: var(--navy); color: #f5f2eb; border-bottom: 3px solid var(--gold); }
.header-inner { max-width: 1240px; min-height: 76px; padding: 0 28px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; letter-spacing: -.02em; }
.brand:hover { color: #fff; }
.brand-sigil { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(220, 188, 131, .64); border-radius: 50%; color: #d7b77d; font-size: 22px; line-height: 1; }
.brand-name { font-family: var(--serif); font-size: 23px; font-weight: 600; }
.brand-name span { color: #d0b37e; font-weight: 400; }
.top-nav { display: flex; align-items: center; gap: 23px; font-size: 13px; }
.top-nav a, .nav-link-button { color: #e6e4df; text-decoration: none; transition: color .18s ease; }
.top-nav a:hover, .nav-link-button:hover { color: #e6c68c; }
.nav-link-button { border: 0; padding: 0; background: transparent; }
.nav-inline-form { display: inline; margin: 0; }
.nav-dropdown { position: relative; flex: 0 0 auto; }
.nav-dropdown summary { display: inline-flex; align-items: center; gap: 6px; color: #e6e4df; cursor: pointer; list-style: none; user-select: none; white-space: nowrap; transition: color .18s ease; }
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary::marker { content: ""; }
.nav-dropdown summary:hover, .nav-dropdown[open] summary { color: #e6c68c; }
.nav-dropdown summary:focus-visible { outline: 2px solid #e6c68c; outline-offset: 5px; border-radius: 2px; }
.nav-dropdown-caret { display: inline-block; color: #c9a568; font-size: 11px; transition: transform .18s ease; }
.nav-dropdown[open] .nav-dropdown-caret { transform: rotate(180deg); }
.nav-dropdown-menu { position: absolute; z-index: 1000; top: calc(100% + 12px); right: 0; min-width: 220px; max-width: min(290px, calc(100vw - 32px)); padding: 7px; background: #1d2c3a; border: 1px solid rgba(230, 198, 140, .35); border-radius: 6px; box-shadow: 0 14px 32px rgba(9, 17, 25, .28); }
.nav-dropdown-menu::before { content: ""; position: absolute; top: -13px; right: 0; left: 0; height: 13px; }
.top-nav .nav-dropdown-menu a, .nav-dropdown-menu .nav-link-button { display: block; width: 100%; padding: 10px 12px; border-radius: 4px; color: #eee9df; text-align: left; text-decoration: none; line-height: 1.4; }
.top-nav .nav-dropdown-menu a:hover, .nav-dropdown-menu .nav-link-button:hover { color: #f5d79f; background: rgba(230, 198, 140, .1); }
.nav-dropdown-form { margin: 5px 0 0; padding-top: 5px; border-top: 1px solid rgba(230, 198, 140, .2); }
.nav-account-meta { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px 12px; margin-bottom: 4px; border-bottom: 1px solid rgba(230, 198, 140, .2); }
.nav-account-meta strong { color: #fff; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.nav-account-meta span { color: #abb6c0; font-size: 11px; }
.site-main { min-height: calc(100vh - 148px); max-width: 1240px; margin: 0 auto; padding: 28px; }
.site-footer { color: #8e969d; background: #edf0f1; border-top: 1px solid #dfe3e4; font-size: 12px; }
.footer-inner { max-width: 1240px; margin: 0 auto; padding: 20px 28px; display: flex; justify-content: space-between; gap: 18px; }
.footer-inner span:first-child { font-family: var(--serif); color: #3e4a55; font-size: 14px; }
.page-eyebrow { color: var(--gold-deep); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .17em; margin: 0 0 14px; }
.section-kicker { color: var(--gold-deep); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .17em; margin-bottom: 10px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; border: 1px solid transparent; border-radius: 5px; padding: 9px 16px; font-size: 13px; font-weight: 700; text-decoration: none; line-height: 1.25; transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease; white-space: nowrap; }
.button:hover { text-decoration: none; transform: translateY(-1px); }
.button-primary { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 4px 12px rgba(23, 36, 50, .08); }
.button-primary:hover { background: #263b4f; color: #fff; border-color: #263b4f; }
.button-secondary { color: var(--navy); background: #fff; border-color: var(--line-strong); }
.button-secondary:hover { color: var(--navy); background: var(--paper-deep); border-color: #c0b7a4; }
.button-quiet { color: var(--ink-soft); background: transparent; border-color: var(--line-strong); }
.button-quiet:hover { color: var(--ink); background: #fff; border-color: #bdb4a2; }
.button-danger-quiet { background: #fff; color: var(--red); border-color: #e4c7c2; }
.button-danger-quiet:hover { background: var(--red-pale); color: #7e342e; }
.button-wide { width: 100%; margin-top: 6px; }
.button-add-row { margin-top: 12px; color: var(--gold-deep); border: 1px dashed #cdbb98; background: #fcfaf5; }
.button-add-row:hover { border-color: var(--gold); background: var(--gold-pale); }
.inline-form { display: inline-flex; margin: 0; }

/* Archive landing */
.archive-intro { position: relative; display: flex; min-height: 245px; overflow: hidden; align-items: center; justify-content: space-between; gap: 30px; padding: 40px 52px; color: #f8f5ef; background: radial-gradient(circle at 83% 34%, rgba(182, 140, 72, .22), transparent 27%), linear-gradient(115deg, #1a2937 0%, #253848 66%, #1b2a38 100%); border-radius: 7px; box-shadow: var(--shadow); }
.intro-copy { position: relative; z-index: 1; max-width: 650px; }
.archive-intro .section-kicker { color: #d4b476; }
.archive-intro h1 { margin: 0 0 13px; font: 500 clamp(30px, 3.2vw, 43px)/1.15 var(--serif); letter-spacing: -.03em; }
.archive-intro p { max-width: 600px; margin: 0; color: #c3cbd0; font-size: 15px; line-height: 1.8; }
.intro-art { position: absolute; right: 3%; top: 50%; width: 260px; height: 260px; transform: translateY(-50%); display: grid; place-items: center; opacity: .9; }
.intro-orbit { position: absolute; width: 204px; height: 204px; border: 1px solid rgba(221, 188, 127, .28); border-radius: 50%; }
.orbit-two { width: 145px; height: 226px; transform: rotate(45deg); border-color: rgba(221, 188, 127, .2); }
.intro-sigil { color: #d5b475; font: 130px/1 var(--serif); text-shadow: 0 0 36px rgba(209, 176, 113, .15); }
.intro-star { position: absolute; color: #efd39a; font-size: 21px; }
.star-one { top: 33px; right: 54px; }
.star-two { bottom: 25px; left: 45px; font-size: 15px; }
.archive-toolbar { margin: 39px 0 20px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.archive-toolbar h2 { margin: 0; font: 500 26px/1.25 var(--serif); letter-spacing: -.025em; }
.count-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 27px; height: 27px; padding: 0 8px; margin-left: 4px; font: 600 12px/1 var(--sans); color: #8f6d34; background: var(--gold-pale); border-radius: 20px; vertical-align: 4px; }
.toolbar-actions { display: flex; align-items: center; justify-content: end; gap: 12px; }
.search-form { display: flex; align-items: center; width: min(325px, 32vw); height: 42px; background: #fff; border: 1px solid var(--line-strong); border-radius: 5px; overflow: hidden; }
.search-form:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(182, 140, 72, .12); }
.search-form input { min-width: 0; flex: 1; height: 100%; padding: 0 12px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.search-form button { width: 43px; height: 100%; border: 0; background: transparent; color: #827252; font-size: 26px; font-family: var(--serif); }
.search-form button:hover { background: #f7f3ea; }
.character-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.character-card { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.character-card:hover { transform: translateY(-3px); border-color: #d6cbb6; box-shadow: 0 14px 30px rgba(28, 40, 52, .09); }
.card-portrait { position: relative; display: block; height: 215px; overflow: hidden; background: linear-gradient(135deg, #e5e0d4, #f0ede6); text-decoration: none; }
.card-portrait img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.character-card:hover .card-portrait img { transform: scale(1.035); }
.portrait-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 150px; background: radial-gradient(circle at 50% 35%, #f5f0e5, #e4dfd3); color: #a18a60; }
.portrait-placeholder span { font-size: 42px; font-family: var(--serif); line-height: 1.1; }
.portrait-placeholder small { margin-top: 8px; color: #968d7b; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.draft-ribbon { position: absolute; top: 12px; left: 12px; padding: 4px 8px; background: rgba(23, 36, 50, .9); color: #fff; border-radius: 3px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.card-content { padding: 19px 19px 15px; }
.card-overline { overflow: hidden; color: #9a7c43; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; text-overflow: ellipsis; white-space: nowrap; }
.card-content h3 { margin: 5px 0 9px; font: 500 24px/1.15 var(--serif); letter-spacing: -.02em; }
.card-content h3 a { color: var(--ink); text-decoration: none; }
.card-content h3 a:hover { color: var(--gold-deep); }
.card-meta { display: flex; flex-wrap: wrap; gap: 5px 9px; min-height: 26px; margin: 0; color: var(--muted); font-size: 12px; }
.card-meta span + span::before { content: '·'; margin-right: 9px; color: #b6a88b; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid #f0ede7; margin-top: 14px; padding-top: 12px; color: #8d9398; font-size: 10px; }
.card-footer a { font-size: 11px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.card-footer-details { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.card-footer-details span { line-height: 1.45; overflow-wrap: anywhere; }
.dashboard-recent-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.dashboard-recent-copy small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.card-footer a span { padding-left: 3px; }
.empty-state { max-width: 620px; margin: 45px auto; padding: 48px 30px; text-align: center; border: 1px dashed #d2c8b5; border-radius: 8px; background: rgba(255,255,255,.55); }
.archive-empty { margin-top: 18px; }
.empty-mark { display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 18px; color: var(--gold-deep); background: var(--gold-pale); border-radius: 50%; font: 33px/1 var(--serif); }
.empty-state h1, .empty-state h2 { margin: 0 0 12px; font: 500 26px/1.25 var(--serif); }
.empty-state p { margin: 0 auto 22px; max-width: 475px; color: var(--muted); font-size: 13px; }

/* Character profile */
.breadcrumb { display: flex; align-items: center; gap: 10px; margin: 0 0 22px; color: #9a9d9d; font-size: 11px; }
.breadcrumb a { color: #767e83; text-decoration: none; }
.breadcrumb a:hover { color: var(--gold-deep); }
.breadcrumb span:last-child { color: #4f5960; }
.profile-heading { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin-bottom: 27px; }
.profile-heading h1 { margin: 0; font: 500 clamp(34px, 4vw, 49px)/1.1 var(--serif); letter-spacing: -.04em; }
.profile-deck { margin: 11px 0 0; color: var(--muted); font-size: 13px; }
.profile-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.status-tag { display: inline-block; margin-left: 7px; padding: 2px 7px; color: #8e6a31; background: var(--gold-pale); border-radius: 3px; font-size: 9px; letter-spacing: .08em; vertical-align: 1px; }
.profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) 325px; gap: 32px; align-items: stretch; }
.profile-article { min-width: 0; padding: 30px 34px 22px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.feature-quote { position: relative; margin: 0 0 30px; padding: 22px 25px 21px 26px; background: linear-gradient(110deg, #f6f0e4, #fbf9f4); border-left: 3px solid var(--gold); border-radius: 0 5px 5px 0; }
.quote-mark { position: absolute; top: 4px; left: 9px; color: #d6c39f; font: 48px/1 var(--serif); }
.feature-quote blockquote { position: relative; margin: 0; color: #3b4650; font: italic 20px/1.55 var(--serif); }
.feature-quote figcaption { margin-top: 12px; color: #80745f; font-size: 11px; text-align: right; }
.contents-box { margin: 0 0 34px; border: 1px solid #e2ddd1; background: #fcfbf8; border-radius: 5px; overflow: hidden; }
.contents-title { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; color: #515a60; background: #f5f2eb; border-bottom: 1px solid #e7e1d5; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.contents-title span:last-child { color: #af925e; font-size: 16px; }
.contents-box ol { margin: 0; padding: 12px 18px 14px 37px; columns: 2; column-gap: 25px; }
.contents-box li { margin: 3px 0; padding-left: 2px; break-inside: avoid; color: #b49a6c; font-size: 12px; }
.contents-box li a { color: #606a70; text-decoration: none; }
.contents-box li a:hover { color: var(--gold-deep); text-decoration: underline; }
.article-section { padding: 0 0 31px; margin: 0 0 31px; border-bottom: 1px solid #efede7; scroll-margin-top: 20px; }
.article-section:last-of-type { border-bottom: 0; margin-bottom: 10px; }
.section-rule { display: flex; align-items: center; gap: 11px; color: #b49a6c; font-size: 12px; margin-bottom: 6px; }
.section-rule::after { display: block; content: ''; height: 1px; width: 100%; background: #ebe4d5; }
.article-section h2 { margin: 0 0 15px; color: var(--ink); font: 500 27px/1.25 var(--serif); letter-spacing: -.02em; }
.prose { color: #48535c; font-family: var(--serif); font-size: 16px; line-height: 1.87; overflow-wrap: anywhere; }
.prose br + br { display: block; content: ''; margin-top: 8px; }
.empty-copy { color: #9a9b98; font-style: italic; font-size: 13px; }
.relationship-list { display: grid; gap: 0; }
.relationship-entry { display: flex; align-items: start; gap: 14px; padding: 16px 0; border-bottom: 1px solid #f1eee8; }
.relationship-entry:last-child { border-bottom: 0; }
.relationship-initial { display: grid; place-items: center; flex: 0 0 41px; width: 41px; height: 41px; border: 1px solid #e1d5bd; background: #f8f3e9; color: #8f713c; border-radius: 50%; font: 19px/1 var(--serif); }
.relationship-copy { min-width: 0; flex: 1; }
.relationship-copy h3 { margin: 0; font: 600 17px/1.35 var(--serif); }
.relationship-copy h3 a { color: var(--ink); text-decoration: none; }
.relationship-copy h3 a:hover { color: var(--gold-deep); }
.relationship-role { margin: 2px 0 7px; color: #a18047; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.relationship-notes { color: #68727a; font-family: var(--serif); font-size: 14px; line-height: 1.7; }
.soundtrack-list { display: grid; border: 1px solid #ece7dd; border-radius: 5px; overflow: hidden; }
.track-row { display: flex; gap: 13px; align-items: center; min-width: 0; padding: 12px 15px; background: #fdfcf9; border-bottom: 1px solid #eee9df; }
.track-row:last-child { border-bottom: 0; }
.track-symbol { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; background: #f0e7d5; color: #92713a; border-radius: 4px; font-size: 16px; }
.track-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.45; }
.track-label { margin-bottom: 2px; color: #a07f43; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.track-copy strong { font-size: 13px; font-weight: 700; }
.track-copy strong a { color: #34414b; text-decoration: none; }
.track-copy strong a:hover { color: var(--gold-deep); }
.track-artist { color: #82898e; font-size: 11px; }
.track-open { display: grid; place-items: center; flex: 0 0 27px; width: 27px; height: 27px; color: #a28a5e; text-decoration: none; border: 1px solid #e6ddca; border-radius: 50%; }
.track-open:hover { color: #fff; background: var(--gold-deep); }
.profile-endnote { display: flex; align-items: center; gap: 8px; margin-top: 28px; padding-top: 18px; border-top: 1px solid #efede7; color: #9a9c9d; font-size: 10px; }
.endnote-sigil { color: #b59a67; font-size: 16px; }
.profile-sidebar { display: flex; flex-direction: column; align-items: stretch; gap: 16px; min-width: 0; min-height: 100%; }
.dossier-card { background: #fff; border: 1px solid #dcd4c4; border-radius: 6px; overflow: hidden; box-shadow: 0 8px 25px rgba(35, 43, 49, .045); }
.dossier-card-heading { padding: 11px 15px; color: #f9f4eb; background: var(--navy); text-align: center; font: 500 14px/1.4 var(--serif); letter-spacing: .07em; }
.dossier-portrait { margin: 0; height: 270px; background: #e9e5db; border-bottom: 1px solid #e0d9ca; }
.dossier-portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait-large { min-height: 270px; }
.portrait-large span { font-size: 55px; }
.dossier-name { margin: 0; padding: 15px 15px 12px; text-align: center; font: 500 23px/1.2 var(--serif); border-bottom: 1px solid #ece7dd; }
.metadata-list { margin: 0; padding: 4px 15px 13px; }
.metadata-row { display: grid; grid-template-columns: 41% minmax(0, 1fr); gap: 8px; padding: 9px 0; border-bottom: 1px solid #f1eee8; font-size: 11px; line-height: 1.5; }
.metadata-row:last-child { border-bottom: 0; }
.metadata-row dt { color: #8a8172; }
.metadata-row dd { margin: 0; color: #3f4b55; font-weight: 600; overflow-wrap: anywhere; }
.sidebar-empty { margin: 0; padding: 10px 17px 18px; color: #858b8f; font-size: 12px; }
.ooc-card { border: 1px solid #cdb9b4; border-radius: 6px; background: #fff8f6; overflow: hidden; }
.ooc-card-title { padding: 10px 14px; background: #f5e7e4; border-bottom: 1px solid #e9d5d1; color: #81443e; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.ooc-card-title span { padding-right: 6px; }
.ooc-card-body { padding: 14px; color: #6b5451; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.sidebar-note { display: flex; gap: 10px; padding: 14px 13px; border: 1px solid #e6e0d4; border-radius: 5px; background: #f3f0e8; color: #86877f; }
.sidebar-note span { color: #aa8b53; font-size: 17px; }
.sidebar-note p { margin: 0; font-size: 11px; line-height: 1.7; }


/* Mitlaufendes Inhaltsverzeichnis in der rechten Profilspalte */
.profile-section-nav {
    position: sticky;
    top: 18px;
    z-index: 4;
    align-self: stretch;
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--line-strong);
    border-top: 2px solid var(--gold);
    border-radius: 6px;
    background: var(--white);
    box-shadow: 0 8px 24px rgba(35, 43, 49, .06);
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}
.profile-section-nav-heading {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 13px 16px 12px;
    color: #f9f4eb;
    background: var(--navy);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.profile-section-nav-kicker {
    color: var(--gold-pale);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .17em;
}
.profile-section-nav-title {
    font: 500 17px/1.3 var(--serif);
    letter-spacing: .01em;
}
.profile-nav-group { border-bottom: 1px solid var(--line); }
.profile-nav-group:last-child { border-bottom: 0; }
.profile-nav-group > summary,
.profile-nav-subgroup > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
    cursor: pointer;
    list-style: none;
    transition: background .15s ease, color .15s ease;
}
.profile-nav-group > summary::-webkit-details-marker,
.profile-nav-subgroup > summary::-webkit-details-marker { display: none; }
.profile-nav-group > summary::after,
.profile-nav-subgroup > summary::after {
    content: '+';
    flex: 0 0 auto;
    color: var(--gold-deep);
    font: 500 15px/1 var(--serif);
}
.profile-nav-group[open] > summary::after,
.profile-nav-subgroup[open] > summary::after { content: '−'; }
.profile-nav-group > summary:hover,
.profile-nav-subgroup > summary:hover { color: var(--ink); background: var(--paper); }
.profile-nav-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    margin-left: auto;
    padding: 0 5px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--gold-deep);
    background: var(--paper);
    font-size: 9px;
    font-weight: 700;
}
.profile-nav-list { margin: 0; padding: 0 12px 11px 18px; list-style: none; }
.profile-nav-list li { margin: 1px 0; padding: 0; }
.profile-nav-list a {
    display: block;
    padding: 6px 9px;
    border-left: 2px solid transparent;
    border-radius: 0 4px 4px 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.profile-nav-list a:hover,
.profile-nav-list a:focus-visible {
    color: var(--ink);
    background: var(--paper);
    border-left-color: var(--gold);
    outline: none;
}
.profile-nav-subgroup { margin: 2px 0; border-top: 1px solid var(--line); }
.profile-nav-subgroup > summary { padding: 8px 8px; font-size: 10px; }
.profile-nav-nested-list { padding: 0 0 8px 12px; }
.grouped-section-child { scroll-margin-top: 22px; }

/* Authentication */
.auth-wrap { display: flex; justify-content: center; padding: 42px 0 65px; }
.auth-panel { width: min(100%, 480px); padding: 34px 38px 32px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: var(--shadow); }
.auth-panel h1 { margin: 0 0 10px; font: 500 31px/1.2 var(--serif); letter-spacing: -.025em; }
.auth-panel > p { margin: 0 0 25px; font-size: 13px; line-height: 1.7; }
.form-stack { display: grid; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: #515a61; font-size: 12px; font-weight: 700; }
.field > span { display: block; }
.field input, .field textarea, .field select { width: 100%; min-width: 0; padding: 10px 11px; background: #fff; color: var(--ink); border: 1px solid #d9d6cf; border-radius: 4px; outline: 0; font-size: 13px; font-weight: 400; line-height: 1.5; transition: border-color .15s ease, box-shadow .15s ease; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #b5955b; box-shadow: 0 0 0 3px rgba(182, 140, 72, .12); }
.field textarea { resize: vertical; min-height: 80px; }
.field input[type="file"] { padding: 8px; background: #faf9f6; }
.field small { color: #92979a; font-size: 10px; font-weight: 400; line-height: 1.6; }
.auth-bottom { padding-top: 18px; margin: 23px 0 0 !important; border-top: 1px solid #f0ede7; color: #7b8388; font-size: 12px !important; text-align: center; }
.alert { margin: 0 0 20px; padding: 13px 15px; border-radius: 5px; font-size: 12px; }
.alert ul { margin: 5px 0 0; padding-left: 19px; }
.alert li + li { margin-top: 4px; }
.alert-error { color: #783b35; background: var(--red-pale); border: 1px solid #e9c9c3; }

/* Editor */
.editor-heading { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin: 3px 0 29px; }
.editor-heading h1 { margin: 0 0 11px; font: 500 clamp(30px, 3.5vw, 40px)/1.13 var(--serif); letter-spacing: -.03em; }
.editor-heading p { max-width: 650px; margin: 0; color: var(--muted); font-size: 13px; }
.editor-heading > .button { margin-top: 8px; }
.editor-alert { margin-bottom: 22px; }
.editor-form { display: grid; gap: 20px; }
.editor-section { padding: 27px 30px 30px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.editor-section-head { display: flex; align-items: start; gap: 14px; padding-bottom: 21px; margin-bottom: 24px; border-bottom: 1px solid #eeeae1; }
.editor-step { display: grid; place-items: center; flex: 0 0 39px; width: 39px; height: 39px; border-radius: 50%; border: 1px solid #e4d6bb; color: #94733e; background: #faf5eb; font: 600 14px/1 var(--serif); }
.editor-section-head h2 { margin: 0 0 4px; font: 500 23px/1.25 var(--serif); }
.editor-section-head p { margin: 0; color: #858c91; font-size: 12px; }
.editor-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 20px; }

/* Searchable relationship target picker (character, NSC, Sonstiges). */
.relationship-target-picker { position: relative; width: 100%; }
.relationship-target-search { width: 100%; }
.relationship-target-results {
    position: absolute;
    z-index: 80;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 5px;
    border: 1px solid var(--line-strong, #d9d6cf);
    border-radius: 6px;
    background: var(--white, #fff);
    box-shadow: 0 12px 30px rgba(20, 29, 38, .18);
}
.relationship-target-results[hidden] { display: none; }
.relationship-target-option {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    padding: 9px 11px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--ink, #26313b);
    text-align: left;
    cursor: pointer;
}
.relationship-target-option strong { font-size: 13px; font-weight: 700; }
.relationship-target-option small { color: var(--muted, #777); font-size: 10px; font-weight: 400; }
.relationship-target-option:hover,
.relationship-target-option:focus,
.relationship-target-option.is-active { outline: 0; background: rgba(var(--accent-rgb, 181, 149, 91), .13); }
.relationship-target-empty { padding: 12px 11px; color: var(--muted, #777); font-size: 12px; font-weight: 400; }
.relationship-target-help { display: block; margin-top: 5px; }
@media (max-width: 760px) {
    .relationship-target-results { max-height: 240px; }
    .relationship-target-option { padding: 11px; }
}

.field-span-2 { grid-column: span 2; }
.required-mark { color: var(--red); }
.portrait-editor { display: grid; grid-template-columns: 135px minmax(0, 1fr); gap: 22px; margin-top: 22px; padding-top: 21px; border-top: 1px solid #f0ede7; }
.portrait-current { height: 150px; overflow: hidden; border-radius: 5px; border: 1px solid #e3ddcf; background: #f4f0e7; }
.portrait-current img { width: 100%; height: 100%; object-fit: cover; }
.portrait-current .portrait-placeholder { min-height: 150px; }
.portrait-current .portrait-placeholder span { font-size: 34px; }
.portrait-fields { display: grid; align-content: start; gap: 15px; }
.check-line { display: flex; gap: 8px; align-items: start; color: #7a8185; font-size: 11px; font-weight: 400; }
.check-line input { margin-top: 3px; accent-color: var(--navy); }
.repeatable-list { display: grid; gap: 15px; }
.repeatable-card { padding: 18px 20px 20px; border: 1px solid #e6e0d4; border-radius: 5px; background: #fcfbf8; }
.repeatable-card-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: -2px 0 15px; }
.repeatable-index { color: #a18146; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.remove-row { padding: 3px 0 3px 8px; background: transparent; border: 0; color: #a16b64; font-size: 11px; }
.remove-row:hover { text-decoration: underline; color: #783b35; }

.profile-detail-sort-controls { display: inline-flex; align-items: center; gap: 5px; }
.profile-detail-sort-controls button { display: inline-grid; place-items: center; min-width: 29px; height: 29px; padding: 0 7px; border: 1px solid #ded7ca; border-radius: 4px; background: #fff; color: #5b6267; font: 600 13px/1 var(--sans); cursor: pointer; }
.profile-detail-sort-controls button:hover { border-color: #bda477; background: #faf6ed; color: #856638; }
.profile-detail-sort-controls .profile-detail-drag-handle { cursor: grab; font-size: 18px; letter-spacing: -3px; padding: 0 8px 2px 5px; }
.profile-detail-sort-controls .profile-detail-drag-handle:active { cursor: grabbing; }
.profile-detail-sort-controls .remove-row { display: inline-block; min-width: 0; height: auto; margin-left: 4px; padding: 3px 0 3px 8px; border: 0; border-radius: 0; background: transparent; color: #a16b64; font: 400 11px/1.4 var(--sans); }
.profile-detail-row { transition: opacity .12s ease, border-color .12s ease, box-shadow .12s ease; }
.profile-detail-row.is-dragging { opacity: .48; border-style: dashed; border-color: #a18146; box-shadow: 0 5px 16px rgba(48, 42, 31, .08); }
.profile-detail-sort-help { margin: 10px 0 13px; font-size: 11px; }

.section-repeatable .field + .field { margin-top: 13px; }
.compact-repeatables .editor-fields { gap: 14px 17px; }
.publish-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.radio-card { display: flex; align-items: start; gap: 11px; min-height: 80px; padding: 16px; border: 1px solid #e2ddd2; border-radius: 5px; background: #fcfbf8; cursor: pointer; }
.radio-card:has(input:checked) { border-color: #c7ad7d; background: #fbf7ee; box-shadow: inset 0 0 0 1px #e6d7b8; }
.radio-card input { margin-top: 4px; accent-color: var(--navy); }
.radio-card strong, .radio-card small { display: block; }
.radio-card strong { color: #394650; font-size: 12px; }
.radio-card small { margin-top: 4px; color: #81888c; font-size: 10px; line-height: 1.6; }
.editor-submit-bar { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 18px 21px; border: 1px solid var(--line); background: #f1eee6; border-radius: 6px; }
.editor-submit-bar .muted { font-size: 11px; }
.editor-submit-bar > div { display: flex; gap: 8px; }

@media (max-width: 1000px) {
    .character-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .profile-layout { grid-template-columns: minmax(0, 1fr) 290px; gap: 22px; }
    .profile-article { padding: 25px 24px 20px; }
    .dossier-portrait { height: 245px; }
    .portrait-large { min-height: 245px; }
    .intro-art { right: -30px; opacity: .65; }
}
@media (max-width: 760px) {
    .header-inner { min-height: 70px; padding: 12px 18px; align-items: flex-start; flex-direction: column; gap: 11px; }
    .brand-sigil { width: 31px; height: 31px; font-size: 18px; }
    .brand-name { font-size: 21px; }
    .top-nav { flex-wrap: wrap; gap: 13px 18px; width: 100%; }
    .nav-user { padding-left: 0; border: 0; }
    .site-main { padding: 20px 16px 33px; }
    .footer-inner { padding: 17px 16px; flex-direction: column; gap: 3px; }
    .archive-intro { min-height: 230px; padding: 30px 25px; }
    .intro-art { right: -105px; opacity: .33; }
    .archive-intro h1 { max-width: 480px; font-size: 33px; }
    .archive-intro p { max-width: 460px; font-size: 13px; }
    .archive-toolbar { align-items: stretch; flex-direction: column; margin-top: 30px; }
    .toolbar-actions { justify-content: stretch; flex-wrap: wrap; }
    .search-form { width: 100%; flex: 1 1 100%; }
    .toolbar-actions > .button { width: 100%; }
    .character-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
    .card-portrait { height: 180px; }
    .card-content { padding: 14px 13px 12px; }
    .card-content h3 { font-size: 21px; }
    .card-footer { align-items: flex-start; flex-direction: column; gap: 5px; }
    .breadcrumb { margin-bottom: 18px; flex-wrap: wrap; }
    .profile-heading { align-items: flex-start; flex-direction: column; }
    .profile-actions { width: 100%; }
    .profile-layout { grid-template-columns: 1fr; }
    .profile-sidebar { grid-row: 1; min-height: 0; }
    .profile-section-nav { position: static; max-height: none; overflow: visible; }
    .dossier-card { max-width: 500px; }
    .dossier-portrait { height: 300px; }
    .portrait-large { min-height: 300px; }
    .profile-article { padding: 21px 19px 17px; }
    .contents-box ol { columns: 1; }
    .article-section h2 { font-size: 25px; }
    .prose { font-size: 15px; }
    .editor-heading { align-items: flex-start; }
    .editor-heading > .button { padding: 8px 10px; }
    .editor-section { padding: 21px 17px 23px; }
    .editor-section-head { gap: 11px; }
    .editor-step { flex-basis: 33px; width: 33px; height: 33px; font-size: 12px; }
    .editor-section-head h2 { font-size: 21px; }
    .editor-fields { gap: 14px; }
    .portrait-editor { grid-template-columns: 100px minmax(0, 1fr); gap: 13px; }
    .portrait-current { height: 130px; }
    .publish-options { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .character-grid { grid-template-columns: 1fr; }
    .card-portrait { height: 235px; }
    .archive-intro { padding: 28px 21px; }
    .archive-intro h1 { font-size: 30px; }
    .intro-art { right: -145px; }
    .profile-heading h1 { font-size: 36px; }
    .profile-actions .button { flex: 1; }
    .dossier-portrait { height: 250px; }
    .portrait-large { min-height: 250px; }
    .feature-quote { padding: 20px 17px 18px 20px; }
    .feature-quote blockquote { font-size: 18px; }
    .editor-fields { grid-template-columns: 1fr; }
    .field-span-2 { grid-column: auto; }
    .portrait-editor { grid-template-columns: 1fr; }
    .portrait-current { width: 140px; height: 155px; }
    .repeatable-card { padding: 15px 13px 17px; }
    .profile-detail-sort-controls { gap: 4px; }
    .profile-detail-sort-controls button { min-width: 28px; height: 28px; }
    .profile-detail-row .repeatable-card-head { align-items: flex-start; }
    .editor-submit-bar { align-items: stretch; flex-direction: column; }
    .editor-submit-bar > div { display: grid; grid-template-columns: 1fr 1fr; }
    .auth-wrap { padding-top: 15px; }
    .auth-panel { padding: 27px 22px; }
}


/* Administrator appearance settings */
.brand-logo { display: block; max-width: 190px; max-height: 47px; width: auto; height: auto; object-fit: contain; }
.settings-form { display: grid; gap: 20px; }
.settings-success { color: #2f5e45; background: #edf6ef; border: 1px solid #c5dfcb; }
.settings-asset-row { display: grid; grid-template-columns: minmax(160px, 240px) minmax(0, 1fr); gap: 20px; align-items: center; padding-top: 7px; }
.settings-asset-preview { display: flex; align-items: center; justify-content: center; gap: 8px; overflow: hidden; padding: 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); color: var(--muted); font-size: 11px; text-align: center; }
.settings-logo-preview { min-height: 104px; }
.settings-logo-preview img { max-width: 100%; max-height: 78px; width: auto; height: auto; object-fit: contain; }
.settings-background-preview { height: 120px; }
.settings-background-preview img { width: 100%; height: 100%; object-fit: cover; }
.preview-sigil { color: var(--gold-deep); font: 35px/1 var(--serif); }
.settings-asset-controls { display: grid; align-content: center; justify-items: start; gap: 9px; min-width: 0; }
.settings-asset-controls input[type="file"] { width: 100%; max-width: 430px; }
.settings-asset-controls small { color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.6; }
.settings-color-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 22px; }
.color-input-row { display: flex; align-items: center; gap: 12px; min-height: 40px; }
.field input[type="color"] { width: 52px; height: 38px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--white); cursor: pointer; }
.color-input-row code { color: var(--ink-soft); font-size: 12px; }
.settings-submit-bar { margin-top: 2px; }
.settings-submit-bar strong { display: block; margin-bottom: 2px; color: var(--ink); font-size: 13px; }

@media (max-width: 1000px) {
    .settings-color-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .settings-asset-row { grid-template-columns: 1fr; gap: 12px; }
    .settings-asset-preview { max-width: 100%; }
    .settings-color-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
}
@media (max-width: 480px) {
    .settings-color-grid { grid-template-columns: 1fr; }
    .settings-submit-bar > div:first-child { width: 100%; }
    .settings-submit-bar > div:last-child { display: grid; grid-template-columns: 1fr 1fr; }
}

/* Additional world areas, account tools, and file-based history */
.users-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.users-table th, .users-table td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.users-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.table-scroll { width: 100%; overflow-x: auto; }
.role-change-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.role-change-form select { min-height: 36px; max-width: 160px; border: 1px solid var(--line-strong); border-radius: 5px; padding: 6px 9px; background: var(--white); color: var(--ink); font: inherit; }
/* World-entry gallery summaries use the same safe rich-text renderer as profiles. */
.entry-summary-card { color: var(--ink-soft); font: 13px/1.65 var(--sans); min-height: 2.6em; max-height: 7.8em; overflow: hidden; overflow-wrap: anywhere; }
.entry-summary-card > :first-child { margin-top: 0; }
.entry-summary-card > :last-child { margin-bottom: 0; }
.entry-summary-card p { margin: 0 0 .45em; font: inherit; line-height: inherit; }
.entry-summary-card ul, .entry-summary-card ol { margin: .25em 0; padding-left: 1.35em; }
.entry-summary-card h2, .entry-summary-card h3, .entry-summary-card h4 { margin: .3em 0 .2em; color: var(--ink); font: 600 1em/1.35 var(--sans); }
.entry-summary-card blockquote { margin: .35em 0; padding-left: .75em; border-left: 2px solid var(--line); color: var(--muted); }
.entry-summary-card a { color: var(--gold-deep); text-decoration: underline; text-underline-offset: 2px; }
.world-entry-card-meta { min-height: 0; margin: 2px 0 8px; }
.world-entry-card-meta span { overflow-wrap: anywhere; }
.entry-summary-full { margin: 14px 0 26px; }
.history-list { display: grid; gap: 12px; margin-bottom: 36px; }
.history-version { border: 1px solid var(--line); background: var(--white); border-radius: 6px; overflow: hidden; }
.history-version > summary { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; cursor: pointer; list-style-position: inside; padding: 15px 18px; }
.history-action { display: inline-block; color: var(--ink); font-weight: 700; min-width: 85px; }
.history-meta { color: var(--muted); font-size: 12px; }
.history-snapshot { padding: 0 18px 18px; }
.history-snapshot > p { color: var(--muted); font-size: 12px; }
.history-snapshot pre { max-height: 600px; overflow: auto; padding: 15px; border-radius: 5px; background: var(--paper); border: 1px solid var(--line); color: var(--ink); font-size: 11px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 760px) {
    .users-table th, .users-table td { padding: 10px 8px; }
    .role-change-form { align-items: stretch; }
    .role-change-form select, .role-change-form .button { width: 100%; max-width: none; }
    .history-version > summary { padding: 13px; gap: 8px; }
    .history-snapshot { padding: 0 13px 13px; }
}

/* Internal archive links, image library, hover previews, and portrait crop tool */
.archive-inline-link { color: var(--accent, #9b7538); font-weight: 600; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.archive-inline-link:hover, .archive-inline-link:focus { text-decoration-style: solid; }
.archive-inline-link.has-link-preview::after { content: " ⓘ"; font-size: .72em; opacity: .68; text-decoration: none; display: inline-block; }
.link-preview-popover { position: fixed; z-index: 9999; display: grid; grid-template-columns: 106px minmax(0, 1fr); gap: 13px; max-width: calc(100vw - 24px); padding: 12px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: var(--white); box-shadow: 0 14px 38px rgba(18, 28, 37, .22); pointer-events: none; }
.link-preview-popover[hidden] { display: none !important; }
.link-preview-popover.is-loading { opacity: .9; }
.link-preview-media { min-height: 78px; overflow: hidden; border-radius: 5px; background: var(--paper); }
.link-preview-media[hidden] { display: none !important; }
.link-preview-media img { display: block; width: 100%; height: 112px; object-fit: cover; }
.link-preview-copy { min-width: 0; align-self: center; }
.link-preview-title { margin-bottom: 3px; color: var(--ink); font: 600 16px/1.25 var(--serif); overflow-wrap: anywhere; }
.link-preview-subtitle { margin-bottom: 6px; color: var(--accent, #9b7538); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.link-preview-description { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.link-format-help { margin: 0 0 20px; padding: 16px 19px; border: 1px solid var(--line); border-left: 3px solid var(--accent, #b68c48); background: var(--paper); color: var(--ink-soft); border-radius: 5px; font-size: 12px; line-height: 1.7; }
.link-format-help strong { color: var(--ink); font-size: 13px; }
.link-format-help p { margin: 5px 0 0; }
.link-format-help code, .link-syntax-list code { padding: 2px 4px; color: var(--ink); background: #ebe6da; border-radius: 3px; white-space: normal; overflow-wrap: anywhere; }
.portrait-cropper { margin-top: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 6px; background: #f8f6f1; }
.portrait-cropper[hidden] { display: none !important; }
.cropper-intro strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 13px; }
.cropper-intro p { margin: 0 0 11px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.crop-stage { position: relative; width: 100%; max-width: 620px; height: 300px; overflow: hidden; border: 1px solid #c9c2b4; border-radius: 4px; background: #242a30; touch-action: none; }
.crop-stage > img { position: absolute; display: block; max-width: none; max-height: none; object-fit: fill; user-select: none; pointer-events: none; }
.crop-selection { position: absolute; z-index: 2; box-sizing: border-box; border: 2px solid #fff; outline: 1px solid rgba(20, 25, 30, .9); box-shadow: 0 0 0 9999px rgba(10, 15, 20, .48); cursor: move; touch-action: none; }
.crop-selection::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to right, transparent 33%, rgba(255,255,255,.42) 33.2%, transparent 33.8%, transparent 66%, rgba(255,255,255,.42) 66.2%, transparent 66.8%), linear-gradient(to bottom, transparent 33%, rgba(255,255,255,.42) 33.2%, transparent 33.8%, transparent 66%, rgba(255,255,255,.42) 66.2%, transparent 66.8%); pointer-events: none; }
.crop-controls { display: flex; align-items: end; gap: 12px; margin-top: 11px; }
.crop-controls .field { flex: 1; }
.crop-controls input[type="range"] { width: 100%; }
.crop-status { min-height: 1.2em; margin: 8px 0 0; font-size: 10px; }
.media-upload-section { margin-bottom: 32px; }
.media-form { gap: 17px; }
.media-current-image { display: flex; align-items: center; gap: 15px; padding: 12px; border: 1px solid var(--line); background: var(--paper); border-radius: 5px; }
.media-current-image img { width: 100px; height: 100px; object-fit: contain; background: #fff; }
.media-current-image p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.section-heading-row { display: flex; align-items: end; justify-content: space-between; margin: 26px 0 16px; }
.section-heading-row h2 { margin: 0; font: 500 26px/1.25 var(--serif); }
.media-library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; margin-bottom: 30px; }
.media-library-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--white); }
.media-library-image { display: block; height: 190px; overflow: hidden; background: var(--paper); }
.media-library-image img { display: block; width: 100%; height: 100%; object-fit: contain; transition: transform .3s ease; }
.media-library-image:hover img { transform: scale(1.025); }
.media-library-card-body { display: grid; gap: 9px; padding: 14px; }
.media-card-topline { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.media-library-card h3 { margin: 0; font: 500 19px/1.25 var(--serif); overflow-wrap: anywhere; }
.media-library-card h3 a { color: var(--ink); text-decoration: none; }
.media-library-card p { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.6; }
.media-link-code { min-width: 0; margin: 2px 0 0; }
.media-link-code input { width: 100%; min-width: 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace !important; font-size: 10px !important; }
.media-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.media-card-actions .button { padding: 7px 9px; font-size: 10px; }
.media-owner { font-size: 10px; }
.link-syntax-section { margin: 20px 0 35px; }
.link-syntax-list { display: grid; gap: 10px; }
.link-syntax-list > div { display: grid; grid-template-columns: minmax(245px, .85fr) 1.5fr; align-items: start; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--ink-soft); }
.link-syntax-list code { overflow-wrap: anywhere; }
.link-syntax-section > p { margin-bottom: 0; font-size: 11px; line-height: 1.6; }
.media-detail-card { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--white); margin-bottom: 35px; }
.media-detail-image { display: block; max-width: 100%; max-height: 680px; margin: 0 auto; object-fit: contain; }
.media-detail-caption { display: flex; align-items: end; flex-wrap: wrap; gap: 14px; padding: 18px; border-top: 1px solid var(--line); }
.media-detail-caption .media-link-code { flex: 1 1 300px; }
.media-detail-caption .muted { flex-basis: 100%; margin: 0; font-size: 11px; }
.alert-success { margin: 0 0 19px; padding: 12px 15px; border: 1px solid #c7d9c7; border-radius: 5px; color: #245a35; background: #eef7ee; font-size: 12px; }

@media (max-width: 1000px) {
    .media-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .media-library-grid { grid-template-columns: 1fr; }
    .media-library-image { height: 230px; }
    .crop-stage { height: 245px; }
    .crop-controls { align-items: stretch; flex-direction: column; }
    .crop-controls .button { align-self: start; }
    .link-syntax-list > div { grid-template-columns: 1fr; gap: 6px; }
    .link-preview-popover { grid-template-columns: 82px minmax(0, 1fr); gap: 9px; padding: 9px; }
    .link-preview-media img { height: 96px; }
    .link-preview-title { font-size: 14px; }
}

.field input[type="range"] { padding: 0; border: 0; box-shadow: none; accent-color: var(--gold); }



/* Uploaded images embedded inside character and world-entry text */
.archive-inline-image-figure {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 18px auto 22px;
    padding: 0;
    text-align: center;
    clear: both;
}
.archive-inline-image-link {
    display: block;
    max-width: 100%;
    line-height: 0;
    border-radius: 5px;
}
.archive-inline-image {
    display: block;
    box-sizing: border-box;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 620px;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 5px;
}
.archive-inline-image-caption {
    max-width: 100%;
    margin: 7px 3px 0;
    color: var(--muted);
    font-family: var(--sans, Arial, sans-serif);
    font-size: 11px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.media-inline-unavailable {
    color: var(--muted);
    font-size: .9em;
    font-style: italic;
}
.prose { min-width: 0; }

/* Administrator-only MediaWiki importer */
.wiki-import-preview, .wiki-import-source { margin-bottom: 22px; }
.wiki-import-form { margin-bottom: 24px; }
.wiki-import-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: -5px 0 22px; color: var(--muted); font-size: 12px; }
.wiki-import-warnings { margin: 20px 0; padding: 17px 20px; color: #6d5426; background: #fbf6e9; border: 1px solid #eadbb7; border-radius: 5px; font-size: 12px; }
.wiki-import-warnings h3 { margin: 0 0 9px; font: 600 16px/1.3 var(--serif); }
.wiki-import-warnings ul { margin: 0; padding-left: 20px; }
.wiki-import-warnings li + li { margin-top: 5px; }
.wiki-import-result { border-top: 1px solid var(--line); padding-top: 23px; margin-top: 24px; }
.wiki-import-result h3 { margin: 18px 0 10px; font: 500 20px/1.3 var(--serif); }
.wiki-import-sections-preview { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.wiki-import-sections-preview article { display: grid; grid-template-columns: 35px minmax(0, 1fr); gap: 13px; padding: 13px 16px; background: #fff; }
.wiki-import-sections-preview article + article { border-top: 1px solid var(--line); }
.wiki-import-section-number { color: #a18146; font: 600 12px/1.5 var(--serif); }
.wiki-import-sections-preview h4 { margin: 0 0 4px; color: var(--ink); font-size: 12px; }
.wiki-import-sections-preview p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.wiki-import-source textarea, .wiki-import-form textarea { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.5; }
.imported-inline-image { display: block; max-width: min(100%, 720px); max-height: 620px; height: auto; object-fit: contain; margin: 16px auto; border-radius: 4px; }
@media (max-width: 680px) {
    .wiki-import-sections-preview article { padding: 12px; }
    .wiki-import-status { align-items: flex-start; flex-direction: column; gap: 7px; }
}

/* Account security and administration tools */
.button-danger {
    background: var(--red, #9b3f35);
    border-color: var(--red, #9b3f35);
    color: #fff;
}
.button-danger:hover { filter: brightness(.95); }
.button-small { min-height: 31px; padding: 6px 10px; font-size: 12px; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.registration-status { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface, #fff); }
.admin-users-table { min-width: 1020px; }
.admin-users-table td { vertical-align: top; }
.compact-admin-form { display: flex; flex-wrap: wrap; align-items: end; gap: 6px; margin-top: 8px; }
.compact-admin-form select, .compact-admin-form input { max-width: 100%; }
.compact-admin-form .field { min-width: 155px; margin: 0; }
.compact-admin-form .field span { font-size: 12px; }
.admin-password-reset summary { cursor: pointer; color: var(--accent, #8d672b); font-weight: 700; min-width: 145px; }
.password-reset-form { display: grid; gap: 9px; min-width: 230px; padding: 12px 0 4px; }
.password-reset-form small { color: var(--muted); }
.status-active { background: #e3f4e8; color: #235f36; }
.status-disabled { background: #fbe7e5; color: #8b3028; }
.mfa-recovery-codes { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 8px; margin: 16px 0; }
.mfa-recovery-codes code { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface, #fff); font-size: 14px; text-align: center; letter-spacing: .05em; }
.ownership-search { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.ownership-search .field { flex: 1 1 320px; margin: 0; }
.ownership-change-form { display: flex; align-items: center; gap: 7px; min-width: 260px; }
.ownership-change-form select { flex: 1; min-width: 130px; max-width: 100%; }
@media (max-width: 680px) {
    .registration-status { align-items: stretch; }
    .registration-status form, .registration-status .button { width: 100%; }
    .ownership-change-form { min-width: 230px; }
}

/* Built-in rich-text editor (self-hosted; compatible with the site's restrictive CSP). */
.rich-editor-source-hidden { display: none !important; }
.rich-editor { width: 100%; min-width: 0; border: 1px solid #d9d6cf; border-radius: 5px; overflow: hidden; background: #fff; color: var(--ink); font-size: 13px; font-weight: 400; }
.rich-editor-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 7px; border-bottom: 1px solid #e3dfd5; background: #f6f4ee; }
.rich-editor-tool-group { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; padding-right: 5px; margin-right: 2px; border-right: 1px solid #ded9cd; }
.rich-editor-tool-group:last-child { padding-right: 0; margin-right: 0; border-right: 0; }
.rich-editor-tool { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; min-height: 29px; padding: 5px 7px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: #37424b; font: 600 11px/1.2 inherit; cursor: pointer; }
.rich-editor-tool:hover { border-color: #d5c6a8; background: #fff; color: #805f2e; }
.rich-editor-tool.is-active, .rich-editor-tool[aria-pressed="true"] { border-color: #b89a68; background: #e9dfcc; color: #61491f; box-shadow: inset 0 2px 4px rgba(68, 49, 18, .22); transform: translateY(1px); }
.rich-editor-tool.is-active:hover, .rich-editor-tool[aria-pressed="true"]:hover { border-color: #a78a58; background: #e1d3b7; color: #503a16; }
.rich-editor-tool:focus-visible { outline: 2px solid #9c793f; outline-offset: 1px; }
.rich-editor-tool.tool-undo { white-space: nowrap; }
.rich-editor-tool.tool-bold { font-weight: 900; }
.rich-editor-tool.tool-italic { font-style: italic; }
.rich-editor-tool.tool-underline { text-decoration: underline; }
.rich-editor-tool.tool-strike { text-decoration: line-through; }
.rich-editor-canvas { min-height: 145px; padding: 13px 14px; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 14px; font-weight: 400; line-height: 1.7; color: #303b44; outline: 0; cursor: text; }
.rich-editor-canvas:focus { box-shadow: inset 0 0 0 2px rgba(182, 140, 72, .19); }
.rich-editor-canvas:empty::before { content: 'Hier Text eingeben und über die Werkzeugleiste formatieren …'; color: #a1a4a5; pointer-events: none; }
.rich-editor-canvas p, .rich-editor-canvas div { margin: 0 0 .75em; }
.rich-editor-canvas p:last-child, .rich-editor-canvas div:last-child { margin-bottom: 0; }
.rich-editor-canvas h2, .rich-editor-preview-content h2 { margin: 1em 0 .45em; font: 600 1.35em/1.3 var(--serif); }
.rich-editor-canvas h3, .rich-editor-preview-content h3 { margin: .9em 0 .4em; font: 600 1.15em/1.35 var(--serif); }
.rich-editor-canvas blockquote, .rich-editor-preview-content blockquote { margin: .7em 0; padding: .5em .9em; border-left: 3px solid var(--gold); background: #f8f5ee; }
.rich-editor-canvas ul, .rich-editor-canvas ol, .rich-editor-preview-content ul, .rich-editor-preview-content ol { padding-left: 1.7em; margin: .5em 0 .8em; }
.rich-editor-canvas a, .rich-editor-preview-content a { color: #8d6a31; text-decoration: underline; text-underline-offset: 2px; }
.rich-editor-source-view { display: block; width: 100%; min-width: 0; min-height: 190px; padding: 13px 14px; border: 0; border-radius: 0; resize: vertical; background: #fbfaf7; color: #343a40; font: 12px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; outline: 0; }
.rich-editor-source-view:focus { box-shadow: inset 0 0 0 2px rgba(182, 140, 72, .19); }
.rich-editor-preview { padding: 13px 14px 16px; border-top: 1px solid #e5e0d5; background: #fdfcf9; }
.rich-editor-preview[hidden], .rich-editor-canvas[hidden], .rich-editor-source-view[hidden] { display: none !important; }
.rich-editor-preview-heading { margin-bottom: 5px; color: #94733e; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.rich-editor-preview-status { margin: 0 0 10px; color: #888b8c; font-size: 11px; font-weight: 400; }
.rich-editor-preview-content { min-width: 0; padding: 14px; border: 1px solid #ebe6dc; border-radius: 4px; background: #fff; color: #48535c; font-size: 15px; line-height: 1.8; font-weight: 400; overflow-wrap: anywhere; }
.rich-editor-preview-content:empty { display: none; }
.profile-deck > p { margin: 0; }
.profile-deck > p + p { margin-top: .35em; }
.rich-align-left { text-align: left; }
.rich-align-center { text-align: center; }
.rich-align-right { text-align: right; }
.rich-align-justify { text-align: justify; }
.prose > div { margin: 0 0 .8em; }
.prose > div:last-child { margin-bottom: 0; }
.prose h2 { margin: 1em 0 .45em; font: 600 1.35em/1.3 var(--serif); }
.prose h3 { margin: .9em 0 .4em; font: 600 1.15em/1.35 var(--serif); }
@media (max-width: 720px) {
    .rich-editor-toolbar { gap: 4px; padding: 6px; }
    .rich-editor-tool-group { padding-right: 3px; margin-right: 1px; }
    .rich-editor-tool { min-width: 28px; min-height: 29px; padding: 5px; }
    .rich-editor-canvas { min-height: 135px; padding: 11px; }
    .rich-editor-preview-content { padding: 10px; }
}
.rich-editor-tool:disabled { opacity: .38; cursor: not-allowed; }
.rich-editor-tool:disabled:hover { border-color: transparent; background: transparent; color: #37424b; }

/* Chronicle Archive enhancements: dashboard, search filters, relations and media usage */
.dashboard-welcome { margin: 28px 0 38px; padding: 24px; border: 1px solid var(--line); border-radius: 9px; background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(243,234,217,.58)); box-shadow: 0 10px 28px rgba(25,34,43,.045); }
.dashboard-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.dashboard-heading h2 { margin: 0 0 8px; font: 600 clamp(1.5rem, 2.3vw, 2rem)/1.2 var(--serif); }
.dashboard-heading p { max-width: 680px; margin: 0; color: var(--muted); }
.dashboard-quick-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.dashboard-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin: 20px 0; }
.dashboard-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.86); text-decoration: none; color: var(--ink); }
.dashboard-stat:hover { border-color: var(--line-strong); background: #fff; text-decoration: none; }
.dashboard-stat > span { color: var(--muted); font-size: 12px; font-weight: 650; }
.dashboard-stat > strong { color: var(--navy); font: 600 1.8rem/1.2 var(--serif); }
.dashboard-stat > small { margin-top: 4px; color: var(--gold-deep); font-size: 11px; }
.dashboard-columns { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,.8fr); gap: 16px; margin-top: 18px; }
.dashboard-panel { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.88); }
.dashboard-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.dashboard-panel-heading .section-kicker { margin-bottom: 3px; }
.dashboard-panel-heading h3 { margin: 0; font: 600 1.25rem/1.25 var(--serif); }
.dashboard-panel-heading > a { font-size: 12px; font-weight: 700; white-space: nowrap; }
.dashboard-recent-list, .dashboard-favorite-list { list-style: none; margin: 0; padding: 0; }
.dashboard-recent-list li { display: grid; grid-template-columns: 82px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #eee9df; }
.dashboard-recent-list li:first-child, .dashboard-favorite-list li:first-child { border-top: 0; }
.dashboard-recent-list a, .dashboard-favorite-list a { font-weight: 650; overflow-wrap: anywhere; }
.dashboard-recent-list time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.dashboard-type-mark { color: var(--gold-deep); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.dashboard-favorite-list li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid #eee9df; }
.dashboard-favorite-list li > div { min-width: 0; display: flex; flex-direction: column; }
.dashboard-favorite-list small { color: var(--muted); font-size: 11px; }
.favorite-star { color: var(--gold-deep); font-size: 17px; line-height: 1.2; }
.search-filter-form .editor-fields { grid-template-columns: repeat(4,minmax(0,1fr)); }
.search-filter-form .field-span-2 { grid-column: span 2; }
.search-filter-note { margin: 8px 0 0; font-size: 12px; }
.search-results-list { margin: 24px 0; }
.search-results-list > h2 { display: flex; align-items: center; gap: 10px; font: 600 1.35rem/1.25 var(--serif); }
.search-result-card { display: grid; grid-template-columns: 96px minmax(0,1fr) auto; gap: 18px; align-items: start; margin: 10px 0; padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.search-result-type { color: var(--gold-deep); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.search-result-copy { min-width: 0; }
.search-result-copy h3 { margin: 0 0 4px; font: 600 1.25rem/1.25 var(--serif); }
.search-result-copy p { margin: 5px 0; overflow-wrap: anywhere; }
.search-result-meta { font-size: 11px; }
.search-result-actions { display: flex; align-items: flex-end; flex-direction: column; gap: 7px; }
.search-result-actions .favorite-toggle-form { margin: 0; }
.media-library-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; padding: 16px; margin: 15px 0 20px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.7); }
.media-library-filters .field { flex: 1 1 280px; margin: 0; }
.media-filter-actions { display: flex; gap: 8px; }
.media-usage-info { margin: 12px 0; padding: 10px 12px; border: 1px solid #e7dfcf; border-radius: 5px; background: #faf7f0; font-size: 12px; overflow-wrap: anywhere; }
.media-usage-info strong { display: block; color: var(--green); font-size: 11px; }
.media-usage-none strong { color: var(--muted); }
.media-usage-info ul { margin: 7px 0 0; padding-left: 17px; }
.media-usage-info li { margin: 3px 0; }
.media-usage-info li span { display: block; color: var(--muted); font-size: 10px; }
.archive-relations-section { margin-top: 30px; }
.archive-relations-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.archive-relation-card { min-width: 0; padding: 15px 17px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.78); }
.archive-relation-card h3 { margin: 4px 0; font: 600 1.12rem/1.3 var(--serif); overflow-wrap: anywhere; }
.archive-relation-type { color: var(--gold-deep); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.relationship-role { margin: 4px 0; font-weight: 650; }
.relationship-notes { color: var(--ink-soft); font-size: 13px; }
.link-check-issue { color: var(--red); }
.status-tag.status-warning { display: inline-block; padding: 3px 7px; border-radius: 4px; background: var(--red-pale); color: var(--red); font-size: 11px; font-weight: 700; }
@media (max-width: 900px) {
  .dashboard-heading { flex-direction: column; }
  .dashboard-quick-actions { justify-content: flex-start; }
  .dashboard-columns { grid-template-columns: 1fr; }
  .search-filter-form .editor-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .search-result-card { grid-template-columns: 1fr; gap: 8px; }
  .search-result-actions { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 620px) {
  .dashboard-welcome { padding: 16px; }
  .dashboard-stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-recent-list li { grid-template-columns: 1fr auto; gap: 4px 10px; }
  .dashboard-type-mark { grid-column: 1 / -1; }
  .dashboard-recent-list li time { grid-column: 2; grid-row: 2; }
  .search-filter-form .editor-fields { grid-template-columns: 1fr; }
  .search-filter-form .field-span-2 { grid-column: auto; }
  .archive-relations-list { grid-template-columns: 1fr; }
  .media-library-filters { align-items: stretch; flex-direction: column; }
  .media-filter-actions { flex-wrap: wrap; }
}


/* Split homepage dashboard from the character directory */
.dashboard-guest { margin: 30px 0 42px; padding: 24px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.78); box-shadow: 0 10px 28px rgba(25,34,43,.045); }
.dashboard-guest-intro { max-width: 760px; margin-bottom: 22px; }
.dashboard-guest-intro h2 { margin: 0 0 10px; font: 600 clamp(1.5rem, 2.3vw, 2rem)/1.2 var(--serif); }
.dashboard-guest-intro p { max-width: 680px; margin: 0; color: var(--muted); line-height: 1.75; }
.dashboard-guest-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.dashboard-guest-card { display: flex; min-width: 0; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.9); color: var(--ink); text-decoration: none; }
.dashboard-guest-card:hover { border-color: var(--line-strong); background: #fff; text-decoration: none; transform: translateY(-1px); }
.dashboard-guest-icon { color: var(--gold-deep); font-size: 25px; line-height: 1; }
.dashboard-guest-card strong { color: var(--navy); font: 600 1.15rem/1.25 var(--serif); }
.dashboard-guest-card > span:last-child { color: var(--muted); font-size: 12px; line-height: 1.6; }
.dashboard-guest-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 22px; }
@media (max-width: 900px) { .dashboard-guest-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 620px) { .dashboard-guest { padding: 16px; } .dashboard-guest-grid { grid-template-columns: 1fr; } }

/* Chronicle Archive: IG player details administration page */
.ig-player-heading { align-items: center; }
.ig-player-heading > div { min-width: 0; }
.ig-player-message { border-color: #d6c49e; background: #fffaf0; }
.ig-player-message h2 { margin: 0 0 9px; font: 500 22px/1.3 var(--serif); }
.ig-player-message p { margin: 8px 0; }
.ig-player-message code { padding: 2px 5px; background: rgba(23,36,50,.06); border-radius: 3px; overflow-wrap: anywhere; }
.ig-player-message-warning { border-left: 4px solid var(--gold); }
.ig-player-stat-grid { margin-bottom: 22px; }
.ig-player-controls { margin-bottom: 24px; }
.ig-player-filter-grid { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(300px, .9fr); gap: 18px; align-items: end; }
.ig-player-filter-grid .field { margin: 0; }
.ig-player-period-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.ig-player-period-form .field { flex: 1 1 190px; }
.ig-player-period-form .button { flex: 0 0 auto; }
.ig-player-count-note { margin: 12px 0 0; font-size: 12px; }
.ig-player-table-scroll { max-height: 72vh; overflow: auto; border: 1px solid var(--line); border-radius: 5px; background: var(--white); }
.ig-player-table { width: 100%; min-width: 1350px; border-collapse: separate; border-spacing: 0; background: var(--white); color: var(--ink); font-size: 12px; line-height: 1.5; }
.ig-player-table th, .ig-player-table td { padding: 10px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.ig-player-table th { position: sticky; top: 0; z-index: 2; background: var(--paper-deep); color: var(--ink); font-size: 10px; font-weight: 800; letter-spacing: .035em; }
.ig-player-table th.ig-sorted { background: var(--gold-pale); box-shadow: inset 0 -2px 0 var(--gold); }
.ig-player-table tbody tr:nth-child(even) { background: #fcfbf8; }
.ig-player-table tbody tr:hover { background: #f6f0e4; }
.ig-player-table tbody tr[hidden] { display: none; }
.ig-player-table td { max-width: 280px; overflow-wrap: anywhere; }
.ig-player-table td:first-child { width: 50px; color: var(--muted); text-align: right; }
.ig-player-table td:nth-child(2), .ig-player-table td:nth-child(3) { min-width: 125px; }
.ig-player-table td:nth-child(4) { min-width: 150px; }
.ig-player-table td:nth-child(6) { min-width: 220px; }
.ig-player-table a { font-weight: 700; text-decoration: none; }
.ig-sort-button { display: inline-flex; align-items: center; gap: 7px; padding: 2px 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: inherit; letter-spacing: inherit; text-align: left; cursor: pointer; }
.ig-sort-button span { color: var(--gold-deep); font-size: 13px; }
.ig-sort-button:hover { color: var(--gold-deep); }
.ig-sort-button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
@media (max-width: 820px) {
    .ig-player-filter-grid { grid-template-columns: 1fr; }
    .ig-player-period-form { align-items: stretch; flex-direction: column; }
    .ig-player-period-form .field { flex-basis: auto; }
    .ig-player-period-form .button { width: 100%; }
    .ig-player-table-scroll { max-height: 68vh; }
}


/* Character street voices: in-world remarks contributed by other player characters. */
.street-voices-intro { margin: -3px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.street-voices-list { display: grid; gap: 14px; }
.street-voice-card { min-width: 0; padding: 17px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.street-voice-heading { display: flex; align-items: center; gap: 10px; }
.street-voice-sigil { flex: 0 0 auto; color: var(--gold); font: 38px/.8 var(--serif); }
.street-voice-attribution { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px; min-width: 0; flex: 1; color: var(--ink); font: 600 16px/1.4 var(--serif); }
.street-voice-attribution a { color: var(--ink); text-decoration: none; }
.street-voice-attribution a:hover { color: var(--gold-deep); text-decoration: underline; }
.street-voice-attribution span { color: var(--muted); font: 11px/1.4 var(--sans); }
.street-voice-history { flex: 0 0 auto; color: var(--muted); font-size: 11px; text-decoration: none; }
.street-voice-history:hover { color: var(--gold-deep); text-decoration: underline; }
.street-voice-statement { margin: 12px 0 0; color: var(--ink-soft); font: 15px/1.75 var(--serif); overflow-wrap: anywhere; }
.street-voice-statement > :first-child { margin-top: 0; }
.street-voice-statement > :last-child { margin-bottom: 0; }
.street-voice-meta { margin-top: 10px; color: var(--muted); font-size: 10px; }
.street-voice-edit { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.street-voice-edit summary { color: var(--muted); cursor: pointer; font-size: 11px; }
.street-voice-create { margin-top: 22px; padding: 18px; background: var(--white); border: 1px solid var(--line); border-radius: 6px; }
.street-voice-create h3 { margin: 0 0 6px; font: 500 20px/1.3 var(--serif); }
.street-voice-create > p { margin: 0 0 15px; }
.street-voice-manage-form { display: grid; gap: 12px; margin-top: 12px; }
.street-voice-manage-form .field { display: grid; gap: 7px; }
.street-voice-manage-form .field > span { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.street-voice-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.street-voices-no-character, .street-voices-login { margin-top: 18px; }
.street-voice-admin-section { margin-top: 24px; }
.street-voice-admin-list { display: grid; gap: 16px; }
.street-voice-admin-card { padding: 17px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.street-voice-admin-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.street-voice-admin-heading h3 { margin: 0 0 4px; font: 500 19px/1.3 var(--serif); }
.street-voice-admin-heading p { margin: 0; }
@media (max-width: 640px) {
    .street-voice-card, .street-voice-create, .street-voice-admin-card { padding: 14px; }
    .street-voice-heading { align-items: start; }
    .street-voice-admin-heading { display: grid; }
    .street-voice-actions .button { flex: 1 1 auto; }
}
/* Keep disabled street-voice save buttons visibly inactive until an edit is made. */
.button:disabled,
.button[disabled] { opacity: .42; cursor: not-allowed; transform: none; filter: grayscale(.25); box-shadow: none; }
.button:disabled:hover,
.button[disabled]:hover { transform: none; }

/* Inline editing of individual profile segments. */
.segment-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 0 0 12px;
}
.segment-heading-row > h2,
.segment-heading-row > h3 {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
}
.segment-heading-row-compact { margin-bottom: 4px; }
.inline-segment-edit {
    flex: 0 0 auto;
    margin-left: auto;
    color: var(--muted);
    font-size: 11px;
}
.inline-segment-edit > summary {
    display: inline-block;
    cursor: pointer;
    list-style: none;
    color: var(--muted);
    font: 600 11px/1.5 var(--sans);
    text-decoration: underline;
    text-decoration-color: #c9c1b2;
    text-underline-offset: 3px;
}
.inline-segment-edit > summary::-webkit-details-marker { display: none; }
.inline-segment-edit > summary:hover { color: var(--gold-deep); }
.inline-segment-edit[open] { flex: 1 0 100%; width: 100%; }
.inline-segment-edit-panel {
    display: grid;
    gap: 11px;
    width: 100%;
    margin: 10px 0 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #fcfbf8;
}
.inline-segment-edit-panel .field { display: grid; gap: 6px; }
.inline-segment-edit-panel .field > span { color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.inline-segment-edit-panel input,
.inline-segment-edit-panel select,
.inline-segment-edit-panel textarea {
    width: 100%;
    min-width: 0;
}
.inline-segment-actions { display: flex; justify-content: flex-end; margin-top: 2px; }
.inline-segment-actions .button { min-height: 34px; padding: 7px 12px; font-size: 11px; }
.quote-segment-edit { display: block; width: fit-content; margin: 10px 0 0 auto; }
.feature-quote .inline-segment-edit-panel { text-align: left; }
.relationship-copy .segment-heading-row { align-items: baseline; }
.track-row { flex-wrap: wrap; }
.track-segment-edit[open] { flex-basis: 100%; order: 4; }
.track-segment-edit .inline-segment-edit-panel { background: #fff; }
.ooc-card-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ooc-card-title .inline-segment-edit { font-size: 10px; }
.ooc-card .inline-segment-edit[open] { flex-basis: 100%; }
.street-voice-edit { margin-left: 0; }
.street-voice-edit[open] { width: 100%; }

@media (max-width: 640px) {
    .inline-segment-edit-panel { padding: 11px; }
    .segment-heading-row { gap: 6px 10px; }
}
.street-voice-heading .street-voice-edit { margin-top: 0; padding-top: 0; border-top: 0; }

/* Keep an expanded street-voice editor on its own row inside the card.
   The heading is a flex row; without wrapping, the open <details> element
   competes horizontally with the speaker attribution and can overflow. */
.street-voice-heading {
    flex-wrap: wrap;
}
.street-voice-heading > .street-voice-edit {
    min-width: 0;
}
.street-voice-heading > .street-voice-edit[open] {
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
}
.street-voice-heading > .street-voice-edit[open] > .street-voice-manage-form,
.street-voice-heading > .street-voice-edit[open] .field,
.street-voice-heading > .street-voice-edit[open] .rich-editor {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

/* Keep inline "Bearbeiten" controls beside their labels across the archive. */
.segment-heading-row {
    flex-wrap: nowrap;
}
.segment-heading-row > h2,
.segment-heading-row > h3 {
    flex: 1 1 0;
    min-width: 0;
    overflow-wrap: anywhere;
}
.segment-heading-row > .inline-segment-edit {
    flex: 0 0 auto;
    white-space: nowrap;
}
/* When an editor is open, allow its panel to occupy a full row below the heading. */
.segment-heading-row:has(> .inline-segment-edit[open]) {
    flex-wrap: wrap;
}
.segment-heading-row > .inline-segment-edit[open] {
    flex: 0 0 100%;
    width: 100%;
    white-space: normal;
}

/* Soundtrack edit action stays next to the track title until its form is opened. */
.track-row {
    flex-wrap: nowrap;
}
.track-row > .track-segment-edit:not([open]) {
    flex: 0 0 auto;
    white-space: nowrap;
}
.track-row:has(> .track-segment-edit[open]) {
    flex-wrap: wrap;
}
.track-row > .track-segment-edit[open] {
    flex: 0 0 100%;
    width: 100%;
    order: 4;
    white-space: normal;
}

/* Street voice attribution may wrap; its edit/history actions do not. */
.street-voice-heading {
    flex-wrap: nowrap;
}
.street-voice-attribution {
    flex: 1 1 0;
    min-width: 0;
    overflow-wrap: anywhere;
}
.street-voice-heading > .street-voice-history,
.street-voice-heading > .street-voice-edit:not([open]) {
    flex: 0 0 auto;
    white-space: nowrap;
}
.street-voice-heading:has(> .street-voice-edit[open]) {
    flex-wrap: wrap;
}

/* The OOC card title also keeps its edit action on the title line. */
.ooc-card-title {
    flex-wrap: nowrap;
}
.ooc-card-title > .inline-segment-edit:not([open]) {
    flex: 0 0 auto;
    margin-left: auto;
    white-space: nowrap;
}
.ooc-card-title:has(> .inline-segment-edit[open]) {
    flex-wrap: wrap;
}
.ooc-card-title > .inline-segment-edit[open] {
    flex: 0 0 100%;
    width: 100%;
    white-space: normal;
}


/* Inline editors: the native <details> now contains only its disclosure summary.
   The corresponding form is a sibling grid item, so opening it cannot move the
   summary/link out of the heading row. */
.segment-heading-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: start;
    gap: 8px 14px;
}
.segment-heading-row > h2,
.segment-heading-row > h3 { grid-column: 1; grid-row: 1; min-width: 0; }
.segment-heading-row > details.inline-segment-edit {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: start;
    flex: none;
    width: auto;
    margin: 0;
    white-space: nowrap;
}
.segment-heading-row > .inline-segment-edit-sibling {
    display: none;
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.segment-heading-row:has(> details.inline-segment-edit[open]) > .inline-segment-edit-sibling { display: grid; }

/* Soundtrack rows: keep the disclosure next to the title and expand only the form. */
.track-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "symbol copy edit open" "form form form form";
    grid-template-rows: auto auto;
    align-items: center;
    gap: 8px 13px;
}
.track-row > .track-symbol { grid-area: symbol; }
.track-row > .track-copy { grid-area: copy; min-width: 0; }
.track-row > .track-segment-edit { grid-area: edit; align-self: center; flex: none; width: auto; margin: 0; white-space: nowrap; }
.track-row > .track-open { grid-area: open; }
.track-row > .inline-segment-edit-sibling { display: none; grid-area: form; width: 100%; min-width: 0; box-sizing: border-box; }
.track-row:has(> .track-segment-edit[open]) > .inline-segment-edit-sibling { display: grid; }

/* Street voices: their editor form is now below the fixed attribution/action row. */
.street-voice-heading {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "sigil attribution history edit";
    align-items: start;
    gap: 10px;
}
.street-voice-heading > .street-voice-sigil { grid-area: sigil; }
.street-voice-heading > .street-voice-attribution { grid-area: attribution; min-width: 0; }
.street-voice-heading > .street-voice-history { grid-area: history; white-space: nowrap; }
.street-voice-heading > .street-voice-edit {
    grid-area: edit;
    align-self: start;
    justify-self: end;
    flex: none;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    white-space: nowrap;
}
.street-voice-card > .street-voice-manage-form { display: none; width: 100%; min-width: 0; box-sizing: border-box; }
.street-voice-card:has(> .street-voice-heading > .street-voice-edit[open]) > .street-voice-manage-form { display: grid; }

/* The OOC action stays in its title bar while the editor occupies the next row. */
.ooc-card-title {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto;
    align-items: center;
    gap: 8px;
}
.ooc-card-title > .inline-segment-edit {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    flex: none;
    width: auto;
    margin: 0;
    white-space: nowrap;
}
.ooc-card > .ooc-inline-edit-form { display: none; width: 100%; min-width: 0; box-sizing: border-box; }
.ooc-card:has(> .ooc-card-title > .inline-segment-edit[open]) > .ooc-inline-edit-form { display: grid; }

/* Other standalone disclosures (quote and world-entry summary) keep their
   action in place while the sibling editor is revealed underneath. */
.feature-quote > .quote-segment-edit { display: block; width: fit-content; margin: 10px 0 0 auto; }
.feature-quote > .inline-segment-edit-sibling { display: none; width: 100%; box-sizing: border-box; }
.feature-quote:has(> .quote-segment-edit[open]) > .inline-segment-edit-sibling { display: grid; }
.entry-summary-full > .inline-segment-edit-sibling { display: none; width: 100%; box-sizing: border-box; }
.entry-summary-full:has(> .inline-segment-edit[open]) > .inline-segment-edit-sibling { display: grid; }

@media (max-width: 640px) {
    .segment-heading-row { column-gap: 8px; }
    .track-row { column-gap: 8px; }
    .street-voice-heading { column-gap: 7px; }
}

/* Override the earlier open-state width rules: the summary-only <details>
   element must stay compact in its original grid column. */
.segment-heading-row > .inline-segment-edit[open],
.track-row > .track-segment-edit[open],
.street-voice-heading > .street-voice-edit[open],
.ooc-card-title > .inline-segment-edit[open] {
    flex: none !important;
    width: auto !important;
    min-width: 0;
    white-space: nowrap !important;
    margin: 0;
}

/* Parent groups for content sections (e.g. "Lebenslauf" > "Jugend"). */
.grouped-article-section > .section-group-title {
    margin: 0 0 5px;
}
.section-group-items {
    display: grid;
    gap: 0;
}
.grouped-section-child {
    min-width: 0;
    padding: 17px 0 0;
    margin-top: 15px;
    border-top: 1px solid #f0ede6;
    scroll-margin-top: 20px;
}
.grouped-section-child:first-child {
    padding-top: 0;
    margin-top: 0;
    border-top: 0;
}
.grouped-section-child .segment-heading-row {
    margin-bottom: 9px;
}
.grouped-section-child .segment-heading-row > h3 {
    color: var(--ink-soft);
    font: 600 18px/1.35 var(--serif);
}
.contents-box .contents-group > span {
    color: #606a70; /* Match the regular links in the table of contents. */
    font-weight: 400;
}
.contents-box .contents-sublist {
    columns: 1;
    list-style: none;
    margin: 3px 0 5px;
    padding: 0 0 0 12px;
}
.contents-box .contents-sublist li {
    margin: 2px 0;
    font-weight: 400;
}

/* User access administration */
.user-access-table-wrap {
    overflow-x: auto;
}
.user-access-table {
    min-width: 720px;
}
.user-access-table th,
.user-access-table td {
    vertical-align: middle;
}
.user-access-table td:first-child {
    min-width: 320px;
}
.user-access-table td:first-child small {
    display: block;
    margin-top: 5px;
    max-width: 520px;
    color: var(--muted, #777);
    line-height: 1.45;
}
.user-access-always,
.user-access-locked {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted, #777);
    font-size: .9rem;
    white-space: nowrap;
}
.user-access-always span {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(62, 128, 88, .12);
    color: #34734c;
    font-weight: 700;
}
.user-access-toggle {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 34px;
    color: var(--text, #333);
    font-size: .9rem;
    cursor: pointer;
    white-space: nowrap;
}
.user-access-toggle input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--color-primary, #80613e);
}
.user-access-notes {
    margin-top: 22px;
    padding: 16px 18px;
    border: 1px solid var(--border, rgba(120, 110, 95, .2));
    border-radius: 12px;
    background: var(--surface-soft, rgba(120, 110, 95, .045));
}
.user-access-notes p {
    margin: 5px 0;
    color: var(--muted, #777);
    line-height: 1.5;
}
.user-access-notes strong {
    color: var(--text, #333);
}
.readonly-field {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--border, rgba(120, 110, 95, .25));
    border-radius: 8px;
    background: var(--surface-soft, rgba(120, 110, 95, .045));
}


/* Persönlich sortierbare Favoritenliste */
.favorites-sortable-list { list-style: none; margin: 0; padding: 0; }
.favorites-sortable-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "order main actions";
    align-items: center;
    gap: 14px 22px;
    min-height: 112px;
    padding: 18px 22px;
}
.favorites-sortable-item.is-dragging { opacity: .48; border-style: dashed; }
.favorites-sortable-list.is-saving { cursor: progress; }
.favorites-order-controls {
    grid-area: order;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.favorites-item-main { grid-area: main; min-width: 0; display: grid; gap: 5px; }
.favorites-item-main .search-result-type { margin: 0 0 1px; }
.favorites-item-main .search-result-copy h3 { margin: 0 0 3px; font-size: 1.3rem; }
.favorites-item-main .search-result-copy p { margin: 3px 0 0; }
.favorites-item-actions {
    grid-area: actions;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}
.favorites-item-actions .favorite-toggle-form { margin: 0; }
.favorites-item-actions .button { min-height: 38px; padding: 8px 12px; font-size: 12px; }
.favorites-drag-handle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; min-height: 34px; padding: 0;
    border: 1px solid var(--line); border-radius: 5px;
    background: var(--paper-deep); color: var(--muted);
    font-size: 19px; line-height: 1; cursor: grab;
    user-select: none; -webkit-user-select: none;
    -webkit-user-drag: element;
}
.favorites-drag-handle:active { cursor: grabbing; }
.favorites-drag-handle:focus-visible, .favorites-move-button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.favorites-move-button {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; min-height: 34px; padding: 0;
    border: 1px solid var(--line); border-radius: 5px;
    background: #fff; color: var(--muted); cursor: pointer; font-size: 14px;
}
.favorites-move-button:hover { border-color: var(--line-strong); background: var(--paper-deep); color: var(--ink); }
.favorites-sort-status { margin: 0 0 12px; font-size: 12px; }
.favorites-sort-status.is-error { color: var(--red); }
@media (max-width: 900px) {
    .favorites-sortable-item {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas: "order main" ". actions";
        gap: 10px 15px;
        align-items: start;
    }
    .favorites-order-controls { padding-top: 2px; }
    .favorites-item-actions {
        justify-content: flex-start;
        padding-top: 12px;
        border-top: 1px solid var(--line);
    }
}
@media (max-width: 560px) {
    .favorites-sortable-item {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "order" "main" "actions";
        gap: 12px;
        padding: 16px;
    }
    .favorites-order-controls { justify-content: flex-start; }
    .favorites-item-actions { flex-wrap: wrap; padding-top: 10px; }
    .favorites-item-actions .favorite-toggle-form { flex: 1 1 180px; }
    .favorites-item-actions .favorite-toggle-form .button { width: 100%; }
}
