@font-face {
    font-display: swap;
    font-family: 'Dancing Script';
    font-style: normal;
    font-weight: 700;
    src: url('/assets/fonts/dancing-script-v29-latin-700.woff2') format('woff2');
}
:root {
    --tw-bg: #0e1114;
    --tw-bg-2: #13171b;
    --tw-panel: #171c20;
    --tw-panel-2: #1b2126;
    --tw-panel-3: #20272d;
    --tw-line: rgba(255, 255, 255, 0.09);
    --tw-line-strong: rgba(255, 255, 255, 0.16);
    --tw-text: #f3f4f5;
    --tw-muted: #939da5;
    --tw-muted-2: #6f7a83;
    --tw-gold: #d4af37;
    --tw-gold-soft: #ead98d;
    --tw-gold-dim: rgba(212, 175, 55, 0.14);
    --tw-green: #70c897;
    --tw-red: #e27979;
    --tw-blue: #7fb8e8;
    --tw-paper: #f6f2e9;
    --tw-paper-text: #272522;
    --tw-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
    --tw-radius: 14px;
    --tw-rail: 68px;
    --tw-nav: 276px;
    --tw-inspector: 286px;
    --tw-top: 60px;
    --tw-status: 32px;
    color-scheme: dark;
}
* {
    box-sizing: border-box;
}
html,
body {
    margin: 0;
    min-width: 320px;
    min-height: 100%;
}
button,
input,
select,
textarea {
    font: inherit;
}
button,
a {
    -webkit-tap-highlight-color: transparent;
}
button {
    color: inherit;
}
[hidden] {
    display: none !important;
}
/* ========================================================================== */
/* Shared                                                                     */
/* ========================================================================== */
.tw-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--tw-text);
    text-decoration: none;
}
.tw-brand-mark,
.tw-empty-mark {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(212, 175, 55, 0.55);
    border-radius: 11px;
    background: linear-gradient(145deg, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0.04));
    color: var(--tw-gold-soft);
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.tw-brand strong,
.tw-brand small {
    display: block;
    white-space: nowrap;
}
.tw-brand strong {
    font-size: 0.92rem;
    line-height: 1.05;
    letter-spacing: 0.02em;
}
.tw-brand small {
    margin-top: 3px;
    color: var(--tw-muted);
    font-size: 0.64rem;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.tw-eyebrow,
.tw-panel-eyebrow {
    color: var(--tw-gold);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.tw-btn {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-weight: 750;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: 160ms ease;
}
.tw-btn--primary {
    border-color: rgba(212, 175, 55, 0.72);
    background: linear-gradient(145deg, #d9ba54, #b9972c);
    color: #15130d;
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.12);
}
.tw-btn--primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}
.tw-btn--ghost {
    border-color: var(--tw-line-strong);
    background: rgba(255, 255, 255, 0.035);
    color: var(--tw-text);
}
.tw-btn--ghost:hover {
    border-color: rgba(212, 175, 55, 0.44);
    background: rgba(212, 175, 55, 0.07);
}
.tw-text-link {
    color: var(--tw-gold-soft);
    text-decoration: none;
}
.tw-text-link:hover {
    text-decoration: underline;
}
/* ========================================================================== */
/* Public landing                                                             */
/* ========================================================================== */
.tw-landing-body {
    overflow-x: hidden;
    background:
        radial-gradient(circle at 72% 12%, rgba(212, 175, 55, 0.09), transparent 30rem),
        linear-gradient(180deg, #111518, #0b0e10 80%);
    color: var(--tw-text);
}
.tw-landing {
    width: min(1220px, calc(100% - 36px));
    margin: 0 auto;
    padding: 30px 0 70px;
}
.tw-brand--landing {
    position: relative;
    z-index: 3;
    width: max-content;
    max-width: 100%;
    border-bottom: 0 !important;
    text-decoration: none !important;
    box-shadow: none;
}
.tw-brand--landing::before,
.tw-brand--landing::after {
    content: none !important;
    display: none !important;
}
.tw-landing-hero {
    position: relative;
    min-height: 740px;
    padding: 10px 0 0;
}
.tw-landing-glow {
    position: absolute;
    top: -140px;
    right: -150px;
    width: 620px;
    height: 620px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.13), transparent 68%);
    filter: blur(10px);
    pointer-events: none;
}
.tw-landing-copy {
    position: relative;
    z-index: 2;
    max-width: 810px;
    padding: 112px 0 72px;
}
.tw-landing-copy h1 {
    margin: 16px 0 24px;
    color: #fff;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(2.55rem, 5vw, 5.2rem);
    font-weight: 500;
    line-height: 0.99;
    letter-spacing: -0.045em;
}
.tw-landing-copy h1 span {
    color: var(--tw-gold-soft);
}
.tw-landing-lead {
    max-width: 710px;
    margin: 0;
    color: #b7c0c6;
    font-size: clamp(1.03rem, 1.7vw, 1.22rem);
    line-height: 1.72;
}
.tw-landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}
.tw-landing-price {
    margin: 14px 0 0;
    color: #79858d;
    font-size: 0.82rem;
}
.tw-window-preview {
    position: relative;
    z-index: 2;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 18px;
    background: #11161a;
    box-shadow: 0 45px 110px rgba(0, 0, 0, 0.42);
}
.tw-window-preview__top {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 48px;
    padding: 0 16px;
    border-bottom: 1px solid var(--tw-line);
    color: #a8b0b6;
    font-size: 0.76rem;
}
.tw-window-preview__brand {
    color: var(--tw-gold-soft);
    font-weight: 800;
}
.tw-window-preview__saved {
    justify-self: end;
    color: var(--tw-green);
}
.tw-window-preview__body {
    display: grid;
    grid-template-columns: 50px 205px minmax(320px, 1fr) 215px;
    min-height: 400px;
}
.tw-window-preview__rail,
.tw-window-preview__tree,
.tw-window-preview__inspector {
    border-right: 1px solid var(--tw-line);
}
.tw-window-preview__rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding-top: 18px;
    color: #78828a;
}
.tw-window-preview__rail span:first-child {
    color: var(--tw-gold);
}
.tw-window-preview__tree,
.tw-window-preview__inspector {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 16px;
    background: #161b1f;
    color: #8f999f;
    font-size: 0.78rem;
}
.tw-window-preview__tree strong,
.tw-window-preview__inspector strong {
    color: #e7e9ea;
}
.tw-window-preview__tree .is-child {
    padding-left: 14px;
}
.tw-window-preview__tree .is-active {
    margin: -4px -6px;
    padding: 7px 8px 7px 20px;
    border-radius: 6px;
    background: var(--tw-gold-dim);
    color: var(--tw-gold-soft);
}
.tw-window-preview__paper {
    padding: 54px clamp(28px, 5vw, 80px);
    background: #20262b;
    color: #2d2925;
}
.tw-window-preview__paper::before {
    content: '';
    position: absolute;
}
.tw-window-preview__paper small {
    color: #8f8372;
}
.tw-window-preview__paper h2 {
    margin: 9px 0 30px;
    color: #2d2925;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.65rem;
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.015em;
    text-transform: none;
}
.tw-window-preview__paper p {
    margin: 0 0 12px;
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1.7;
}
.tw-window-preview__paper {
    box-shadow: inset 0 0 0 999px rgba(246, 242, 233, 0.98);
}
.tw-window-preview__inspector {
    border-right: 0;
}
.tw-landing-principles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding-top: 42px;
}
.tw-landing-principles article {
    min-height: 230px;
    padding: 28px;
    border: 1px solid var(--tw-line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
}
.tw-landing-principles article > span {
    color: var(--tw-gold);
    font-size: 0.72rem;
    font-weight: 800;
}
.tw-landing-principles h2 {
    margin: 24px 0 12px;
    color: #fff;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.35rem;
}
.tw-landing-principles p {
    margin: 0;
    color: #909ba2;
    line-height: 1.65;
}
/* ========================================================================== */
/* App shell                                                                  */
/* ========================================================================== */
.tw-app-body {
    overflow: hidden;
    height: 100vh;
    min-height: 100vh;
    background: var(--tw-bg);
    color: var(--tw-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
}
.tw-app {
    display: grid;
    grid-template-rows: var(--tw-top) minmax(0, 1fr) var(--tw-status);
    width: 100vw;
    height: 100vh;
    background: var(--tw-bg);
}
.tw-topbar {
    position: relative;
    z-index: 50;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    min-width: 0;
    padding: 0 12px 0 14px;
    border-bottom: 1px solid var(--tw-line);
    background: rgba(15, 19, 22, 0.96);
    backdrop-filter: blur(18px);
}
.tw-topbar__left,
.tw-topbar__right {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 14px;
}
.tw-topbar__right {
    justify-content: flex-end;
}
.tw-topbar__center {
    display: flex;
    justify-content: center;
}
.tw-project-picker-wrap {
    position: relative;
    min-width: 0;
}
.tw-project-picker {
    display: flex;
    max-width: min(34vw, 460px);
    min-height: 34px;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #d9dddf;
    cursor: pointer;
}
.tw-project-picker:hover,
.tw-project-picker[aria-expanded='true'] {
    border-color: var(--tw-line);
    background: rgba(255, 255, 255, 0.035);
}
.tw-project-picker__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-project-menu {
    position: absolute;
    top: calc(100% + 9px);
    left: 0;
    width: min(360px, calc(100vw - 24px));
    overflow: hidden;
    border: 1px solid var(--tw-line-strong);
    border-radius: 11px;
    background: #171c20;
    box-shadow: var(--tw-shadow);
}
.tw-project-menu__list {
    max-height: 330px;
    overflow: auto;
    padding: 6px;
}
.tw-project-menu__item,
.tw-project-menu__create {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #dce0e2;
    text-align: left;
    cursor: pointer;
}
.tw-project-menu__item {
    padding: 10px 11px;
}
.tw-project-menu__item strong,
.tw-project-menu__item span {
    display: block;
}
.tw-project-menu__item strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.86rem;
}
.tw-project-menu__item span {
    margin-top: 3px;
    color: var(--tw-muted);
    font-size: 0.71rem;
}
.tw-project-menu__item:hover,
.tw-project-menu__item.is-active {
    background: rgba(212, 175, 55, 0.09);
}
.tw-project-menu__item.is-active strong {
    color: var(--tw-gold-soft);
}
.tw-project-menu__create {
    padding: 11px 16px;
    border-top: 1px solid var(--tw-line);
    border-radius: 0;
    color: var(--tw-gold-soft);
    font-weight: 700;
}
.tw-save-state {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--tw-muted);
    font-size: 0.74rem;
    white-space: nowrap;
}
.tw-save-state__dot,
.tw-network-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--tw-muted-2);
}
.tw-save-state.is-saved {
    color: var(--tw-green);
}
.tw-save-state.is-saved .tw-save-state__dot,
.tw-network-dot.is-online {
    background: var(--tw-green);
    box-shadow: 0 0 0 3px rgba(112, 200, 151, 0.1);
}
.tw-save-state.is-saving .tw-save-state__dot {
    background: var(--tw-gold);
    animation: twPulse 1s infinite ease-in-out;
}
.tw-save-state.is-offline,
.tw-save-state.is-conflict {
    color: var(--tw-red);
}
.tw-save-state.is-offline .tw-save-state__dot,
.tw-save-state.is-conflict .tw-save-state__dot,
.tw-network-dot.is-offline {
    background: var(--tw-red);
}
@keyframes twPulse {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 1; }
}
.tw-access-badge {
    padding: 5px 9px;
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.06);
    color: var(--tw-gold-soft);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}
.tw-icon-button,
.tw-small-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid transparent;
    background: transparent;
    color: #89939a;
    cursor: pointer;
}
.tw-icon-button {
    width: 34px;
    height: 34px;
    border-radius: 8px;
}
.tw-icon-button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.tw-icon-button:hover,
.tw-small-icon:hover {
    border-color: var(--tw-line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--tw-text);
}
.tw-avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(212, 175, 55, 0.42);
    border-radius: 50%;
    background: #242a2f;
    color: var(--tw-gold-soft);
    font-size: 0.75rem;
    font-weight: 800;
    text-decoration: none;
}
.tw-workspace {
    display: grid;
    grid-template-columns: var(--tw-rail) var(--tw-nav) minmax(0, 1fr) var(--tw-inspector);
    min-width: 0;
    min-height: 0;
}
.tw-toolrail,
.tw-navigator,
.tw-inspector {
    min-height: 0;
    border-right: 1px solid var(--tw-line);
    background: var(--tw-panel);
}
.tw-toolrail {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 9px 8px 8px;
    background: #111519;
}
.tw-tool {
    position: relative;
    display: grid;
    place-items: center;
    gap: 2px;
    width: 100%;
    min-height: 51px;
    margin-bottom: 2px;
    padding: 5px 2px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #68737b;
    cursor: pointer;
}
.tw-tool svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.tw-tool span {
    font-size: 0.56rem;
    letter-spacing: 0.01em;
}
.tw-tool:hover {
    background: rgba(255, 255, 255, 0.035);
    color: #a9b1b6;
}
.tw-tool.is-active {
    background: var(--tw-gold-dim);
    color: var(--tw-gold-soft);
}
.tw-tool.is-active::before {
    content: '';
    position: absolute;
    left: -8px;
    width: 2px;
    height: 27px;
    border-radius: 0 2px 2px 0;
    background: var(--tw-gold);
}
.tw-tool[aria-disabled='true'] {
    opacity: 0.58;
}
.tw-toolrail__spacer {
    flex: 1;
}
.tw-navigator,
.tw-inspector {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.tw-inspector {
    border-right: 0;
    border-left: 1px solid var(--tw-line);
}
.tw-panel-heading {
    display: flex;
    min-height: 62px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px 0 16px;
    border-bottom: 1px solid var(--tw-line);
}
.tw-panel-heading h2 {
    margin: 3px 0 0;
    color: #e8ebed;
    font-size: 0.87rem;
    font-weight: 750;
}
.tw-panel-actions {
    display: flex;
    gap: 5px;
}
.tw-small-icon {
    width: 29px;
    height: 29px;
    border-radius: 7px;
    font-size: 1.1rem;
}
.tw-tree {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 9px 7px 14px;
    scrollbar-width: thin;
    scrollbar-color: #394149 transparent;
}
.tw-tree-row {
    position: relative;
    display: flex;
    min-height: 34px;
    align-items: center;
    gap: 7px;
    margin: 1px 0;
    padding: 5px 7px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #aeb6bb;
    cursor: pointer;
    user-select: none;
}
.tw-tree-row:hover {
    background: rgba(255, 255, 255, 0.03);
}
.tw-tree-row.is-active {
    border-color: rgba(212, 175, 55, 0.2);
    background: rgba(212, 175, 55, 0.09);
    color: var(--tw-gold-soft);
}
.tw-tree-row.is-chapter {
    margin-top: 5px;
    color: #d6dbde;
    font-weight: 700;
}
.tw-tree-row.is-part {
    margin-top: 9px;
    color: #e7e9ea;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.tw-tree-row__chevron {
    display: grid;
    place-items: center;
    width: 14px;
    height: 14px;
    border: 0;
    background: transparent;
    color: #657078;
    font-size: 0.66rem;
    cursor: pointer;
}
.tw-tree-row__icon {
    width: 15px;
    color: #7a858d;
    text-align: center;
    font-size: 0.73rem;
}
.tw-tree-row__title {
    min-width: 0;
    overflow: hidden;
    flex: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-tree-row__count {
    color: #657078;
    font-size: 0.63rem;
    font-variant-numeric: tabular-nums;
}
.tw-navigator-footer {
    padding: 9px;
    border-top: 1px solid var(--tw-line);
}
.tw-inline-action {
    width: 100%;
    min-height: 34px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 7px;
    background: transparent;
    color: #879198;
    cursor: pointer;
}
.tw-inline-action:hover {
    border-color: rgba(212, 175, 55, 0.32);
    color: var(--tw-gold-soft);
}
.tw-editor-area {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% -12%, rgba(255, 255, 255, 0.035), transparent 30rem),
        #20262b;
}
.tw-editor-shell {
    width: 100%;
    height: 100%;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: #4a535a transparent;
}
.tw-editor-empty {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 380px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 40px;
    text-align: center;
}
.tw-empty-mark {
    width: 58px;
    height: 58px;
    margin-bottom: 20px;
    border-radius: 18px;
    font-size: 1.3rem;
}
.tw-editor-empty h1 {
    margin: 0;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.65rem;
    font-weight: 500;
}
.tw-editor-empty p {
    max-width: 420px;
    margin: 10px 0 20px;
    color: var(--tw-muted);
    line-height: 1.6;
}
.tw-editor-document {
    min-height: 100%;
    padding: 22px clamp(18px, 4vw, 56px) 80px;
}
.tw-document-meta {
    display: flex;
    max-width: 790px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 auto 7px;
    color: #8c969d;
    font-size: 0.68rem;
}
.tw-quiet-button {
    padding: 5px 7px;
    border: 0;
    background: transparent;
    color: #7b868d;
    cursor: pointer;
}
.tw-quiet-button:hover {
    color: var(--tw-gold-soft);
}
.tw-document-title {
    display: block;
    width: min(790px, 100%);
    margin: 0 auto 12px;
    padding: 8px 2px 12px;
    border: 0;
    border-bottom: 1px solid transparent;
    outline: none;
    background: transparent;
    color: #e6eaec;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.4rem, 2.5vw, 2.1rem);
    font-weight: 500;
}
.tw-document-title:focus {
    border-bottom-color: rgba(212, 175, 55, 0.25);
}
.tw-paper-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
}
.tw-paper {
    width: min(790px, 100%);
    min-height: calc(100vh - var(--tw-top) - var(--tw-status) - 145px);
    padding: clamp(44px, 7vw, 76px) clamp(38px, 8vw, 84px) 110px;
    border-radius: 3px;
    background: var(--tw-paper);
    color: var(--tw-paper-text);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
}
.tw-editor {
    min-height: 52vh;
    outline: none;
    color: #2d2a26;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.06rem;
    line-height: 1.82;
    white-space: pre-wrap;
    caret-color: #5f4c15;
}
.tw-editor:empty::before {
    content: attr(data-placeholder);
    color: #a8a094;
    pointer-events: none;
}
.tw-editor[contenteditable='false'] {
    cursor: default;
}
.tw-readonly-banner,
.tw-offline-banner {
    position: absolute;
    z-index: 15;
    top: 12px;
    left: 50%;
    width: min(720px, calc(100% - 24px));
    transform: translateX(-50%);
    padding: 10px 14px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 9px;
    background: rgba(29, 31, 27, 0.96);
    color: #d5d8da;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.22);
    font-size: 0.76rem;
    line-height: 1.45;
}
.tw-readonly-banner a {
    margin-left: 5px;
    color: var(--tw-gold-soft);
}
.tw-offline-banner {
    border-color: rgba(226, 121, 121, 0.36);
    background: rgba(42, 25, 25, 0.97);
}
.tw-inspector-empty {
    padding: 20px 16px;
    color: #707b82;
    font-size: 0.78rem;
    line-height: 1.6;
}
.tw-inspector-content {
    overflow: auto;
    padding: 15px;
}
.tw-field {
    display: block;
    margin-bottom: 13px;
}
.tw-field > span {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 6px;
    color: #8f999f;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}
.tw-field > span small {
    color: #68737b;
    font-weight: 500;
}
.tw-field input,
.tw-field select {
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid var(--tw-line-strong);
    border-radius: 7px;
    outline: none;
    background: #101417;
    color: #e2e5e7;
}
.tw-field input:focus,
.tw-field select:focus {
    border-color: rgba(212, 175, 55, 0.55);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.07);
}
.tw-field input:disabled,
.tw-field select:disabled {
    opacity: 0.58;
}
.tw-inspector-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 18px;
}
.tw-inspector-grid > div {
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--tw-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
}
.tw-inspector-grid span,
.tw-inspector-grid strong {
    display: block;
}
.tw-inspector-grid span {
    color: #69747b;
    font-size: 0.62rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.tw-inspector-grid strong {
    overflow: hidden;
    margin-top: 4px;
    color: #dce0e2;
    font-size: 0.8rem;
    text-overflow: ellipsis;
}
.tw-inspector-note {
    margin-top: 18px;
    padding: 12px;
    border: 1px dashed rgba(212, 175, 55, 0.22);
    border-radius: 8px;
    background: rgba(212, 175, 55, 0.035);
}
.tw-inspector-note span {
    color: var(--tw-gold-soft);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.tw-inspector-note p {
    margin: 7px 0 0;
    color: #818c93;
    font-size: 0.72rem;
    line-height: 1.55;
}
.tw-statusbar {
    position: relative;
    z-index: 30;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 0 12px 0 76px;
    border-top: 1px solid var(--tw-line);
    background: #0d1114;
    color: #6f7980;
    font-size: 0.64rem;
}
.tw-statusbar > div:last-child {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}
.tw-statusbar__center {
    overflow: hidden;
    max-width: 40vw;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-status-separator {
    margin: 0 3px;
}
.tw-status-button {
    margin-left: 9px;
    padding: 3px 7px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #7d878e;
    font-size: inherit;
    cursor: pointer;
}
.tw-status-button:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--tw-gold-soft);
}
.tw-skeleton {
    height: 26px;
    margin: 8px;
    border-radius: 6px;
    background: linear-gradient(90deg, #1d2328, #262d33, #1d2328);
    background-size: 220% 100%;
    animation: twShimmer 1.4s linear infinite;
}
.tw-skeleton.is-short {
    width: 68%;
}
@keyframes twShimmer {
    to { background-position: -220% 0; }
}
/* ========================================================================== */
/* Modal / Toast                                                              */
/* ========================================================================== */
.tw-modal-backdrop {
    position: fixed;
    z-index: 200;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(5, 7, 8, 0.72);
    backdrop-filter: blur(10px);
}
.tw-modal {
    position: relative;
    width: min(500px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: 28px;
    border: 1px solid var(--tw-line-strong);
    border-radius: 15px;
    background: #171c20;
    box-shadow: var(--tw-shadow);
}
.tw-modal--access {
    width: min(620px, 100%);
}
.tw-modal h2 {
    margin: 8px 0 12px;
    color: #f4f5f6;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.55rem;
    font-weight: 500;
}
.tw-modal > p {
    margin: 0 0 18px;
    color: #a0a9af;
    line-height: 1.65;
}
.tw-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #88939a;
    font-size: 1.25rem;
    cursor: pointer;
}
.tw-modal-close:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
}
.tw-modal-actions,
.tw-conflict-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 20px;
}
.tw-access-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 11px;
    margin-bottom: 16px;
}
.tw-access-card {
    display: flex;
    flex-direction: column;
    min-height: 180px;
    padding: 17px;
    border: 1px solid var(--tw-line);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.02);
}
.tw-access-card.is-primary {
    border-color: rgba(212, 175, 55, 0.35);
    background: rgba(212, 175, 55, 0.055);
}
.tw-access-card small,
.tw-access-card strong,
.tw-access-card p {
    display: block;
}
.tw-access-card small {
    color: var(--tw-gold);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}
.tw-access-card strong {
    margin-top: 6px;
    color: #eef0f1;
    font-size: 1rem;
}
.tw-access-card p {
    flex: 1;
    margin: 8px 0 13px;
    color: #89949b;
    font-size: 0.76rem;
    line-height: 1.55;
}
.tw-toast-stack {
    position: fixed;
    z-index: 300;
    right: 16px;
    bottom: calc(var(--tw-status) + 16px);
    display: flex;
    width: min(360px, calc(100vw - 32px));
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.tw-toast {
    padding: 11px 13px;
    border: 1px solid var(--tw-line-strong);
    border-radius: 9px;
    background: rgba(23, 28, 32, 0.97);
    color: #d8dcde;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.24);
    font-size: 0.75rem;
    line-height: 1.45;
    animation: twToastIn 180ms ease-out;
}
.tw-toast.is-error {
    border-color: rgba(226, 121, 121, 0.34);
}
.tw-toast.is-success {
    border-color: rgba(112, 200, 151, 0.3);
}
@keyframes twToastIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
/* ========================================================================== */
/* Focus mode                                                                 */
/* ========================================================================== */
.tw-app.is-focus .tw-topbar,
.tw-app.is-focus .tw-toolrail,
.tw-app.is-focus .tw-navigator,
.tw-app.is-focus .tw-inspector,
.tw-app.is-focus .tw-statusbar {
    display: none;
}
.tw-app.is-focus {
    display: block;
}
.tw-app.is-focus .tw-workspace {
    display: block;
    width: 100%;
    height: 100%;
}
.tw-app.is-focus .tw-editor-area,
.tw-app.is-focus .tw-editor-shell {
    width: 100%;
    height: 100vh;
}
.tw-app.is-focus .tw-editor-document {
    padding-top: 48px;
}
.tw-app.is-focus .tw-document-meta,
.tw-app.is-focus .tw-document-title {
    opacity: 0;
    transition: opacity 160ms ease;
}
.tw-app.is-focus .tw-editor-document:hover .tw-document-meta,
.tw-app.is-focus .tw-editor-document:hover .tw-document-title {
    opacity: 1;
}
.tw-focus-exit {
    position: fixed;
    z-index: 120;
    top: 12px;
    right: 12px;
    padding: 7px 10px;
    border: 1px solid var(--tw-line-strong);
    border-radius: 7px;
    background: rgba(17, 21, 25, 0.88);
    color: #a7b0b6;
    font-size: 0.68rem;
    cursor: pointer;
    backdrop-filter: blur(8px);
}
/* ========================================================================== */
/* Responsive                                                                 */
/* ========================================================================== */
.tw-mobile-only {
    display: none;
}
@media (max-width: 1180px) {
    :root {
        --tw-inspector: 250px;
        --tw-nav: 245px;
    }
    .tw-app .tw-brand small,
    .tw-app .tw-access-badge {
        display: none;
    }
}
@media (max-width: 920px) {
    :root {
        --tw-rail: 58px;
        --tw-nav: 250px;
    }
    .tw-workspace {
        grid-template-columns: var(--tw-rail) var(--tw-nav) minmax(0, 1fr);
    }
    .tw-inspector {
        position: fixed;
        z-index: 90;
        top: var(--tw-top);
        right: 0;
        bottom: var(--tw-status);
        width: min(320px, 88vw);
        transform: translateX(100%);
        box-shadow: -24px 0 60px rgba(0, 0, 0, 0.3);
        transition: transform 180ms ease;
    }
    .tw-inspector.is-open {
        transform: translateX(0);
    }
    .tw-mobile-only {
        display: grid;
    }
    .tw-topbar {
        grid-template-columns: minmax(0, 1fr) auto;
    }
    .tw-topbar__center {
        display: none;
    }
    .tw-window-preview__body {
        grid-template-columns: 48px 180px minmax(300px, 1fr);
    }
    .tw-window-preview__inspector {
        display: none;
    }
}
@media (max-width: 720px) {
    :root {
        --tw-top: 56px;
        --tw-status: 30px;
    }
    .tw-brand {
        display: none;
    }
    .tw-project-picker {
        max-width: 58vw;
    }
    .tw-workspace {
        display: block;
    }
    .tw-toolrail {
        display: none;
    }
    .tw-navigator {
        position: fixed;
        z-index: 95;
        top: var(--tw-top);
        bottom: var(--tw-status);
        left: 0;
        width: min(300px, 88vw);
        transform: translateX(-100%);
        box-shadow: 24px 0 60px rgba(0, 0, 0, 0.3);
        transition: transform 180ms ease;
    }
    .tw-navigator.is-open {
        transform: translateX(0);
    }
    .tw-editor-area {
        width: 100%;
        height: 100%;
    }
    .tw-editor-document {
        padding: 14px 10px 54px;
    }
    .tw-paper {
        min-height: calc(100vh - var(--tw-top) - var(--tw-status) - 115px);
        padding: 34px 26px 70px;
    }
    .tw-document-title {
        padding-left: 4px;
        padding-right: 4px;
    }
    .tw-statusbar {
        grid-template-columns: 1fr auto;
        padding-left: 10px;
    }
    .tw-statusbar__center {
        display: none;
    }
    .tw-access-options,
    .tw-landing-principles {
        grid-template-columns: 1fr;
    }
    .tw-window-preview {
        display: none;
    }
    .tw-landing-hero {
        min-height: auto;
    }
    .tw-landing-copy {
        padding: 80px 0 35px;
    }
}
@media (max-width: 520px) {
    .tw-topbar {
        gap: 7px;
        padding-left: 8px;
        padding-right: 8px;
    }
    .tw-topbar__left,
    .tw-topbar__right {
        gap: 7px;
    }
    .tw-avatar {
        display: none;
    }
    .tw-project-picker {
        max-width: 54vw;
    }
    .tw-modal {
        padding: 22px;
    }
    .tw-modal-actions,
    .tw-conflict-actions {
        flex-direction: column-reverse;
    }
    .tw-modal-actions .tw-btn,
    .tw-conflict-actions .tw-btn {
        width: 100%;
    }
}
/* ========================================================================== */
/* Phase 1C – Branding, manuscript actions & writing view                      */
/* ========================================================================== */
.tw-app {
    --tw-editor-font-family: Georgia, 'Times New Roman', serif;
    --tw-editor-font-size: 18px;
    --tw-editor-line-height: 1.72;
    --tw-editor-paragraph-spacing: 0.85em;
    --tw-editor-first-line-indent: 0em;
    --tw-editor-page-width: 760px;
    --tw-editor-zoom: 1;
}
.tw-brand-logo-wrap {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    overflow: hidden;
    border-radius: 4px;
}
.tw-brand-logo-wrap--landing {
    width: 28px;
    height: 28px;
}
.tw-brand-logo {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 4px;
    object-fit: cover;
    object-position: center;
}
.tw-brand--landing .tw-brand-logo {
    object-fit: contain;
}
.tw-brand--landing small {
    display: block;
}
.tw-avatar {
    overflow: hidden;
}
.tw-avatar img,
.tw-avatar__fallback {
    width: 100%;
    height: 100%;
}
.tw-avatar img {
    display: block;
    object-fit: cover;
    object-position: center;
}
.tw-avatar__fallback {
    place-items: center;
}
.tw-avatar__fallback:not([hidden]) {
    display: grid;
}
.tw-document-meta__actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.tw-tree-row__menu {
    display: grid;
    width: 28px;
    height: 24px;
    place-items: center;
    flex: 0 0 auto;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #68737a;
    font-size: 0.62rem;
    letter-spacing: 0.03em;
    opacity: 0;
    cursor: pointer;
}
.tw-tree-row:hover .tw-tree-row__menu,
.tw-tree-row.is-active .tw-tree-row__menu,
.tw-tree-row__menu:focus-visible {
    opacity: 1;
}
.tw-tree-row__menu:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--tw-text);
}
.tw-tree-row[draggable='true'] {
    cursor: grab;
}
.tw-tree-row.is-dragging {
    opacity: 0.42;
}
.tw-tree-row.is-drop-before::before,
.tw-tree-row.is-drop-after::after {
    content: '';
    position: absolute;
    z-index: 4;
    right: 6px;
    left: 6px;
    height: 2px;
    border-radius: 2px;
    background: var(--tw-gold);
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.16);
}
.tw-tree-row.is-drop-before::before {
    top: -2px;
}
.tw-tree-row.is-drop-after::after {
    bottom: -2px;
}
.tw-tree-row.is-drop-inside {
    border-color: rgba(212, 175, 55, 0.55);
    background: rgba(212, 175, 55, 0.11);
}
.tw-node-menu {
    position: fixed;
    z-index: 420;
    width: 210px;
    padding: 6px;
    border: 1px solid var(--tw-line-strong);
    border-radius: 9px;
    background: rgba(20, 25, 29, 0.98);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(14px);
}
.tw-node-menu button {
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #c9ced1;
    text-align: left;
    cursor: pointer;
}
.tw-node-menu button:hover {
    background: rgba(255, 255, 255, 0.055);
    color: #fff;
}
.tw-node-menu button.is-danger {
    color: #e69a9a;
}
.tw-settings-drawer {
    position: fixed;
    z-index: 350;
    top: var(--tw-top);
    right: 0;
    bottom: var(--tw-status);
    width: min(370px, calc(100vw - 24px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    padding: 0;
    border-left: 1px solid var(--tw-line-strong);
    background: rgba(20, 25, 29, 0.985);
    box-shadow: -24px 0 65px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(18px);
}
.tw-settings-drawer__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
    padding: 18px 18px 10px;
}
.tw-settings-drawer__head h2 {
    margin: 4px 0 0;
    font-size: 1.1rem;
}
.tw-settings-drawer__body {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0 18px 18px;
    scroll-padding-bottom: 18px;
}
.tw-settings-hint {
    margin: 0 0 18px;
    padding: 11px 12px;
    border: 1px solid rgba(212, 175, 55, 0.17);
    border-radius: 8px;
    background: rgba(212, 175, 55, 0.045);
    color: #929ca3;
    font-size: 0.72rem;
    line-height: 1.55;
}
.tw-setting-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.tw-settings-drawer__footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 13px 18px calc(13px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--tw-line-strong);
    background: rgba(20, 25, 29, 0.995);
    box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.16);
}
.tw-settings-save-state {
    min-width: 0;
    color: #929ca3;
    font-size: 0.7rem;
    line-height: 1.3;
}
.tw-settings-save-state.is-saved {
    color: #76cda1;
}
.tw-settings-save-state.is-dirty {
    color: #e4c869;
}
.tw-settings-save-state.is-saving {
    color: #b9c1c6;
}
.tw-settings-save-state.is-error {
    color: #e69a9a;
}
.tw-settings-drawer__footer .tw-btn:disabled {
    opacity: 0.46;
    cursor: default;
}
.tw-btn--danger {
    border-color: rgba(226, 121, 121, 0.45);
    background: rgba(176, 68, 68, 0.22);
    color: #f2c5c5;
}
.tw-btn--danger:hover {
    border-color: rgba(226, 121, 121, 0.72);
    background: rgba(176, 68, 68, 0.32);
}
.tw-document-meta,
.tw-document-title {
    max-width: var(--tw-editor-page-width);
}
.tw-paper {
    width: min(var(--tw-editor-page-width), 100%);
    zoom: var(--tw-editor-zoom);
}
.tw-editor {
    font-family: var(--tw-editor-font-family);
    font-size: var(--tw-editor-font-size);
    line-height: var(--tw-editor-line-height);
    white-space: normal;
}
.tw-editor p {
    min-height: 1em;
    margin: 0 0 var(--tw-editor-paragraph-spacing);
    text-indent: var(--tw-editor-first-line-indent);
    white-space: pre-wrap;
}
.tw-editor p:last-child {
    margin-bottom: 0;
}
.tw-app[data-paper-theme='white'] .tw-paper {
    background: #fff;
    color: #202020;
}
.tw-app[data-paper-theme='sepia'] .tw-paper {
    background: #eee1c6;
    color: #2f2921;
}
.tw-app[data-paper-theme='dark'] .tw-paper {
    background: #171a1d;
    color: #e6e3dc;
    border: 1px solid rgba(255, 255, 255, 0.07);
}
.tw-app[data-paper-theme='dark'] .tw-editor {
    color: #e6e3dc;
    caret-color: var(--tw-gold-soft);
}
.tw-app[data-paper-theme='dark'] .tw-editor:empty::before {
    color: #70777c;
}
@media (max-width: 760px) {
    .tw-brand-logo-wrap {
        width: 24px;
        height: 24px;
    }
    .tw-brand-logo-wrap--landing {
        width: 28px;
        height: 28px;
    }
    .tw-setting-row {
        grid-template-columns: 1fr;
    }
    .tw-document-meta__actions .tw-quiet-button:first-child {
        display: none;
    }
}
/* ==========================================================================
   PHASE 1D – TIPTAP / PROSEMIRROR
   ========================================================================== */
.tw-formatbar {
    display: flex;
    width: min(var(--tw-editor-page-width), 100%);
    min-height: 38px;
    align-items: center;
    gap: 3px;
    margin: 0 auto 10px;
    padding: 4px 5px;
    overflow-x: auto;
    border: 1px solid rgba(255,255,255,.075);
    border-radius: 8px;
    background: rgba(16,20,23,.72);
    scrollbar-width: thin;
}
.tw-formatbar__group {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 2px;
}
.tw-formatbar__separator {
    width: 1px;
    height: 20px;
    flex: 0 0 1px;
    margin: 0 3px;
    background: rgba(255,255,255,.08);
}
.tw-format-btn {
    display: grid;
    min-width: 29px;
    height: 28px;
    place-items: center;
    padding: 0 7px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #949ea4;
    font-family: inherit;
    font-size: .72rem;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}
.tw-format-btn.is-wide {
    min-width: auto;
    padding-inline: 9px;
}
.tw-format-btn.is-strong { font-weight: 800; }
.tw-format-btn.is-italic { font-style: italic; font-family: Georgia, serif; }
.tw-format-btn.is-underlined { text-decoration: underline; }
.tw-format-btn.is-strike { text-decoration: line-through; }
.tw-format-btn:hover:not(:disabled) {
    border-color: rgba(212,175,55,.18);
    background: rgba(255,255,255,.045);
    color: #e1e4e5;
}
.tw-format-btn.is-active {
    border-color: rgba(212,175,55,.34);
    background: rgba(212,175,55,.12);
    color: var(--tw-gold-soft);
}
.tw-format-btn:disabled {
    opacity: .32;
    cursor: default;
}
.tw-editor {
    min-height: 52vh;
    outline: none;
    color: #2d2a26;
    font-family: var(--tw-editor-font-family);
    font-size: var(--tw-editor-font-size);
    line-height: var(--tw-editor-line-height);
    caret-color: #5f4c15;
}
.tw-editor .ProseMirror {
    min-height: 52vh;
    outline: none;
    color: inherit;
    font: inherit;
    line-height: inherit;
    white-space: normal;
}
.tw-editor .ProseMirror p {
    min-height: 1em;
    margin: 0 0 var(--tw-editor-paragraph-spacing);
    text-indent: var(--tw-editor-first-line-indent);
    white-space: pre-wrap;
}
.tw-editor .ProseMirror p:last-child {
    margin-bottom: 0;
}
.tw-editor.is-empty .ProseMirror:not(:focus) > p:first-child::before {
    content: 'Schreib los …';
    float: left;
    height: 0;
    color: #a8a094;
    pointer-events: none;
    text-indent: 0;
}
.tw-editor .ProseMirror h1,
.tw-editor .ProseMirror h2,
.tw-editor .ProseMirror h3 {
    margin: 1.25em 0 .65em;
    color: inherit;
    font-family: var(--tw-editor-font-family);
    font-weight: 650;
    line-height: 1.25;
    text-indent: 0;
}
.tw-editor .ProseMirror h1 { font-size: 1.65em; }
.tw-editor .ProseMirror h2 { font-size: 1.38em; }
.tw-editor .ProseMirror h3 { font-size: 1.18em; }
.tw-editor .ProseMirror ul,
.tw-editor .ProseMirror ol {
    margin: .6em 0 var(--tw-editor-paragraph-spacing) 1.75em;
    padding: 0;
}
.tw-editor .ProseMirror li > p {
    margin-bottom: .3em;
    text-indent: 0;
}
.tw-editor .ProseMirror blockquote {
    margin: 1em 0;
    padding: .15em 0 .15em 1.05em;
    border-left: 3px solid rgba(128,104,39,.45);
    color: color-mix(in srgb, currentColor 80%, transparent);
}
.tw-editor .ProseMirror hr {
    width: 34%;
    margin: 2em auto;
    border: 0;
    border-top: 1px solid rgba(80,70,55,.32);
}
.tw-editor .ProseMirror ::selection {
    background: rgba(212,175,55,.24);
}
.tw-editor .ProseMirror[contenteditable='false'] {
    cursor: default;
}
@media (max-width: 820px) {
    .tw-formatbar {
        border-radius: 7px;
    }
    .tw-format-btn {
        min-width: 32px;
    }
}
/* ==========================================================================&#x20;
   PHASE 1E – SUCHE, PAPIERKORB & SZENENDATEN
   ========================================================================== */
.tw-side-drawer {
    position: fixed;
    z-index: 350;
    top: var(--tw-top);
    right: 0;
    bottom: var(--tw-status);
    width: min(430px, calc(100vw - 24px));
    overflow: auto;
    padding: 18px;
    border-left: 1px solid var(--tw-line-strong);
    background: rgba(20, 25, 29, 0.985);
    box-shadow: -24px 0 65px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(18px);
}
.tw-search-form {
    display: grid;
    gap: 12px;
}
.tw-btn--full {
    width: 100%;
    justify-content: center;
}
.tw-check-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: #909aa0;
    font-size: .72rem;
}
.tw-check-row label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
}
.tw-check-row input {
    accent-color: var(--tw-gold);
}
.tw-search-summary {
    margin: 16px 0 8px;
    color: #909aa0;
    font-size: .75rem;
}
.tw-search-results {
    display: grid;
    gap: 7px;
    max-height: 43vh;
    overflow: auto;
    padding-right: 3px;
}
.tw-search-result {
    display: grid;
    gap: 5px;
    width: 100%;
    padding: 10px 11px;
    border: 1px solid var(--tw-line);
    border-radius: 8px;
    background: rgba(255,255,255,.018);
    color: #c7cdd0;
    text-align: left;
    cursor: pointer;
}
.tw-search-result:hover {
    border-color: rgba(212,175,55,.28);
    background: rgba(212,175,55,.045);
}
.tw-search-result__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.tw-search-result__head strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #f0f2f2;
    font-size: .8rem;
}
.tw-search-result__head span,
.tw-search-result small {
    color: #777f85;
    font-size: .66rem;
}
.tw-search-result__snippet {
    display: -webkit-box;
    overflow: hidden;
    color: #a6afb4;
    font-size: .72rem;
    line-height: 1.48;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}
.tw-search-replace {
    display: grid;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--tw-line);
}
.tw-search-replace > small {
    color: #747e84;
    font-size: .66rem;
    line-height: 1.45;
}
.tw-trash-list {
    display: grid;
    gap: 8px;
}
.tw-trash-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px;
    border: 1px solid var(--tw-line);
    border-radius: 8px;
    background: rgba(255,255,255,.018);
}
.tw-trash-item > div {
    display: grid;
    min-width: 0;
    gap: 4px;
}
.tw-trash-item strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #ebeeee;
    font-size: .78rem;
}
.tw-trash-item small {
    color: #798288;
    font-size: .64rem;
}
.tw-inspector-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin: 16px 0 10px;
    padding-top: 14px;
    border-top: 1px solid var(--tw-line);
}
.tw-inspector-section-head > span {
    color: var(--tw-gold-soft);
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.tw-inspector-section-head > small,
.tw-field-help {
    color: #6f797f;
    font-size: .61rem;
}
.tw-scene-metadata {
    display: grid;
    gap: 10px;
}
.tw-scene-metadata textarea {
    min-height: 96px;
    resize: vertical;
}
.tw-field textarea {
    width: 100%;
    padding: 10px 11px;
    border: 1px solid var(--tw-line-strong);
    border-radius: 7px;
    outline: none;
    background: #101416;
    color: #d9dddf;
    font: inherit;
    font-size: .78rem;
    line-height: 1.5;
}
.tw-field textarea:focus {
    border-color: rgba(212,175,55,.45);
    box-shadow: 0 0 0 2px rgba(212,175,55,.07);
}
.tw-field > small.tw-field-help {
    display: block;
    margin-top: 5px;
}
@media (max-width: 720px) {
    .tw-side-drawer {
        width: min(100vw, 430px);
    }
    .tw-check-row {
        display: grid;
    }
}
/* ==========================================================================
   PHASE 1F – A4, LINEAL, EINZÜGE, SETUP & LÖSCHEN
   ========================================================================== */
.tw-app {
    --tw-editor-page-height: 297mm;
    --tw-editor-page-padding: 25mm;
}
.tw-app[data-page-mode='a4'] .tw-paper {
    width: 210mm;
    min-width: 210mm;
    min-height: 297mm;
    padding: var(--tw-editor-page-padding);
    box-sizing: border-box;
}
.tw-app[data-page-mode='a4'] .tw-paper-wrap {
    min-width: calc(210mm + 32px);
}
.tw-app[data-page-mode='flow'] .tw-paper {
    width: min(var(--tw-editor-page-width), 100%);
    min-width: 0;
}
.tw-app[data-auto-first-line-indent='false'] .tw-editor .ProseMirror p {
    text-indent: 0;
}
.tw-app[data-auto-first-line-indent='true'] .tw-editor .ProseMirror p {
    text-indent: var(--tw-editor-first-line-indent);
}
.tw-app[data-auto-first-line-indent='true'] .tw-editor .ProseMirror li > p {
    text-indent: 0;
}
.tw-editor .ProseMirror [data-indent-level='1'] { margin-left: 1.5em; }
.tw-editor .ProseMirror [data-indent-level='2'] { margin-left: 3em; }
.tw-editor .ProseMirror [data-indent-level='3'] { margin-left: 4.5em; }
.tw-editor .ProseMirror [data-indent-level='4'] { margin-left: 6em; }
.tw-editor .ProseMirror [data-indent-level='5'] { margin-left: 7.5em; }
.tw-editor .ProseMirror [data-indent-level='6'] { margin-left: 9em; }
.tw-ruler {
    position: relative;
    width: min(var(--tw-editor-page-width), 100%);
    height: 28px;
    margin: 0 auto 8px;
    zoom: var(--tw-editor-zoom);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 6px;
    background: rgba(14,18,21,.72);
    color: #737e85;
    overflow: hidden;
    user-select: none;
}
.tw-app[data-page-mode='a4'] .tw-ruler {
    width: 210mm;
    min-width: 210mm;
}
.tw-ruler__track {
    position: absolute;
    inset: 0 8px;
}
.tw-ruler__tick {
    position: absolute;
    bottom: 0;
    width: 1px;
    background: rgba(255,255,255,.16);
    transform: translateX(-.5px);
}
.tw-ruler__tick.is-major { height: 12px; }
.tw-ruler__tick.is-half { height: 6px; opacity: .7; }
.tw-ruler__tick b {
    position: absolute;
    bottom: 12px;
    left: 3px;
    font-size: 8px;
    font-weight: 500;
    color: #69747b;
}
.tw-check-stack {
    display: grid;
    gap: 8px;
    margin: 6px 0 15px;
}
.tw-check-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 11px;
    border: 1px solid var(--tw-line);
    border-radius: 8px;
    background: rgba(255,255,255,.018);
    cursor: pointer;
}
.tw-check-option input {
    margin-top: 2px;
    accent-color: var(--tw-gold);
}
.tw-check-option span { display: grid; gap: 3px; }
.tw-check-option strong { color: #d9dddf; font-size: .74rem; }
.tw-check-option small { color: #7f8990; font-size: .66rem; line-height: 1.45; }
.tw-field.is-disabled { opacity: .45; }
.tw-setup-section + .tw-setup-section {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--tw-line);
}
.tw-setup-section__head { margin-bottom: 11px; }
.tw-setup-section__head h3 {
    margin: 4px 0 0;
    color: #e3e7e9;
    font-size: 1rem;
}
.tw-trash-toolbar { margin-bottom: 10px; }
.tw-trash-item { align-items: flex-start; }
.tw-trash-item__copy { min-width: 0; flex: 1; }
.tw-trash-item__actions {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.tw-quiet-button.is-danger { color: #c98787; }
.tw-quiet-button.is-danger:hover { color: #efb1b1; }
@media (max-width: 900px) {
    .tw-app[data-page-mode='a4'] .tw-paper,
    .tw-app[data-page-mode='a4'] .tw-ruler {
        max-width: none;
    }
}


/* ========================================================================== */
/* Phase 1G – Responsive Workspace, Dokument-Zoom & Buchtypografie           */
/* ========================================================================== */

.tw-editor-document {
    min-width: 0;
}

.tw-document-meta__actions {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: wrap;
}

.tw-document-zoom {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    gap: 2px;
    padding: 2px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    background: rgba(13,17,20,.55);
}

.tw-zoom-button,
.tw-zoom-value,
.tw-zoom-fit {
    min-height: 25px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #89949b;
    font-size: .68rem;
    cursor: pointer;
    white-space: nowrap;
}

.tw-zoom-button {
    width: 27px;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
}

.tw-zoom-value {
    min-width: 50px;
    padding: 0 6px;
    color: #c6ccd0;
    font-variant-numeric: tabular-nums;
}

.tw-zoom-fit {
    padding: 0 7px;
}

.tw-zoom-button:hover,
.tw-zoom-value:hover,
.tw-zoom-fit:hover,
.tw-zoom-fit.is-active {
    background: rgba(212,175,55,.10);
    color: var(--tw-gold-soft);
}

.tw-app[data-zoom-mode='fit_width'] #twZoomFitWidth,
.tw-app[data-zoom-mode='fit_page'] #twZoomFitPage {
    background: rgba(212,175,55,.12);
    color: var(--tw-gold-soft);
}

/* A4 darf skaliert werden, ohne den gesamten Workspace künstlich zu verbreitern. */
.tw-app[data-page-mode='a4'] .tw-paper-wrap {
    min-width: 0;
}

.tw-paper-wrap {
    min-width: 0;
}

/* ProseMirror erwartet pre-wrap auf seiner eigentlichen editierbaren Fläche. */
.tw-editor .ProseMirror {
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

/* Literarischer Erstzeileneinzug: Folgeabsätze einrücken, Absatzanfänge nicht. */
.tw-app[data-auto-first-line-indent='true'] .tw-editor .ProseMirror > p:first-child,
.tw-app[data-auto-first-line-indent='true'] .tw-editor .ProseMirror > h1 + p,
.tw-app[data-auto-first-line-indent='true'] .tw-editor .ProseMirror > h2 + p,
.tw-app[data-auto-first-line-indent='true'] .tw-editor .ProseMirror > h3 + p,
.tw-app[data-auto-first-line-indent='true'] .tw-editor .ProseMirror > hr + p,
.tw-app[data-auto-first-line-indent='true'] .tw-editor .ProseMirror > blockquote + p,
.tw-app[data-auto-first-line-indent='true'] .tw-editor .ProseMirror > ul + p,
.tw-app[data-auto-first-line-indent='true'] .tw-editor .ProseMirror > ol + p,
.tw-app[data-auto-first-line-indent='true'] .tw-editor .ProseMirror blockquote p {
    text-indent: 0;
}

@supports selector(p:has(+ p)) {
    .tw-app[data-auto-first-line-indent='true'] .tw-editor .ProseMirror > p:has(> br.ProseMirror-trailingBreak:only-child) + p {
        text-indent: 0;
    }
}

.tw-drawer-backdrop {
    position: fixed;
    z-index: 89;
    inset: var(--tw-top) 0 var(--tw-status);
    border: 0;
    padding: 0;
    background: rgba(0,0,0,.46);
    backdrop-filter: blur(2px);
    cursor: default;
}

@media (max-width: 1180px) {
    .tw-document-meta {
        max-width: 100%;
    }
}

@media (max-width: 920px) {
    .tw-inspector {
        z-index: 97;
    }

    .tw-inspector-toggle {
        display: grid;
    }

    .tw-editor-document {
        padding-left: 18px;
        padding-right: 18px;
    }
}

@media (max-width: 720px) {
    :root {
        --tw-mobile-drawer: min(92vw, 370px);
        --tw-mobile-rail: 72px;
    }

    .tw-toolrail {
        position: fixed;
        z-index: 96;
        top: var(--tw-top);
        bottom: var(--tw-status);
        left: 0;
        display: flex;
        width: var(--tw-mobile-rail);
        padding: 7px 7px;
        transform: translateX(-100%);
        box-shadow: none;
        transition: transform 180ms ease;
    }

    .tw-toolrail.is-open {
        transform: translateX(0);
    }

    .tw-tool {
        min-height: 49px;
    }

    .tw-tool span {
        display: block;
        font-size: .55rem;
    }

    .tw-navigator {
        z-index: 95;
        left: var(--tw-mobile-rail);
        width: calc(var(--tw-mobile-drawer) - var(--tw-mobile-rail));
        max-width: calc(100vw - var(--tw-mobile-rail));
        transform: translateX(calc(-100% - var(--tw-mobile-rail)));
        box-shadow: 24px 0 60px rgba(0,0,0,.34);
    }

    .tw-navigator.is-open {
        transform: translateX(0);
    }

    .tw-editor-document {
        padding: 12px 8px 54px;
    }

    .tw-document-meta {
        width: 100%;
        max-width: 100%;
        align-items: flex-start;
        gap: 8px;
        flex-direction: column;
    }

    .tw-document-meta__actions {
        width: 100%;
        justify-content: flex-start;
    }

    .tw-document-zoom {
        max-width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .tw-document-zoom::-webkit-scrollbar {
        display: none;
    }

    .tw-document-title,
    .tw-formatbar,
    .tw-ruler {
        width: 100%;
        max-width: 100%;
    }

    .tw-paper-wrap {
        justify-content: center;
        overflow: visible;
    }

    .tw-paper {
        flex: 0 0 auto;
    }
}

@media (max-width: 520px) {
    .tw-topbar__right > [data-action='focus-mode'] {
        display: none;
    }

    .tw-project-picker {
        max-width: 48vw;
    }

    .tw-quiet-button[data-action='open-writing-settings'],
    .tw-quiet-button[data-action='manual-version'] {
        font-size: .64rem;
    }

    .tw-zoom-fit {
        padding-inline: 6px;
    }
}

@media (min-width: 721px) and (max-width: 920px) {
    .tw-topbar__left > [data-action='toggle-navigator'] {
        display: none;
    }
}

@media (max-width: 720px) {
    .tw-toolrail {
        overflow-y: auto;
        scrollbar-width: none;
    }

    .tw-toolrail::-webkit-scrollbar {
        display: none;
    }
}

/* ========================================================================== */
/* Phase 2A.1 – Welt & Codex                                                  */
/* ========================================================================== */

.tw-navigator-pane {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.tw-codex-nav-controls {
    display: grid;
    gap: 8px;
    padding: 10px 9px;
    border-bottom: 1px solid var(--tw-line);
}

.tw-codex-search {
    display: flex;
    min-height: 36px;
    align-items: center;
    gap: 7px;
    padding: 0 9px;
    border: 1px solid var(--tw-line-strong);
    border-radius: 8px;
    background: #101417;
    color: #677279;
}

.tw-codex-search:focus-within {
    border-color: rgba(212,175,55,.42);
    box-shadow: 0 0 0 3px rgba(212,175,55,.06);
}

.tw-codex-search input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: #dfe3e5;
    font-size: .74rem;
}

.tw-codex-type-filter {
    width: 100%;
    min-height: 34px;
    padding: 0 9px;
    border: 1px solid var(--tw-line);
    border-radius: 7px;
    outline: 0;
    background: #13181c;
    color: #aab2b7;
    font-size: .7rem;
}

.tw-codex-list {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 8px 7px 14px;
    scrollbar-width: thin;
    scrollbar-color: #394149 transparent;
}

.tw-codex-list-heading {
    padding: 12px 8px 5px;
    color: #69747b;
    font-size: .59rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.tw-codex-list-item {
    display: flex;
    width: 100%;
    min-height: 45px;
    align-items: center;
    gap: 9px;
    margin: 1px 0;
    padding: 7px 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #aeb6bb;
    text-align: left;
    cursor: pointer;
}

.tw-codex-list-item:hover {
    background: rgba(255,255,255,.035);
}

.tw-codex-list-item.is-active {
    border-color: rgba(212,175,55,.2);
    background: rgba(212,175,55,.09);
}

.tw-codex-list-item__icon {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    flex: 0 0 28px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 8px;
    background: rgba(255,255,255,.025);
    color: #89949a;
    font-family: Georgia, serif;
    font-size: .9rem;
}

.tw-codex-list-item.is-active .tw-codex-list-item__icon {
    border-color: rgba(212,175,55,.24);
    background: rgba(212,175,55,.08);
    color: var(--tw-gold-soft);
}

.tw-codex-list-item__copy {
    display: grid;
    min-width: 0;
    flex: 1;
    gap: 3px;
}

.tw-codex-list-item__copy strong,
.tw-codex-list-item__copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tw-codex-list-item__copy strong {
    color: #d9dddf;
    font-size: .76rem;
    font-weight: 700;
}

.tw-codex-list-item__copy small {
    color: #727d84;
    font-size: .63rem;
}

.tw-codex-list-empty {
    display: grid;
    gap: 6px;
    padding: 24px 12px;
    color: #768188;
    text-align: center;
    font-size: .7rem;
    line-height: 1.5;
}

.tw-codex-list-empty strong {
    color: #b8c0c5;
    font-size: .78rem;
}

.tw-codex-workspace {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    background:
        radial-gradient(circle at 48% -10%, rgba(212,175,55,.045), transparent 30rem),
        #20262b;
    scrollbar-width: thin;
}

.tw-codex-empty {
    display: grid;
    width: min(620px, calc(100% - 40px));
    min-height: 100%;
    place-content: center;
    justify-items: center;
    margin: 0 auto;
    padding: 60px 0;
    text-align: center;
}

.tw-codex-empty__mark {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    margin-bottom: 20px;
    border: 1px solid rgba(212,175,55,.35);
    border-radius: 18px;
    background: rgba(212,175,55,.07);
    color: var(--tw-gold-soft);
    font-family: Georgia, serif;
    font-size: 1.55rem;
}

.tw-codex-empty h1 {
    margin: 10px 0 12px;
    color: #f1f3f3;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.8rem, 3vw, 2.7rem);
    font-weight: 500;
}

.tw-codex-empty p {
    max-width: 580px;
    margin: 0 0 24px;
    color: #9ca6ac;
    line-height: 1.7;
}

.tw-codex-editor {
    width: min(980px, calc(100% - 48px));
    margin: 0 auto;
    padding: 34px 0 70px;
}

.tw-codex-editor__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.tw-codex-editor__head > div:first-child {
    min-width: 0;
    flex: 1;
}

.tw-codex-title {
    display: block;
    width: 100%;
    margin-top: 7px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #f5f6f6;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(2rem, 4vw, 3.4rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -.025em;
}

.tw-codex-title::placeholder {
    color: #697279;
}

.tw-codex-editor__actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.tw-codex-save-hint {
    margin-right: 4px;
    color: #6f7a81;
    font-size: .68rem;
    white-space: nowrap;
}

.tw-codex-save-hint.is-dirty {
    color: var(--tw-gold-soft);
}

.tw-codex-editor__body {
    padding: 26px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    background: rgba(19,24,28,.88);
    box-shadow: 0 24px 60px rgba(0,0,0,.12);
}

.tw-codex-form-grid {
    display: grid;
    grid-template-columns: minmax(180px, .75fr) minmax(240px, 1.25fr);
    gap: 14px;
}

.tw-codex-editor .tw-field input,
.tw-codex-editor .tw-field select,
.tw-codex-editor .tw-field textarea {
    background: #101417;
}

.tw-codex-summary-field textarea {
    min-height: 130px;
    resize: vertical;
}

.tw-codex-notes-field textarea {
    min-height: 230px;
    resize: vertical;
}

.tw-codex-next-card {
    display: grid;
    gap: 7px;
    margin-top: 25px;
    padding: 18px;
    border: 1px dashed rgba(212,175,55,.24);
    border-radius: 10px;
    background: rgba(212,175,55,.035);
}

.tw-codex-next-card strong {
    color: #e0e3e4;
    font-size: .82rem;
}

.tw-codex-next-card p {
    margin: 0;
    color: #818c93;
    font-size: .7rem;
    line-height: 1.6;
}

.tw-write-inspector {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.tw-codex-inspector {
    min-height: 0;
    flex: 1;
    overflow: auto;
}

.tw-codex-inspector__empty {
    padding: 20px 16px;
    color: #707b82;
    font-size: .78rem;
    line-height: 1.6;
}

.tw-codex-inspector__content {
    padding: 18px 15px;
}

.tw-codex-inspector-icon {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    margin-bottom: 13px;
    border: 1px solid rgba(212,175,55,.25);
    border-radius: 13px;
    background: rgba(212,175,55,.07);
    color: var(--tw-gold-soft);
    font-family: Georgia, serif;
    font-size: 1.2rem;
}

.tw-codex-inspector__content > strong,
.tw-codex-inspector__content > span {
    display: block;
}

.tw-codex-inspector__content > strong {
    overflow-wrap: anywhere;
    color: #ebeeee;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.18rem;
    font-weight: 500;
}

.tw-codex-inspector__content > span {
    margin-top: 4px;
    color: #7d878e;
    font-size: .69rem;
}

.tw-app[data-workspace-mode='world'] .tw-editor-area {
    background: #20262b;
}

@media (max-width: 920px) {
    .tw-codex-editor {
        width: min(900px, calc(100% - 30px));
        padding-top: 24px;
    }

    .tw-codex-editor__head {
        align-items: flex-start;
        flex-direction: column;
    }

    .tw-codex-editor__actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 720px) {
    .tw-codex-editor {
        width: calc(100% - 20px);
        padding: 18px 0 46px;
    }

    .tw-codex-editor__head {
        gap: 14px;
        margin-bottom: 15px;
    }

    .tw-codex-editor__actions {
        overflow-x: auto;
        justify-content: flex-start;
        scrollbar-width: none;
    }

    .tw-codex-title {
        font-size: clamp(1.8rem, 10vw, 2.7rem);
    }

    .tw-codex-editor__body {
        padding: 16px;
        border-radius: 11px;
    }

    .tw-codex-form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .tw-codex-empty {
        width: calc(100% - 28px);
        padding: 42px 0;
    }
}

/* ========================================================================== */
/* Phase 2B.1 – Planen + einklappbare Arbeitsbereiche                         */
/* ========================================================================== */

.tw-rail-panel-toggle {
    display: grid;
    width: 100%;
    min-height: 34px;
    place-items: center;
    margin-bottom: 7px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #657078;
    cursor: pointer;
}

.tw-rail-panel-toggle svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tw-rail-panel-toggle:hover,
.tw-rail-panel-toggle.is-active {
    border-color: var(--tw-line);
    background: rgba(255,255,255,.035);
    color: var(--tw-gold-soft);
}

.tw-inspector-toggle {
    display: none;
}

.tw-desktop-collapse {
    display: grid;
}

.tw-plan-nav-controls {
    display: grid;
    gap: 8px;
    padding: 10px 9px;
    border-bottom: 1px solid var(--tw-line);
}

.tw-plan-chapter-list {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 8px 7px 14px;
}

.tw-plan-chapter-link {
    display: flex;
    width: 100%;
    min-height: 36px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 1px 0;
    padding: 7px 9px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #aeb6bb;
    text-align: left;
    cursor: pointer;
}

.tw-plan-chapter-link:hover {
    background: rgba(255,255,255,.03);
}

.tw-plan-chapter-link.is-active {
    border-color: rgba(212,175,55,.2);
    background: rgba(212,175,55,.09);
    color: var(--tw-gold-soft);
}

.tw-plan-column.is-nav-target {
    border-color: rgba(212,175,55,.48);
    box-shadow: 0 0 0 2px rgba(212,175,55,.08);
}


.tw-plan-chapter-link span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.tw-plan-chapter-link small {
    flex: 0 0 auto;
    color: #68737b;
    font-size: .64rem;
}

.tw-plan-nav-empty {
    padding: 18px 12px;
    color: #6f797f;
    font-size: .72rem;
    line-height: 1.5;
}

.tw-plan-workspace {
    display: flex;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% -15%, rgba(212,175,55,.045), transparent 30rem),
        #20262b;
}

.tw-plan-workspace__head {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--tw-line);
    background: rgba(17,21,25,.5);
}

.tw-plan-workspace__head h1 {
    margin: 4px 0 5px;
    color: #eef0f1;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.55rem;
    font-weight: 500;
}

.tw-plan-workspace__head p {
    max-width: 680px;
    margin: 0;
    color: #838e95;
    font-size: .76rem;
    line-height: 1.55;
}

.tw-plan-workspace__actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.tw-plan-summary {
    margin-right: 4px;
    color: #778188;
    font-size: .69rem;
    white-space: nowrap;
}

.tw-plan-board {
    display: flex;
    flex: 1;
    min-width: 0;
    min-height: 0;
    align-items: flex-start;
    gap: 14px;
    overflow: auto;
    padding: 18px 20px 28px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: #465058 transparent;
}

.tw-plan-board-empty {
    display: grid;
    width: min(520px, calc(100% - 20px));
    place-items: center;
    gap: 10px;
    margin: auto;
    padding: 44px 24px;
    color: #7d878e;
    text-align: center;
}

.tw-plan-board-empty strong {
    color: #e8eaeb;
    font-family: Georgia, serif;
    font-size: 1.25rem;
    font-weight: 500;
}

.tw-plan-board-empty p {
    margin: 0 0 8px;
}

.tw-plan-column {
    display: flex;
    width: 292px;
    min-width: 292px;
    max-height: 100%;
    flex-direction: column;
    overflow: hidden;
    scroll-snap-align: start;
    border: 1px solid rgba(255,255,255,.085);
    border-radius: 12px;
    background: rgba(18,23,27,.82);
    box-shadow: 0 14px 38px rgba(0,0,0,.13);
    transition: border-color 140ms ease, background 140ms ease;
}

.tw-plan-column.is-drop-target {
    border-color: rgba(212,175,55,.46);
    background: rgba(212,175,55,.055);
}

.tw-plan-column__head {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 14px 12px;
    border-bottom: 1px solid var(--tw-line);
}

.tw-plan-column__head > div {
    min-width: 0;
}

.tw-plan-column__head small,
.tw-plan-column__head strong {
    display: block;
}

.tw-plan-column__head small {
    margin-bottom: 3px;
    color: #657078;
    font-size: .59rem;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.tw-plan-column__head strong {
    overflow: hidden;
    color: #e4e7e8;
    font-size: .8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tw-plan-column__head > span {
    color: #6d777e;
    font-size: .65rem;
}

.tw-plan-card-list {
    display: grid;
    min-height: 72px;
    overflow-y: auto;
    gap: 8px;
    padding: 10px;
    scrollbar-width: thin;
}

.tw-plan-column-empty {
    padding: 20px 12px;
    color: #68737a;
    font-size: .69rem;
    line-height: 1.45;
    text-align: center;
}

.tw-plan-card {
    position: relative;
    display: grid;
    gap: 7px;
    padding: 11px 11px 10px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 9px;
    background: #181e22;
    color: #aeb6bb;
    cursor: pointer;
    transition: border-color 130ms ease, transform 130ms ease, background 130ms ease;
}

.tw-plan-card:hover {
    border-color: rgba(212,175,55,.22);
    transform: translateY(-1px);
}

.tw-plan-card.is-active {
    border-color: rgba(212,175,55,.43);
    background: rgba(212,175,55,.075);
    box-shadow: inset 3px 0 0 rgba(212,175,55,.7);
}

.tw-plan-card.is-dragging {
    opacity: .45;
}

.tw-plan-card.is-drop-before::before,
.tw-plan-card.is-drop-after::after {
    content: '';
    position: absolute;
    right: 3px;
    left: 3px;
    height: 2px;
    border-radius: 2px;
    background: var(--tw-gold);
}

.tw-plan-card.is-drop-before::before { top: -5px; }
.tw-plan-card.is-drop-after::after { bottom: -5px; }

.tw-plan-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tw-plan-status {
    display: inline-flex;
    width: max-content;
    align-items: center;
    min-height: 19px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(127,184,232,.08);
    color: #8db8dc;
    font-size: .57rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.tw-plan-status.is-idea { color: #c7b76e; background: rgba(199,183,110,.09); }
.tw-plan-status.is-revision { color: #d99b72; background: rgba(217,155,114,.09); }
.tw-plan-status.is-final { color: #78c89b; background: rgba(120,200,155,.09); }

.tw-plan-drag {
    color: #5f6970;
    font-size: .78rem;
    letter-spacing: -2px;
    cursor: grab;
}

.tw-plan-card > strong {
    overflow-wrap: anywhere;
    color: #eef0f1;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: .93rem;
    font-weight: 500;
    line-height: 1.25;
}

.tw-plan-plotline {
    width: max-content;
    max-width: 100%;
    overflow: hidden;
    padding: 3px 6px;
    border-radius: 5px;
    background: rgba(127,184,232,.07);
    color: #87aeca;
    font-size: .59rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tw-plan-card p {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: #889299;
    font-size: .68rem;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.tw-plan-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tw-plan-card__meta span {
    padding: 2px 5px;
    border: 1px solid rgba(255,255,255,.055);
    border-radius: 4px;
    color: #717c83;
    font-size: .57rem;
}

.tw-plan-add-scene {
    flex: 0 0 auto;
    min-height: 38px;
    margin: 0 10px 10px;
    border: 1px dashed rgba(255,255,255,.1);
    border-radius: 7px;
    background: transparent;
    color: #7b858c;
    font-size: .69rem;
    cursor: pointer;
}

.tw-plan-add-scene:hover {
    border-color: rgba(212,175,55,.3);
    color: var(--tw-gold-soft);
}

.tw-plan-inspector {
    min-height: 0;
    flex: 1;
    overflow: auto;
}

.tw-plan-inspector__empty {
    padding: 20px 16px;
    color: #707b82;
    font-size: .78rem;
    line-height: 1.6;
}

.tw-plan-inspector__content {
    padding: 0 15px 24px;
}

.tw-plan-inspector__content textarea {
    width: 100%;
    min-height: 74px;
    padding: 9px 10px;
    border: 1px solid var(--tw-line-strong);
    border-radius: 7px;
    outline: none;
    resize: vertical;
    background: #101416;
    color: #d9dddf;
    font: inherit;
    font-size: .75rem;
    line-height: 1.5;
}

.tw-plan-inspector__content textarea:focus {
    border-color: rgba(212,175,55,.45);
    box-shadow: 0 0 0 2px rgba(212,175,55,.07);
}

.tw-inspector-section-head--first {
    margin-top: 0;
    padding-top: 16px;
    border-top: 0;
}

#twPlanSaveHint.is-dirty {
    color: var(--tw-gold);
}

.tw-app[data-workspace-mode='plan'] .tw-editor-area {
    background: #20262b;
}

@media (min-width: 921px) {
    .tw-app {
        --tw-nav-layout: var(--tw-nav);
        --tw-inspector-layout: var(--tw-inspector);
    }

    .tw-app.is-navigator-collapsed { --tw-nav-layout: 0px; }
    .tw-app.is-inspector-collapsed { --tw-inspector-layout: 0px; }

    .tw-app .tw-workspace {
        grid-template-columns: var(--tw-rail) var(--tw-nav-layout) minmax(0, 1fr) var(--tw-inspector-layout);
    }

    .tw-app.is-navigator-collapsed .tw-navigator,
    .tw-app.is-inspector-collapsed .tw-inspector {
        visibility: hidden;
        overflow: hidden;
        border: 0;
        opacity: 0;
        pointer-events: none;
    }

    .tw-app.is-inspector-collapsed .tw-inspector-toggle {
        display: grid;
    }
}

@media (min-width: 721px) and (max-width: 920px) {
    .tw-app.is-navigator-collapsed .tw-workspace {
        grid-template-columns: var(--tw-rail) 0 minmax(0, 1fr);
    }

    .tw-app.is-navigator-collapsed .tw-navigator {
        visibility: hidden;
        overflow: hidden;
        border: 0;
        opacity: 0;
        pointer-events: none;
    }

    .tw-inspector-toggle {
        display: grid;
    }

    .tw-desktop-collapse {
        display: none;
    }
}

@media (max-width: 920px) {
    .tw-plan-workspace__head {
        padding: 18px;
    }

    .tw-plan-workspace__actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .tw-plan-column {
        width: 270px;
        min-width: 270px;
    }
}

@media (max-width: 720px) {
    .tw-rail-panel-toggle,
    .tw-panel-collapse-button,
    .tw-desktop-collapse {
        display: none !important;
    }

    .tw-inspector-toggle {
        display: grid;
    }

    .tw-plan-workspace__head {
        display: grid;
        gap: 12px;
        padding: 15px 14px;
    }

    .tw-plan-workspace__head p {
        display: none;
    }

    .tw-plan-workspace__actions {
        justify-content: flex-start;
    }

    .tw-plan-summary {
        width: 100%;
    }

    .tw-plan-board {
        gap: 10px;
        padding: 12px 12px 24px;
    }

    .tw-plan-column {
        width: min(82vw, 300px);
        min-width: min(82vw, 300px);
    }
}

/* ========================================================================== */
/* PHASE 2A.2 – Profile, Beziehungen, Codex-Bilder & Planungs-Finalisierung   */
/* ========================================================================== */

/* Szenenstatus im Manuskriptbaum: bewusst nur als dezente Punktfarbe. */
.tw-tree-row.is-scene .tw-tree-row__icon {
    transition: color 160ms ease, text-shadow 160ms ease;
}

.tw-tree-row.is-scene .tw-tree-row__icon.is-status-idea {
    color: #7f8c94;
}

.tw-tree-row.is-scene .tw-tree-row__icon.is-status-draft {
    color: #c2a94d;
}

.tw-tree-row.is-scene .tw-tree-row__icon.is-status-revision {
    color: #7d9fbd;
}

.tw-tree-row.is-scene .tw-tree-row__icon.is-status-final {
    color: #78a78a;
}

.tw-tree-row.is-active.is-scene .tw-tree-row__icon {
    text-shadow: 0 0 10px currentColor;
}

.tw-plan-filter-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.tw-plan-column__actions,
.tw-plan-card__actions {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.tw-plan-icon-action {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #78838a;
    font-size: .82rem;
    line-height: 1;
    cursor: pointer;
}

.tw-plan-icon-action:hover {
    border-color: rgba(255,255,255,.10);
    background: rgba(255,255,255,.04);
    color: #d5dade;
}

.tw-plan-icon-action.is-danger:hover {
    border-color: rgba(226,121,121,.24);
    background: rgba(226,121,121,.07);
    color: #e8a0a0;
}

.tw-plan-card {
    position: relative;
    border-left: 2px solid transparent;
}

.tw-plan-card.is-tone-gold { border-left-color: rgba(212,175,55,.75); }
.tw-plan-card.is-tone-blue { border-left-color: rgba(95,143,183,.78); }
.tw-plan-card.is-tone-green { border-left-color: rgba(93,155,116,.78); }
.tw-plan-card.is-tone-purple { border-left-color: rgba(140,111,172,.78); }
.tw-plan-card.is-tone-red { border-left-color: rgba(183,103,103,.78); }
.tw-plan-card.is-tone-slate { border-left-color: rgba(125,137,145,.72); }

.tw-plan-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 7px;
}

.tw-plan-tags span {
    max-width: 100%;
    overflow: hidden;
    padding: 2px 6px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 999px;
    background: rgba(255,255,255,.025);
    color: #818b91;
    font-size: .58rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tw-field select[multiple] {
    min-height: 108px;
    padding: 5px;
}

.tw-field select[multiple] option {
    padding: 6px 8px;
    border-radius: 4px;
}

.tw-codex-image-card {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--tw-line);
}

.tw-codex-image-preview {
    display: grid;
    width: 132px;
    aspect-ratio: 1;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--tw-line-strong);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(212,175,55,.08), rgba(255,255,255,.02));
    color: var(--tw-gold-soft);
    font-size: 2.2rem;
}

.tw-codex-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tw-codex-image-actions {
    display: grid;
    align-content: center;
    gap: 8px;
}

.tw-codex-image-actions > strong {
    color: #e4e7e9;
    font-size: .84rem;
}

.tw-codex-image-actions > small {
    color: #79848b;
    font-size: .67rem;
}

.tw-codex-image-actions > div {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
}

.tw-codex-profile,
.tw-codex-relations,
.tw-codex-usage {
    margin-top: 22px;
    padding-top: 4px;
}

.tw-codex-relation-create {
    display: grid;
    grid-template-columns: minmax(160px, 1.3fr) minmax(150px, 1fr) minmax(150px, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.tw-codex-relation-create select,
.tw-codex-relation-create input {
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid var(--tw-line-strong);
    border-radius: 7px;
    outline: none;
    background: #101417;
    color: #e2e5e7;
}

.tw-codex-relation-list,
.tw-codex-usage-list {
    display: grid;
    gap: 7px;
    margin-top: 10px;
}

.tw-codex-relation-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    padding: 9px 10px;
    border: 1px solid var(--tw-line);
    border-radius: 8px;
    background: rgba(255,255,255,.018);
}

.tw-codex-relation-item__icon {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid rgba(212,175,55,.16);
    border-radius: 8px;
    color: var(--tw-gold-soft);
}

.tw-codex-relation-item__copy,
.tw-codex-usage-item {
    min-width: 0;
}

.tw-codex-relation-item__copy strong,
.tw-codex-relation-item__copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tw-codex-relation-item__copy strong {
    color: #e1e5e7;
    font-size: .75rem;
}

.tw-codex-relation-item__copy small {
    margin-top: 2px;
    color: #7e888e;
    font-size: .65rem;
}

.tw-codex-usage-item {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 10px;
    border: 1px solid var(--tw-line);
    border-radius: 8px;
    background: rgba(255,255,255,.018);
    color: #c8ced1;
    text-align: left;
    cursor: pointer;
}

.tw-codex-usage-item:hover {
    border-color: rgba(212,175,55,.24);
    background: rgba(212,175,55,.04);
}

.tw-codex-usage-item strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .74rem;
}

.tw-codex-usage-item span {
    flex: 0 0 auto;
    color: #758087;
    font-size: .63rem;
}

.tw-codex-mini-empty {
    padding: 10px 11px;
    border: 1px dashed rgba(255,255,255,.08);
    border-radius: 8px;
    color: #737e85;
    font-size: .68rem;
}

.tw-codex-list-item__icon {
    overflow: hidden;
}

.tw-codex-list-item__icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.tw-codex-inspector-image {
    width: 82px;
    height: 82px;
    margin-bottom: 10px;
    object-fit: cover;
    border: 1px solid rgba(212,175,55,.24);
    border-radius: 14px;
}

@media (max-width: 1080px) {
    .tw-codex-relation-create {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 720px) {
    .tw-codex-image-card {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .tw-codex-image-preview {
        width: 92px;
    }

    .tw-codex-relation-create {
        grid-template-columns: 1fr;
    }
}

/* ========================================================================== */
/* PHASE 2C.1 – TIMELINE                                                      */
/* ========================================================================== */

.tw-timeline-nav-controls {
    display: grid;
    gap: 8px;
    padding: 10px 9px 8px;
    border-bottom: 1px solid var(--tw-line);
}

.tw-timeline-nav-list {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 8px 7px 14px;
    scrollbar-width: thin;
    scrollbar-color: #394149 transparent;
}

.tw-timeline-nav-group {
    margin: 8px 0 4px;
    padding: 0 7px;
    color: #68737b;
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tw-timeline-nav-link {
    display: flex;
    width: 100%;
    min-height: 34px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #aeb6bb;
    text-align: left;
    cursor: pointer;
}

.tw-timeline-nav-link:hover {
    background: rgba(255,255,255,.035);
    color: #e1e5e7;
}

.tw-timeline-nav-link span:last-child {
    color: #69747b;
    font-size: .64rem;
    font-variant-numeric: tabular-nums;
}

.tw-timeline-workspace {
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 28px clamp(18px, 3vw, 42px) 70px;
    background:
        radial-gradient(circle at 50% -12%, rgba(212,175,55,.045), transparent 34rem),
        #20262b;
    scrollbar-width: thin;
    scrollbar-color: #4a535a transparent;
}

.tw-timeline-workspace__head {
    display: flex;
    max-width: 1180px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    margin: 0 auto 28px;
}

.tw-timeline-workspace__head h1 {
    margin: 5px 0 8px;
    color: #f0f2f3;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.85rem, 3vw, 2.55rem);
    font-weight: 500;
}

.tw-timeline-workspace__head p {
    max-width: 690px;
    margin: 0;
    color: #8f999f;
    line-height: 1.6;
}

.tw-timeline-workspace__actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
}

.tw-timeline-stream {
    position: relative;
    display: grid;
    max-width: 1040px;
    gap: 0;
    margin: 0 auto;
    padding: 8px 0 30px;
}

.tw-timeline-stream::before {
    content: '';
    position: absolute;
    top: 26px;
    bottom: 34px;
    left: 154px;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(212,175,55,.26) 5%, rgba(255,255,255,.12) 92%, transparent);
}

.tw-timeline-group {
    position: relative;
    display: grid;
    grid-template-columns: 136px minmax(0,1fr);
    gap: 36px;
    padding: 0 0 24px;
}

.tw-timeline-date {
    position: sticky;
    top: 12px;
    align-self: start;
    padding: 13px 0 0;
    color: #8b959b;
    font-size: .72rem;
    font-weight: 750;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.tw-timeline-date strong {
    display: block;
    color: #dfe3e5;
    font-size: .88rem;
    font-weight: 750;
}

.tw-timeline-date small {
    display: block;
    margin-top: 3px;
    color: #6d777e;
    font-size: .62rem;
}

.tw-timeline-group__items {
    display: grid;
    gap: 10px;
}

.tw-timeline-card {
    --tw-timeline-accent: var(--tw-gold);
    position: relative;
    display: grid;
    gap: 7px;
    min-height: 78px;
    padding: 13px 15px 13px 17px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    background: rgba(15,19,22,.78);
    color: #cfd5d8;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(0,0,0,.10);
}

.tw-timeline-card::before {
    content: '';
    position: absolute;
    top: 21px;
    left: -42px;
    width: 11px;
    height: 11px;
    border: 2px solid #20262b;
    border-radius: 50%;
    background: var(--tw-timeline-accent);
    box-shadow: 0 0 0 1px rgba(212,175,55,.22);
}

.tw-timeline-card::after {
    content: '';
    position: absolute;
    top: 26px;
    left: -31px;
    width: 28px;
    height: 1px;
    background: rgba(255,255,255,.11);
}

.tw-timeline-card:hover {
    border-color: rgba(212,175,55,.22);
    background: rgba(18,23,27,.92);
}

.tw-timeline-card.is-active {
    border-color: rgba(212,175,55,.42);
    background: rgba(212,175,55,.075);
    box-shadow: 0 10px 34px rgba(0,0,0,.16), inset 0 0 0 1px rgba(212,175,55,.06);
}

.tw-timeline-card[data-color='blue'] { --tw-timeline-accent: #7fb8e8; }
.tw-timeline-card[data-color='green'] { --tw-timeline-accent: #70c897; }
.tw-timeline-card[data-color='purple'] { --tw-timeline-accent: #b497df; }
.tw-timeline-card[data-color='red'] { --tw-timeline-accent: #e27979; }
.tw-timeline-card[data-color='slate'] { --tw-timeline-accent: #88949c; }
.tw-timeline-card[data-color='gold'] { --tw-timeline-accent: #d4af37; }

.tw-timeline-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tw-timeline-card__type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #748087;
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.tw-timeline-card__type-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--tw-timeline-accent);
}

.tw-timeline-card__time {
    color: #727d84;
    font-size: .66rem;
    font-variant-numeric: tabular-nums;
}

.tw-timeline-card__head-actions {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
}

.tw-timeline-card__delete {
    width: 23px;
    height: 23px;
    opacity: .55;
}

.tw-timeline-card:hover .tw-timeline-card__delete,
.tw-timeline-card:focus-within .tw-timeline-card__delete,
.tw-timeline-card.is-active .tw-timeline-card__delete {
    opacity: 1;
}

.tw-timeline-card:focus-visible {
    outline: 2px solid rgba(212,175,55,.48);
    outline-offset: 2px;
}

.tw-timeline-card strong {
    overflow: hidden;
    color: #eef0f1;
    font-size: .9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tw-timeline-card p {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: #8f999f;
    font-size: .72rem;
    line-height: 1.48;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tw-timeline-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 10px;
    color: #68737a;
    font-size: .64rem;
}

.tw-timeline-card__status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.tw-timeline-card__status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #747f86;
}

.tw-timeline-card__status[data-status='idea']::before { background: #7fb8e8; }
.tw-timeline-card__status[data-status='draft']::before { background: #d4af37; }
.tw-timeline-card__status[data-status='revision']::before { background: #b497df; }
.tw-timeline-card__status[data-status='final']::before { background: #70c897; }

.tw-timeline-empty {
    max-width: 720px;
    margin: 90px auto 0;
    padding: 36px;
    border: 1px dashed rgba(255,255,255,.12);
    border-radius: 14px;
    color: #88939a;
    text-align: center;
}

.tw-timeline-empty strong {
    display: block;
    margin-bottom: 8px;
    color: #e7eaec;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.35rem;
    font-weight: 500;
}

.tw-timeline-inspector {
    min-height: 0;
    flex: 1;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: #394149 transparent;
}

.tw-timeline-inspector__empty {
    padding: 20px 16px;
    color: #707b82;
    font-size: .78rem;
    line-height: 1.6;
}

.tw-timeline-inspector__content {
    padding: 0 15px 24px;
}

.tw-timeline-approximate {
    margin-bottom: 13px;
}

@media (max-width: 1050px) {
    .tw-timeline-stream::before { left: 118px; }
    .tw-timeline-group { grid-template-columns: 100px minmax(0,1fr); gap: 36px; }
}

@media (max-width: 720px) {
    .tw-timeline-workspace { padding: 18px 12px 54px; }
    .tw-timeline-workspace__head { display: grid; align-items: start; }
    .tw-timeline-workspace__actions { justify-content: space-between; }
    .tw-timeline-stream::before { left: 14px; }
    .tw-timeline-group { display: block; padding-left: 36px; }
    .tw-timeline-date { position: static; margin: 0 0 8px; padding: 0; text-align: left; }
    .tw-timeline-date strong, .tw-timeline-date small { display: inline; margin-right: 6px; }
    .tw-timeline-card::before { left: -28px; }
    .tw-timeline-card::after { left: -17px; width: 14px; }
}

/* ========================================================================== */
/* PHASE 2D.1 – KAPITELANSICHT, SZENENAUFTEILUNG & MANUSKRIPTMETRIKEN        */
/* ========================================================================== */

.tw-selection-scene-button:not(:disabled) {
    border-color: rgba(212,175,55,.24);
    color: var(--tw-gold-soft);
}

.tw-chapter-view {
    width: min(1040px, calc(100% - 42px));
    margin: 0 auto;
    padding: 36px 0 88px;
}

.tw-chapter-view__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 16px;
}

.tw-chapter-view__head h1 {
    margin: 7px 0 6px;
    color: #f2f3f3;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 500;
    line-height: 1.08;
}

.tw-chapter-view__head p {
    margin: 0;
    color: #879199;
    font-size: .75rem;
}

.tw-chapter-view__actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.tw-chapter-view__hint {
    margin-bottom: 18px;
    padding: 11px 13px;
    border: 1px solid rgba(212,175,55,.16);
    border-radius: 9px;
    background: rgba(212,175,55,.035);
    color: #8e989e;
    font-size: .7rem;
    line-height: 1.55;
}

.tw-chapter-scenes {
    display: grid;
    gap: 18px;
}

.tw-chapter-scene {
    overflow: auto;
    max-height: calc(100dvh - 32px);
    overscroll-behavior: contain;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 12px;
    background: rgba(16,20,23,.78);
    box-shadow: 0 16px 42px rgba(0,0,0,.13);
}

.tw-chapter-scene__head {
    display: flex;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 14px;
    border-bottom: 1px solid rgba(255,255,255,.075);
    background: rgba(255,255,255,.018);
}

.tw-chapter-scene__head > div {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
}

.tw-chapter-scene__head strong {
    overflow: hidden;
    color: #e9ebec;
    font-size: .8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tw-chapter-scene__head > div:last-child {
    flex: 0 0 auto;
    color: #737e85;
    font-size: .65rem;
}

.tw-chapter-scene__status {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #778188;
    box-shadow: 0 0 0 3px rgba(119,129,136,.08);
}

.tw-chapter-scene__status.is-idea { background: #7fb8e8; box-shadow: 0 0 0 3px rgba(127,184,232,.08); }
.tw-chapter-scene__status.is-draft { background: #d4af37; box-shadow: 0 0 0 3px rgba(212,175,55,.08); }
.tw-chapter-scene__status.is-revision { background: #b497df; box-shadow: 0 0 0 3px rgba(180,151,223,.08); }
.tw-chapter-scene__status.is-final { background: #70c897; box-shadow: 0 0 0 3px rgba(112,200,151,.08); }

.tw-chapter-scene__content {
    width: min(760px, calc(100% - 48px));
    margin: 0 auto;
    padding: 34px 0 40px;
    color: #d9dcde;
    font-family: var(--tw-editor-font-family, Georgia, 'Times New Roman', serif);
    font-size: .88rem;
    line-height: 1.7;
}

.tw-chapter-scene__content p {
    margin: 0 0 .75em;
    white-space: pre-wrap;
}

.tw-chapter-scene__content h1,
.tw-chapter-scene__content h2,
.tw-chapter-scene__content h3 {
    margin: 1.2em 0 .65em;
    color: #edf0f1;
    font-family: inherit;
    font-weight: 650;
    line-height: 1.25;
}

.tw-chapter-scene__content h1 { font-size: 1.55em; }
.tw-chapter-scene__content h2 { font-size: 1.32em; }
.tw-chapter-scene__content h3 { font-size: 1.16em; }

.tw-chapter-scene__content blockquote {
    margin: 1em 0;
    padding: .2em 0 .2em 1em;
    border-left: 3px solid rgba(212,175,55,.3);
    color: #aeb5b9;
}

.tw-chapter-scene__content ul,
.tw-chapter-scene__content ol {
    margin: .75em 0 .9em 1.8em;
    padding: 0;
}

.tw-chapter-scene__content hr {
    width: 34%;
    margin: 2em auto;
    border: 0;
    border-top: 1px solid rgba(255,255,255,.16);
}

.tw-chapter-loading,
.tw-chapter-empty {
    padding: 46px 24px;
    border: 1px dashed rgba(255,255,255,.11);
    border-radius: 12px;
    color: #7f8a91;
    text-align: center;
}

.tw-chapter-loading.is-error {
    border-color: rgba(226,121,121,.28);
    color: #d99595;
}

.tw-chapter-empty strong {
    display: block;
    margin-bottom: 7px;
    color: #e6e9ea;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.15rem;
    font-weight: 500;
}

.tw-chapter-empty p {
    max-width: 590px;
    margin: 0 auto 18px;
    font-size: .74rem;
    line-height: 1.6;
}

.tw-modal--scene-selection {
    width: min(510px, calc(100vw - 32px));
}

.tw-scene-selection-copy {
    margin: 4px 0 2px;
}

.tw-status-extra {
    white-space: nowrap;
}

@media (max-width: 900px) {
    .tw-chapter-view {
        width: min(100% - 28px, 900px);
        padding-top: 24px;
    }

    .tw-chapter-view__head {
        align-items: flex-start;
    }

    .tw-chapter-scene__content {
        width: min(100% - 34px, 720px);
        padding: 26px 0 32px;
    }
}

@media (max-width: 720px) {
    .tw-chapter-view {
        width: calc(100% - 20px);
        padding: 18px 0 64px;
    }

    .tw-chapter-view__head {
        display: grid;
        gap: 14px;
    }

    .tw-chapter-view__actions {
        justify-content: flex-start;
    }

    .tw-chapter-view__actions .tw-btn {
        min-height: 38px;
        padding-inline: 12px;
        font-size: .72rem;
    }

    .tw-chapter-scene__head {
        align-items: flex-start;
        padding: 10px 11px;
    }

    .tw-chapter-scene__head > div:last-child {
        display: grid;
        justify-items: end;
        gap: 3px;
    }

    .tw-chapter-scene__content {
        width: calc(100% - 28px);
        padding: 22px 0 26px;
        font-size: .84rem;
    }

    .tw-statusbar .tw-status-extra {
        display: none;
    }
}

/* Kapitelvorschau folgt denselben Einzugsregeln wie die Schreibansicht. */
.tw-app[data-auto-first-line-indent='true'] .tw-chapter-scene__content > p {
    text-indent: var(--tw-editor-first-line-indent);
}

.tw-app[data-auto-first-line-indent='true'] .tw-chapter-scene__content > p:first-child,
.tw-app[data-auto-first-line-indent='true'] .tw-chapter-scene__content > h1 + p,
.tw-app[data-auto-first-line-indent='true'] .tw-chapter-scene__content > h2 + p,
.tw-app[data-auto-first-line-indent='true'] .tw-chapter-scene__content > h3 + p,
.tw-app[data-auto-first-line-indent='true'] .tw-chapter-scene__content > hr + p,
.tw-app[data-auto-first-line-indent='true'] .tw-chapter-scene__content > blockquote + p,
.tw-app[data-auto-first-line-indent='true'] .tw-chapter-scene__content > ul + p,
.tw-app[data-auto-first-line-indent='true'] .tw-chapter-scene__content > ol + p {
    text-indent: 0;
}

.tw-app[data-auto-first-line-indent='false'] .tw-chapter-scene__content p {
    text-indent: 0;
}

.tw-chapter-scene__content [data-indent-level='1'] { margin-left: 1.5em; }
.tw-chapter-scene__content [data-indent-level='2'] { margin-left: 3em; }
.tw-chapter-scene__content [data-indent-level='3'] { margin-left: 4.5em; }
.tw-chapter-scene__content [data-indent-level='4'] { margin-left: 6em; }
.tw-chapter-scene__content [data-indent-level='5'] { margin-left: 7.5em; }
.tw-chapter-scene__content [data-indent-level='6'] { margin-left: 9em; }

/* ========================================================================== */
/* PHASE 2E.1 – ANALYSE, NICHT-SCROLLENDE TOOLBAR & KAPITEL-PAPIERTHEMA       */
/* ========================================================================== */

/* Die wichtigsten Schreibfunktionen dürfen nicht seitlich verschwinden. */
.tw-formatbar {
    flex-wrap: wrap;
    overflow-x: visible;
    overflow-y: visible;
    row-gap: 4px;
    height: auto;
}

.tw-formatbar__group {
    flex-wrap: nowrap;
}

@media (max-width: 820px) {
    .tw-formatbar {
        width: min(var(--tw-editor-page-width), calc(100% - 2px));
        justify-content: flex-start;
    }
    .tw-formatbar__separator {
        display: none;
    }
}

/* Kapitelansicht: derselbe Papiercharakter wie in der Szenenansicht. */
.tw-chapter-scene {
    background: var(--tw-paper);
    color: var(--tw-paper-text);
}
.tw-chapter-scene__content {
    color: var(--tw-paper-text);
    font-family: var(--tw-editor-font-family, Georgia, 'Times New Roman', serif);
    font-size: var(--tw-editor-font-size, 12pt);
    line-height: var(--tw-editor-line-height, 1.72);
}
.tw-chapter-scene__content h1,
.tw-chapter-scene__content h2,
.tw-chapter-scene__content h3 {
    color: inherit;
}
.tw-chapter-scene__content blockquote {
    color: color-mix(in srgb, var(--tw-paper-text) 78%, transparent);
}
.tw-app[data-paper-theme='white'] .tw-chapter-scene {
    background: #fff;
    color: #202020;
}
.tw-app[data-paper-theme='white'] .tw-chapter-scene__content { color: #202020; }
.tw-app[data-paper-theme='sepia'] .tw-chapter-scene {
    background: #eee1c6;
    color: #2f2921;
}
.tw-app[data-paper-theme='sepia'] .tw-chapter-scene__content { color: #2f2921; }
.tw-app[data-paper-theme='dark'] .tw-chapter-scene {
    background: #171a1d;
    color: #e6e3dc;
    border-color: rgba(255,255,255,.07);
}
.tw-app[data-paper-theme='dark'] .tw-chapter-scene__content { color: #e6e3dc; }

.tw-analysis-toolbar {
    position: sticky;
    z-index: 22;
    top: 0;
    display: grid;
    width: min(1160px, calc(100% - 30px));
    min-width: 0;
    margin: 14px auto 8px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--tw-line);
    border-radius: 10px;
    background: rgba(14,18,21,.94);
    box-shadow: 0 12px 34px rgba(0,0,0,.16);
    backdrop-filter: blur(14px);
}
.tw-analysis-toolbar__top,
.tw-analysis-toolbar__bottom {
    display: grid;
    min-width: 0;
    align-items: center;
    column-gap: 12px;
    padding-inline: 10px;
}
.tw-analysis-toolbar__top {
    grid-template-columns: minmax(0,1fr) auto;
    min-height: 50px;
    padding-top: 7px;
    padding-bottom: 7px;
}
.tw-analysis-toolbar__bottom {
    grid-template-columns: minmax(0,1fr) auto;
    min-height: 38px;
    border-top: 1px solid rgba(255,255,255,.055);
    padding-top: 5px;
    padding-bottom: 6px;
}
.tw-analysis-toolbar__actions,
.tw-analysis-toolbar__filters {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
}
.tw-analysis-toolbar__actions {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
}
.tw-analysis-toolbar__actions::-webkit-scrollbar { display: none; }
.tw-analysis-toolbar__actions .tw-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}
.tw-analysis-toolbar__filters {
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
}
.tw-analysis-toolbar__filters::-webkit-scrollbar { display: none; }
.tw-analysis-toolbar__filters label {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
    min-height: 28px;
    padding: 0 6px;
    border-radius: 7px;
    color: #8f999f;
    font-size: .64rem;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
}
.tw-analysis-toolbar__filters label:hover { background: rgba(255,255,255,.035); }
.tw-analysis-toolbar__filters input {
    width: 14px;
    height: 14px;
    margin: 0;
    flex: 0 0 auto;
    accent-color: var(--tw-gold);
}
.tw-analysis-service-state {
    min-width: 48px;
    flex: 0 0 auto;
    color: #758087;
    font-size: .65rem;
    line-height: 1;
    text-align: right;
    white-space: nowrap;
}
.tw-analysis-service-state.is-busy { color: var(--tw-gold-soft); }
.tw-analysis-service-state.is-error { color: var(--tw-red); }
.tw-analysis-service-state.is-ok { color: var(--tw-green); }

.tw-analysis-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
}
.tw-analysis-dot.is-spelling { background: #e27979; }
.tw-analysis-dot.is-grammar { background: #d89a55; }
.tw-analysis-dot.is-punctuation { background: #7fb8e8; }
.tw-analysis-dot.is-style { background: #b497df; }

.tw-analysis-inspector {
    min-height: 0;
    flex: 1;
    overflow: auto;
}
.tw-analysis-inspector__empty {
    padding: 20px 16px;
    color: #707b82;
    font-size: .76rem;
    line-height: 1.6;
}
.tw-analysis-inspector__empty strong {
    display: block;
    margin-bottom: 6px;
    color: #e2e5e7;
}
.tw-analysis-inspector__empty p { margin: 0; }
.tw-analysis-inspector__content { padding: 15px; }

.tw-analysis-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 7px;
    margin-bottom: 14px;
}
.tw-analysis-summary-grid button {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 9px;
    border: 1px solid var(--tw-line);
    border-radius: 8px;
    background: rgba(255,255,255,.018);
    color: #8b969c;
    font-size: .64rem;
    cursor: pointer;
}
.tw-analysis-summary-grid button:first-child { grid-column: 1 / -1; }
.tw-analysis-summary-grid button:hover,
.tw-analysis-summary-grid button.is-active {
    border-color: rgba(212,175,55,.28);
    background: rgba(212,175,55,.055);
    color: #dce0e2;
}
.tw-analysis-summary-grid strong { color: #eef0f1; font-size: .8rem; }

.tw-analysis-current {
    margin: 8px 0 16px;
    padding: 12px;
    border: 1px solid rgba(212,175,55,.16);
    border-radius: 9px;
    background: rgba(212,175,55,.025);
}
.tw-analysis-current__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.tw-analysis-kind {
    font-size: .63rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.tw-analysis-current__head small { color: #657078; font-size: .59rem; }
.tw-analysis-current > strong { color: #e7eaeb; font-size: .76rem; line-height: 1.45; }
.tw-analysis-current__excerpt {
    margin: 9px 0;
    padding: 8px 9px;
    border-radius: 6px;
    background: rgba(0,0,0,.16);
    color: #aab2b7;
    font: .7rem/1.55 Georgia, 'Times New Roman', serif;
    overflow-wrap: anywhere;
}
.tw-analysis-replacements {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}
.tw-analysis-replacement {
    padding: 5px 8px;
    border: 1px solid rgba(112,200,151,.24);
    border-radius: 999px;
    background: rgba(112,200,151,.055);
    color: #a9ddbf;
    font-size: .65rem;
    cursor: pointer;
}
.tw-analysis-replacement:hover { background: rgba(112,200,151,.1); }
.tw-analysis-current__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tw-analysis-findings {
    display: grid;
    gap: 6px;
}
.tw-analysis-finding {
    display: grid;
    gap: 4px;
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--tw-line);
    border-left-width: 3px;
    border-radius: 8px;
    background: rgba(255,255,255,.018);
    color: #aab2b7;
    text-align: left;
    cursor: pointer;
}
.tw-analysis-finding:hover,
.tw-analysis-finding.is-active { background: rgba(255,255,255,.04); }
.tw-analysis-finding.is-spelling { border-left-color: #e27979; }
.tw-analysis-finding.is-grammar { border-left-color: #d89a55; }
.tw-analysis-finding.is-punctuation { border-left-color: #7fb8e8; }
.tw-analysis-finding.is-style { border-left-color: #b497df; }
.tw-analysis-finding strong { color: #e8ebec; font-size: .69rem; }
.tw-analysis-finding span { overflow: hidden; font-size: .63rem; text-overflow: ellipsis; white-space: nowrap; }
.tw-analysis-finding small { color: #69747b; font-size: .59rem; }

.tw-analysis-dictionary {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--tw-line);
}
.tw-analysis-dictionary summary {
    color: var(--tw-gold-soft);
    font-size: .68rem;
    font-weight: 800;
    cursor: pointer;
}
.tw-analysis-dictionary__form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    margin: 10px 0 7px;
}
.tw-analysis-dictionary__form input,
.tw-analysis-dictionary__form select {
    width: 100%;
    min-height: 36px;
    padding: 0 9px;
    border: 1px solid var(--tw-line-strong);
    border-radius: 7px;
    outline: none;
    background: #101417;
    color: #dfe3e4;
}
.tw-analysis-dictionary__list {
    display: grid;
    gap: 5px;
    max-height: 220px;
    overflow: auto;
    margin-top: 9px;
}
.tw-analysis-dictionary-word {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 8px;
    border: 1px solid var(--tw-line);
    border-radius: 7px;
    color: #a9b1b6;
    font-size: .65rem;
}
.tw-analysis-dictionary-word button {
    border: 0;
    background: transparent;
    color: #778188;
    cursor: pointer;
}
.tw-analysis-dictionary-word button:hover { color: var(--tw-red); }

/* ProseMirror-Dekorationen für die Analyse.
   2E.3: Unterstreichung + sehr leichte Flächenmarkierung bleiben auch bei
   verkleinertem A4-Zoom klar sichtbar, ohne den Lesetext zu überdecken. */
.tw-editor .ProseMirror .tw-analysis-mark {
    border-radius: 3px;
    padding: 0 .015em;
    text-decoration-line: underline;
    text-decoration-thickness: 2.2px;
    text-underline-offset: 3px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    cursor: pointer;
    transition: background-color .12s ease, box-shadow .12s ease;
}
.tw-editor .ProseMirror .tw-analysis-mark.is-spelling {
    background: rgba(216,95,95,.11);
    text-decoration-color: #c94343;
    text-decoration-style: wavy;
}
.tw-editor .ProseMirror .tw-analysis-mark.is-grammar {
    background: rgba(214,146,75,.11);
    text-decoration-color: #c57a2f;
    text-decoration-style: wavy;
}
.tw-editor .ProseMirror .tw-analysis-mark.is-punctuation {
    background: rgba(108,168,218,.12);
    text-decoration-color: #3f91d1;
    text-decoration-style: dotted;
}
.tw-editor .ProseMirror .tw-analysis-mark.is-style {
    background: rgba(170,133,210,.12);
    text-decoration-color: #8f61c2;
    text-decoration-style: dotted;
}
.tw-editor .ProseMirror .tw-analysis-mark.is-current {
    background: rgba(212,175,55,.24) !important;
    box-shadow: inset 0 -2px 0 rgba(133,101,0,.42), 0 0 0 1px rgba(212,175,55,.24);
}

.tw-app[data-workspace-mode='analysis'] .tw-formatbar { display: none; }
.tw-app[data-workspace-mode='analysis'] .tw-document-title { margin-top: 8px; }

@media (max-width: 920px) {
    .tw-analysis-toolbar { width: calc(100% - 20px); }
    .tw-analysis-toolbar__top,
    .tw-analysis-toolbar__bottom {
        grid-template-columns: minmax(0,1fr);
    }
    .tw-analysis-mode-switch,
    .tw-analysis-service-state { justify-self: end; }
}
.tw-analysis-kind.is-spelling { color: #e89a9a; }
.tw-analysis-kind.is-grammar { color: #e2b27a; }
.tw-analysis-kind.is-punctuation { color: #9ac9ef; }
.tw-analysis-kind.is-style { color: #c2a5e5; }

/* ========================================================================== */
/* Phase 2E.2 – Autorenanalyse & Projektakte                                  */
/* ========================================================================== */

.tw-analysis-dot.is-structure { background: #72c6ad; }
.tw-analysis-finding.is-structure { border-left-color: #72c6ad; }
.tw-analysis-kind.is-structure { color: #8ed7c1; }
.tw-editor .ProseMirror .tw-analysis-mark.is-structure {
    background: rgba(100,185,159,.12);
    text-decoration-color: #459c82;
    text-decoration-style: dotted;
}

.tw-analysis-dot.is-consistency { background: #5bc4d7; }
.tw-analysis-finding.is-consistency { border-left-color: #5bc4d7; }
.tw-analysis-kind.is-consistency { color: #86d9e7; }
.tw-editor .ProseMirror .tw-analysis-mark.is-consistency {
    background: rgba(91,196,215,.14);
    text-decoration-color: #2b9db2;
    text-decoration-style: double;
}

/* Fundstellen bleiben kompakt, aber deutlich besser lesbar als in 2E.1. */
.tw-analysis-finding strong {
    font-size: .73rem;
    line-height: 1.35;
}
.tw-analysis-finding span {
    font-size: .69rem;
    line-height: 1.4;
}
.tw-analysis-finding small {
    color: #7c878e;
    font-size: .65rem;
    line-height: 1.45;
}

.tw-analysis-profile {
    margin: 0 0 14px;
    padding: 11px;
    border: 1px solid var(--tw-line);
    border-radius: 9px;
    background: rgba(255,255,255,.015);
}
.tw-analysis-profile .tw-inspector-section-head { margin: 0 0 9px; }
.tw-analysis-profile__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 6px;
}
.tw-analysis-profile__grid > div {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid rgba(255,255,255,.055);
    border-radius: 7px;
    background: rgba(0,0,0,.08);
}
.tw-analysis-profile__grid span {
    color: #6f7a81;
    font-size: .59rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.tw-analysis-profile__grid strong {
    color: #e4e8e9;
    font-size: .78rem;
}

.tw-project-delete-gap { margin-top: 10px; }

.tw-modal--project-metadata {
    width: min(1040px, calc(100vw - 36px));
    max-width: 1040px;
    max-height: calc(100vh - 54px);
    overflow: auto;
    padding: 22px;
}
.tw-project-metadata-intro {
    max-width: 760px;
    margin: 4px 0 18px;
    color: #8e989f;
    font-size: .76rem;
    line-height: 1.55;
}
.tw-project-metadata-layout {
    display: grid;
    grid-template-columns: 210px minmax(0,1fr);
    gap: 22px;
    align-items: start;
}
.tw-project-cover-panel {
    position: sticky;
    top: 0;
    display: grid;
    gap: 10px;
}
.tw-project-cover-frame {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border: 1px solid var(--tw-line-strong);
    border-radius: 9px;
    background: #0f1316;
}
.tw-project-cover-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tw-project-cover-empty {
    display: grid;
    width: 100%;
    height: 100%;
    place-content: center;
    gap: 7px;
    padding: 18px;
    color: #7e888e;
    text-align: center;
}
.tw-project-cover-empty span {
    color: var(--tw-gold-soft);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.35rem;
}
.tw-project-cover-empty small { font-size: .67rem; }
.tw-project-cover-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tw-project-metadata-form {
    display: grid;
    min-width: 0;
    gap: 18px;
}
.tw-project-meta-section {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--tw-line);
    border-radius: 10px;
    background: rgba(255,255,255,.012);
}
.tw-project-meta-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--tw-line);
}
.tw-project-meta-section__head span {
    color: #e6e9ea;
    font-size: .82rem;
    font-weight: 750;
}
.tw-project-meta-section__head small {
    color: #69747a;
    font-size: .62rem;
}
.tw-project-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 10px;
}
.tw-project-meta-span-2 { grid-column: 1 / -1; }
.tw-project-metadata-form textarea {
    resize: vertical;
    min-height: 76px;
}
.tw-project-metadata-actions {
    align-items: center;
    justify-content: flex-end;
}
.tw-project-metadata-actions > .tw-field-help {
    margin-right: auto;
}

@media (max-width: 780px) {
    .tw-modal--project-metadata {
        width: calc(100vw - 20px);
        padding: 16px;
    }
    .tw-project-metadata-layout {
        grid-template-columns: 1fr;
    }
    .tw-project-cover-panel {
        position: static;
        grid-template-columns: 120px minmax(0,1fr);
        align-items: start;
    }
    .tw-project-cover-frame { width: 120px; }
    .tw-project-cover-actions { align-content: start; }
    .tw-project-cover-panel > .tw-field-help { grid-column: 2; }
}

@media (max-width: 520px) {
    .tw-project-meta-grid { grid-template-columns: 1fr; }
    .tw-project-meta-span-2 { grid-column: auto; }
    .tw-project-cover-panel { grid-template-columns: 1fr; }
    .tw-project-cover-panel > .tw-field-help { grid-column: auto; }
    .tw-project-cover-frame { width: min(150px, 55vw); }
}

/* ========================================================================== */
/* Phase 2F.1 · Weltenbaum                                                   */
/* ========================================================================== */
.tw-worldtree-nav {
    min-height: 0;
}

.tw-worldtree-nav-controls {
    display: grid;
    gap: 12px;
    padding: 12px 10px;
    border-bottom: 1px solid var(--tw-line);
}

.tw-worldtree-filter-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

.tw-worldtree-filter-list label {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
    padding: 7px 8px;
    border: 1px solid rgba(255,255,255,.055);
    border-radius: 8px;
    background: rgba(255,255,255,.018);
    color: #939da4;
    font-size: .64rem;
    cursor: pointer;
    transition: 150ms ease;
}

.tw-worldtree-filter-list label:hover {
    border-color: rgba(255,255,255,.1);
    background: rgba(255,255,255,.035);
    color: #c0c6ca;
}

.tw-worldtree-filter-list input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.tw-worldtree-filter-list label:has(input:not(:checked)) {
    opacity: .42;
}

.tw-worldtree-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #78848c;
    box-shadow: 0 0 0 3px rgba(120,132,140,.08);
}
.tw-worldtree-dot.is-manuscript { background: #d4af37; }
.tw-worldtree-dot.is-character { background: #73c9a1; }
.tw-worldtree-dot.is-location { background: #79b7e6; }
.tw-worldtree-dot.is-object { background: #d99a66; }
.tw-worldtree-dot.is-organization { background: #bd8bd9; }
.tw-worldtree-dot.is-world { background: #5fc7c9; }
.tw-worldtree-dot.is-lore { background: #9ea8af; }
.tw-worldtree-dot.is-plotline { background: #e47f8b; }
.tw-worldtree-dot.is-timeline { background: #e1c873; }

.tw-worldtree-nav-toggle {
    display: flex;
    width: 100%;
    min-height: 39px;
    align-items: center;
    gap: 9px;
    padding: 0 10px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 8px;
    background: rgba(255,255,255,.02);
    color: #8e989e;
    text-align: left;
    cursor: pointer;
}

.tw-worldtree-nav-toggle:hover,
.tw-worldtree-nav-toggle[aria-pressed='true'] {
    border-color: rgba(212,175,55,.25);
    background: rgba(212,175,55,.07);
    color: var(--tw-gold-soft);
}

.tw-worldtree-nav-toggle strong {
    font-size: .67rem;
    font-weight: 700;
}

.tw-worldtree-nav-hint {
    margin: 0;
    color: #657078;
    font-size: .61rem;
    line-height: 1.5;
}

.tw-worldtree-search-results {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 7px;
    scrollbar-width: thin;
}

.tw-worldtree-search-hit {
    display: grid;
    width: 100%;
    gap: 2px;
    padding: 8px 9px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #aeb6bb;
    text-align: left;
    cursor: pointer;
}

.tw-worldtree-search-hit:hover,
.tw-worldtree-search-hit.is-active {
    background: rgba(212,175,55,.07);
    color: var(--tw-gold-soft);
}

.tw-worldtree-search-hit strong {
    overflow: hidden;
    font-size: .7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tw-worldtree-search-hit small {
    color: #68747b;
    font-size: .59rem;
}

.tw-worldtree-nav-summary {
    color: #78838a;
    font-size: .62rem;
    line-height: 1.45;
}

.tw-worldtree-workspace {
    display: flex;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 42%, rgba(212,175,55,.055), transparent 31rem),
        linear-gradient(180deg, #1c2328, #171d21);
}

.tw-worldtree-workspace__head {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    padding: 18px 22px 15px;
    border-bottom: 1px solid var(--tw-line);
    background: rgba(13,17,20,.62);
    backdrop-filter: blur(12px);
}

.tw-worldtree-workspace__head h1 {
    margin: 3px 0 4px;
    color: #eef0f1;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.55rem;
    font-weight: 500;
}

.tw-worldtree-workspace__head p {
    max-width: 720px;
    margin: 0;
    color: #7f8a91;
    font-size: .72rem;
    line-height: 1.5;
}

.tw-worldtree-workspace__actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
}

.tw-worldtree-workspace__actions .tw-btn {
    min-height: 36px;
    padding: 0 12px;
    font-size: .67rem;
}

.tw-worldtree-lensbar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 7px 14px;
    border-bottom: 1px solid rgba(255,255,255,.065);
    background: rgba(11,15,18,.72);
}

.tw-worldtree-lens-tabs {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 3px;
    padding: 3px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    background: rgba(255,255,255,.025);
}

.tw-worldtree-lens-tab,
.tw-worldtree-step,
.tw-worldtree-play {
    min-height: 30px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #8f9aa0;
    font: inherit;
    font-size: .64rem;
    font-weight: 650;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.tw-worldtree-lens-tab { padding: 0 10px; }
.tw-worldtree-lens-tab:hover,
.tw-worldtree-lens-tab.is-active,
.tw-worldtree-lens-tab[aria-pressed='true'] {
    background: rgba(212,175,55,.1);
    color: #f1df9f;
}

.tw-worldtree-lens-controls {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
    gap: 7px;
}

.tw-worldtree-lens-controls[hidden] { display: none !important; }

.tw-worldtree-step {
    width: 30px;
    flex: 0 0 30px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.08);
    font-size: 1rem;
}

.tw-worldtree-play {
    flex: 0 0 auto;
    padding: 0 10px;
    border: 1px solid rgba(212,175,55,.18);
    color: #d9c16d;
}

.tw-worldtree-step:hover,
.tw-worldtree-play:hover,
.tw-worldtree-play[aria-pressed='true'] {
    background: rgba(255,255,255,.045);
    color: #fff0b3;
}

.tw-worldtree-range {
    flex: 1 1 160px;
    min-width: 90px;
    max-width: 330px;
    accent-color: #d4af37;
}

.tw-worldtree-lens-position {
    flex: 0 0 auto;
    min-width: 46px;
    color: #77838a;
    font-size: .61rem;
    text-align: center;
}

.tw-worldtree-lens-current {
    flex: 1 1 170px;
    min-width: 0;
    overflow: hidden;
    color: #b8c1c6;
    font-size: .65rem;
    font-weight: 620;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tw-worldtree-speed {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
    color: #6f7b82;
    font-size: .58rem;
}

.tw-worldtree-speed select {
    height: 28px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 7px;
    background: #171d21;
    color: #aeb7bc;
    font: inherit;
    font-size: .61rem;
}

.tw-worldtree-canvas {
    position: relative;
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    cursor: grab;
    background-image:
        radial-gradient(circle at center, rgba(255,255,255,.025) 0 1px, transparent 1.5px);
    background-size: 28px 28px;
}

.tw-worldtree-canvas.is-panning { cursor: grabbing; }

#twWorldTreeSvg {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    user-select: none;
}

.tw-worldtree-3d-toggle {
    border-left: 1px solid rgba(255,255,255,.06);
}

.tw-worldtree-3d-toggle[disabled] {
    opacity: .42;
    cursor: not-allowed;
}

.tw-worldtree-3d-canvas {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: grab;
    outline: none;
    background:
        radial-gradient(circle at 50% 48%, rgba(212,175,55,.055), transparent 32%),
        radial-gradient(circle at center, rgba(255,255,255,.018) 0 1px, transparent 1.5px);
    background-size: auto, 28px 28px;
}

.tw-worldtree-3d-canvas:active { cursor: grabbing; }

.tw-worldtree-3d-hint {
    position: absolute;
    z-index: 4;
    left: 14px;
    bottom: 14px;
    padding: 7px 9px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 8px;
    background: rgba(10,14,17,.78);
    color: #77838a;
    font-size: .56rem;
    pointer-events: none;
    backdrop-filter: blur(10px);
}

.tw-worldtree-edge {
    fill: none;
    stroke: rgba(128,141,149,.22);
    stroke-width: 1.15;
    vector-effect: non-scaling-stroke;
    transition: opacity 140ms ease, stroke 140ms ease, stroke-width 140ms ease;
}

.tw-worldtree-edge.is-structural {
    stroke: rgba(212,175,55,.12);
    stroke-dasharray: 3 7;
}

.tw-worldtree-edge.is-related {
    stroke: rgba(220,229,232,.48);
    stroke-width: 1.75;
}

.tw-worldtree-edge.is-path {
    stroke: #f1cf64;
    stroke-width: 3;
    stroke-dasharray: 8 5;
    filter: url(#twWorldTreeGlow);
    animation: twWorldTreeFlow 1.15s linear infinite;
}

.tw-worldtree-edge.is-story-active {
    stroke: #f2d36b;
    stroke-width: 2.8;
    stroke-dasharray: 7 5;
    filter: url(#twWorldTreeGlow);
    animation: twWorldTreeFlow 1.25s linear infinite;
}

.tw-worldtree-edge.is-time-active {
    stroke: #74d2d5;
    stroke-width: 2.8;
    stroke-dasharray: 3 5;
    filter: url(#twWorldTreeGlow);
    animation: twWorldTreeFlow .95s linear infinite;
}

@keyframes twWorldTreeFlow {
    to { stroke-dashoffset: -24; }
}

.tw-worldtree-edge.is-muted { opacity: .07; }

.tw-worldtree-edge-label {
    fill: #9ca7ad;
    font-size: 10px;
    font-weight: 650;
    paint-order: stroke;
    stroke: #171d21;
    stroke-width: 4px;
    stroke-linejoin: round;
    pointer-events: none;
}

.tw-worldtree-node {
    cursor: pointer;
    outline: none;
    transition: opacity 140ms ease;
}

.tw-worldtree-node.is-muted { opacity: .11; }
.tw-worldtree-node.is-search-muted { opacity: .16; }

.tw-worldtree-node__halo {
    fill: transparent;
    stroke: transparent;
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
}

.tw-worldtree-node.is-orphan-highlight .tw-worldtree-node__halo {
    stroke: rgba(226,121,121,.88);
    stroke-dasharray: 4 4;
    filter: url(#twWorldTreeGlow);
}

.tw-worldtree-node__circle {
    stroke: rgba(255,255,255,.16);
    stroke-width: 1.25;
    vector-effect: non-scaling-stroke;
    transition: stroke 140ms ease, stroke-width 140ms ease, filter 140ms ease;
}

.tw-worldtree-node.is-chapter .tw-worldtree-node__circle {
    fill-opacity: 1;
    stroke: rgba(235,207,106,.48);
    stroke-width: 1.8;
}

.tw-worldtree-node.is-scene .tw-worldtree-node__circle {
    fill-opacity: .82;
    stroke-width: 1;
}

.tw-worldtree-node:hover .tw-worldtree-node__circle,
.tw-worldtree-node.is-selected .tw-worldtree-node__circle {
    stroke: rgba(245,231,172,.95);
    stroke-width: 2.4;
    filter: url(#twWorldTreeGlow);
}

.tw-worldtree-node.is-path .tw-worldtree-node__circle {
    stroke: #f3d36d;
    stroke-width: 3;
    filter: url(#twWorldTreeGlow);
}

.tw-worldtree-node.is-story-active,
.tw-worldtree-node.is-time-active {
    opacity: 1;
}

.tw-worldtree-node.is-story-active .tw-worldtree-node__circle {
    stroke: #f1d166;
    stroke-width: 2.7;
    filter: url(#twWorldTreeGlow);
}

.tw-worldtree-node.is-time-active .tw-worldtree-node__circle {
    stroke: #78dadd;
    stroke-width: 2.7;
    filter: url(#twWorldTreeGlow);
}

.tw-worldtree-node.is-lens-seed .tw-worldtree-node__halo {
    stroke: rgba(244,225,146,.84);
    stroke-width: 2.4;
    filter: url(#twWorldTreeGlow);
    animation: twWorldTreePulse 1.55s ease-in-out infinite;
}

.tw-worldtree-node.is-time-active.is-lens-seed .tw-worldtree-node__halo {
    stroke: rgba(112,215,219,.88);
}

@keyframes twWorldTreePulse {
    0%, 100% { opacity: .35; stroke-width: 1.4; }
    50% { opacity: 1; stroke-width: 3.2; }
}

.tw-worldtree-node__label {
    fill: #b8c1c6;
    font-size: 11px;
    font-weight: 620;
    paint-order: stroke;
    stroke: #171d21;
    stroke-width: 4px;
    stroke-linejoin: round;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 120ms ease, visibility 0s linear 120ms;
}

.tw-worldtree-node.is-label-visible .tw-worldtree-node__label,
.tw-worldtree-node:hover .tw-worldtree-node__label,
.tw-worldtree-node:focus .tw-worldtree-node__label,
.tw-worldtree-node:focus-visible .tw-worldtree-node__label,
.tw-worldtree-node.is-selected .tw-worldtree-node__label {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

.tw-worldtree-node.is-hub .tw-worldtree-node__label {
    fill: #e5e9eb;
    font-size: 12px;
    font-weight: 760;
    letter-spacing: .02em;
}

.tw-worldtree-node.is-project .tw-worldtree-node__label {
    fill: #f4e8b9;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 15px;
}

.tw-worldtree-node.is-chapter .tw-worldtree-node__label {
    fill: #d9dfe2;
    font-size: 11.5px;
    font-weight: 720;
}

.tw-worldtree-node.is-scene .tw-worldtree-node__label {
    font-size: 10.5px;
    font-weight: 650;
}

.tw-worldtree-node[data-group='manuscript'] .tw-worldtree-node__circle { fill: #b6952d; }
.tw-worldtree-node[data-group='character'] .tw-worldtree-node__circle { fill: #4b9f79; }
.tw-worldtree-node[data-group='location'] .tw-worldtree-node__circle { fill: #4f8fbe; }
.tw-worldtree-node[data-group='object'] .tw-worldtree-node__circle { fill: #b97849; }
.tw-worldtree-node[data-group='organization'] .tw-worldtree-node__circle { fill: #8c5aa6; }
.tw-worldtree-node[data-group='world'] .tw-worldtree-node__circle { fill: #3f9899; }
.tw-worldtree-node[data-group='lore'] .tw-worldtree-node__circle { fill: #66737b; }
.tw-worldtree-node[data-group='plotline'] .tw-worldtree-node__circle { fill: #af5663; }
.tw-worldtree-node[data-group='timeline'] .tw-worldtree-node__circle { fill: #a79043; }
.tw-worldtree-node.is-project .tw-worldtree-node__circle { fill: url(#twWorldTreeProjectFill); }
.tw-worldtree-node.is-hub .tw-worldtree-node__circle { fill-opacity: .68; }

.tw-worldtree-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 8px;
    padding: 28px;
    color: #738088;
    text-align: center;
    pointer-events: none;
}

.tw-worldtree-empty[hidden] { display: none !important; }

.tw-worldtree-empty__mark {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    margin-bottom: 5px;
    border: 1px solid rgba(212,175,55,.22);
    border-radius: 50%;
    background: rgba(212,175,55,.055);
    color: var(--tw-gold-soft);
    font-size: 1.35rem;
}

.tw-worldtree-empty strong { color: #c9d0d4; font-size: .82rem; }
.tw-worldtree-empty span { max-width: 420px; font-size: .68rem; line-height: 1.55; }

.tw-worldtree-zoom {
    position: absolute;
    right: 14px;
    bottom: 14px;
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 9px;
    background: rgba(13,17,20,.78);
    box-shadow: 0 10px 30px rgba(0,0,0,.2);
    backdrop-filter: blur(10px);
}

.tw-worldtree-zoom button {
    width: 34px;
    height: 33px;
    border: 0;
    background: transparent;
    color: #aab3b8;
    cursor: pointer;
}

.tw-worldtree-zoom button:hover { background: rgba(255,255,255,.05); color: #fff; }
.tw-worldtree-zoom span { min-width: 57px; color: #8a959b; font-size: .63rem; text-align: center; }

.tw-worldtree-path-hint {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    padding: 9px 13px;
    border: 1px solid rgba(212,175,55,.25);
    border-radius: 999px;
    background: rgba(17,21,25,.9);
    color: var(--tw-gold-soft);
    font-size: .66rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.24);
    pointer-events: none;
}

.tw-worldtree-lens-card {
    position: absolute;
    top: 14px;
    left: 14px;
    display: grid;
    max-width: min(430px, calc(100% - 110px));
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid rgba(212,175,55,.16);
    border-radius: 10px;
    background: rgba(13,17,20,.82);
    box-shadow: 0 14px 36px rgba(0,0,0,.24);
    backdrop-filter: blur(10px);
    pointer-events: none;
}

.tw-worldtree-lens-card[hidden] { display: none !important; }
.tw-worldtree-lens-card > span {
    color: #b89c43;
    font-size: .55rem;
    font-weight: 760;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.tw-worldtree-lens-card > strong {
    overflow: hidden;
    color: #edf0f1;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: .9rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-worldtree-lens-card > small {
    color: #849097;
    font-size: .61rem;
    line-height: 1.45;
}

.tw-worldtree-inspector {
    min-height: 0;
    overflow: auto;
    scrollbar-width: thin;
}

.tw-worldtree-inspector__empty {
    display: grid;
    gap: 7px;
    padding: 20px 16px;
    color: #737e85;
    font-size: .68rem;
    line-height: 1.5;
}

.tw-worldtree-inspector__empty strong { color: #b7c0c5; font-size: .78rem; }
.tw-worldtree-inspector__empty p { margin: 0; }

.tw-worldtree-inspector__content {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.tw-worldtree-inspector__type {
    width: max-content;
    max-width: 100%;
    padding: 5px 8px;
    border: 1px solid rgba(212,175,55,.18);
    border-radius: 999px;
    background: rgba(212,175,55,.055);
    color: var(--tw-gold-soft);
    font-size: .58rem;
    font-weight: 780;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tw-worldtree-inspector__content h3 {
    margin: 0;
    color: #edf0f1;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.08rem;
    font-weight: 500;
    line-height: 1.3;
}

.tw-worldtree-inspector__content > p {
    margin: -4px 0 0;
    color: #7e8990;
    font-size: .66rem;
    line-height: 1.55;
}

.tw-worldtree-orphan-note {
    padding: 9px 10px;
    border: 1px solid rgba(226,121,121,.18);
    border-radius: 8px;
    background: rgba(226,121,121,.055);
    color: #cf9999;
    font-size: .64rem;
    line-height: 1.45;
}

.tw-worldtree-inspector__actions {
    display: grid;
    gap: 7px;
}

.tw-worldtree-inspector__actions .tw-btn { min-height: 36px; font-size: .66rem; }

.tw-worldtree-inspector__links {
    display: grid;
    gap: 7px;
    padding-top: 3px;
}

.tw-worldtree-link-row {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 4px 8px;
    padding: 8px 9px;
    border: 1px solid rgba(255,255,255,.05);
    border-radius: 8px;
    background: rgba(255,255,255,.018);
    color: #aab3b8;
    text-align: left;
    cursor: pointer;
}

.tw-worldtree-link-row:hover {
    border-color: rgba(212,175,55,.18);
    background: rgba(212,175,55,.045);
}

.tw-worldtree-link-row strong {
    overflow: hidden;
    color: #d7dcdf;
    font-size: .68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tw-worldtree-link-row span {
    grid-column: 1 / -1;
    color: #6d7880;
    font-size: .59rem;
}

.tw-worldtree-link-row small {
    color: #68747b;
    font-size: .56rem;
    white-space: nowrap;
}

.tw-app[data-workspace-mode='worldtree'] .tw-editor-area {
    overflow: hidden;
}

@media (max-width: 1180px) {
    .tw-worldtree-workspace__head {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }
    .tw-worldtree-workspace__actions { flex-wrap: wrap; }
}

@media (max-width: 720px) {
    .tw-worldtree-workspace__head {
        padding: 14px 13px 11px;
    }
    .tw-worldtree-workspace__head p { display: none; }
    .tw-worldtree-workspace__actions .tw-plan-summary { width: 100%; }
    .tw-worldtree-filter-list { grid-template-columns: 1fr; }
    .tw-worldtree-zoom { right: 9px; bottom: 9px; }
    .tw-worldtree-node__label { font-size: 13px; }
}


@media (max-width: 1050px) {
    .tw-worldtree-lensbar { align-items: stretch; flex-direction: column; gap: 6px; }
    .tw-worldtree-lens-controls { width: 100%; }
    .tw-worldtree-lens-current { flex-basis: 130px; }
}

@media (max-width: 720px) {
    .tw-worldtree-lensbar { padding: 6px 8px; }
    .tw-worldtree-lens-tabs { width: 100%; }
    .tw-worldtree-lens-tab { flex: 1 1 0; padding: 0 5px; }
    .tw-worldtree-lens-current { display: none; }
    .tw-worldtree-speed { display: none; }
    .tw-worldtree-range { min-width: 70px; max-width: none; }
    .tw-worldtree-lens-card { top: 9px; left: 9px; max-width: calc(100% - 96px); }
}

@media (prefers-reduced-motion: reduce) {
    .tw-worldtree-edge.is-path,
    .tw-worldtree-edge.is-story-active,
    .tw-worldtree-edge.is-time-active,
    .tw-worldtree-node.is-lens-seed .tw-worldtree-node__halo { animation: none; }
}

/* PHASE 2F.3 – WELTENBAUM: VERKNÜPFEN & KONSISTENZ */
.tw-worldtree-consistency-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tw-worldtree-consistency-toggle.is-active,
.tw-worldtree-consistency-toggle[aria-pressed='true'] {
    border-color: rgba(242,184,80,.3);
    background: rgba(242,184,80,.085);
    color: #f0c56f;
}
.tw-worldtree-consistency-toggle span {
    display: inline-grid;
    min-width: 18px;
    height: 18px;
    place-items: center;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(242,184,80,.14);
    color: #f5d99d;
    font-size: .56rem;
    font-weight: 800;
}

.tw-worldtree-link-hint {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    padding: 9px 13px;
    border: 1px solid rgba(100,195,171,.32);
    border-radius: 999px;
    background: rgba(14,24,23,.94);
    color: #a9e1d2;
    font-size: .66rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.24);
    pointer-events: none;
}

.tw-worldtree-node.is-link-source,
.tw-worldtree-node.is-link-target,
.tw-worldtree-node.is-link-candidate {
    opacity: 1;
}
.tw-worldtree-node.is-link-source .tw-worldtree-node__halo {
    stroke: rgba(212,175,55,.98);
    stroke-width: 3;
    filter: url(#twWorldTreeGlow);
    animation: twWorldTreePulse 1.35s ease-in-out infinite;
}
.tw-worldtree-node.is-link-target .tw-worldtree-node__halo {
    stroke: rgba(92,205,174,.98);
    stroke-width: 3;
    filter: url(#twWorldTreeGlow);
}
.tw-worldtree-node.is-link-candidate .tw-worldtree-node__circle {
    stroke: rgba(92,205,174,.62);
    stroke-width: 2;
}
.tw-worldtree-node.is-link-candidate:hover .tw-worldtree-node__circle {
    stroke: #7fe0c6;
    stroke-width: 3;
    filter: url(#twWorldTreeGlow);
}

.tw-worldtree-node.has-consistency-warning .tw-worldtree-node__halo {
    stroke: rgba(242,184,80,.82);
    stroke-width: 2.1;
    stroke-dasharray: 2 3;
}
.tw-worldtree-node.has-consistency-high .tw-worldtree-node__halo {
    stroke: rgba(232,116,116,.95);
    stroke-width: 2.5;
}
.tw-worldtree-warning-badge circle {
    fill: #d6a545;
    stroke: #171d21;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}
.tw-worldtree-warning-badge.is-high circle { fill: #d56b6b; }
.tw-worldtree-warning-badge text {
    fill: #15191c;
    font-size: 7px;
    font-weight: 900;
    pointer-events: none;
}

.tw-worldtree-relation-button.is-active {
    border-color: rgba(92,205,174,.28);
    background: rgba(92,205,174,.07);
    color: #a6decf;
}
.tw-worldtree-relation-editor,
.tw-worldtree-inspector__warnings {
    display: grid;
    gap: 9px;
    padding: 11px;
    border: 1px solid rgba(255,255,255,.065);
    border-radius: 10px;
    background: rgba(255,255,255,.018);
}
.tw-worldtree-relation-editor[hidden],
.tw-worldtree-inspector__warnings[hidden] { display: none !important; }
.tw-worldtree-relation-pair {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
    align-items: center;
    gap: 7px;
    color: #6f7b82;
    font-size: .62rem;
}
.tw-worldtree-relation-pair strong {
    overflow: hidden;
    padding: 7px 8px;
    border: 1px solid rgba(92,205,174,.15);
    border-radius: 7px;
    background: rgba(92,205,174,.035);
    color: #cad4d8;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-worldtree-relation-editor .tw-field { margin: 0; }
.tw-worldtree-relation-editor .tw-field > span { font-size: .61rem; }
.tw-worldtree-relation-editor input {
    width: 100%;
    min-height: 34px;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 7px;
    background: rgba(8,11,13,.55);
    color: #d9dfe2;
    padding: 7px 9px;
    font: inherit;
    font-size: .66rem;
}
.tw-worldtree-relation-editor input:focus {
    border-color: rgba(212,175,55,.35);
    outline: none;
    box-shadow: 0 0 0 2px rgba(212,175,55,.07);
}
.tw-worldtree-relation-actions {
    display: flex;
    justify-content: flex-end;
    gap: 7px;
}
.tw-worldtree-relation-actions .tw-btn { min-height: 33px; font-size: .62rem; }

.tw-worldtree-warning-item {
    display: grid;
    gap: 4px;
    padding: 8px 9px;
    border-left: 2px solid rgba(242,184,80,.78);
    border-radius: 6px;
    background: rgba(242,184,80,.04);
}
.tw-worldtree-warning-item.is-high {
    border-left-color: rgba(232,116,116,.9);
    background: rgba(232,116,116,.045);
}
.tw-worldtree-warning-item strong {
    color: #ddd4bd;
    font-size: .64rem;
    line-height: 1.35;
}
.tw-worldtree-warning-item.is-high strong { color: #e3b0b0; }
.tw-worldtree-warning-item small {
    color: #7d888f;
    font-size: .58rem;
    line-height: 1.45;
}

.tw-worldtree-link-item {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 5px;
    align-items: stretch;
}
.tw-worldtree-link-item .tw-worldtree-link-row { min-width: 0; }
.tw-worldtree-link-delete {
    width: 30px;
    min-height: 100%;
    border: 1px solid rgba(226,121,121,.08);
    border-radius: 8px;
    background: rgba(226,121,121,.025);
    color: #9b6d6d;
    font: inherit;
    font-size: 1rem;
    cursor: pointer;
}
.tw-worldtree-link-delete:hover {
    border-color: rgba(226,121,121,.24);
    background: rgba(226,121,121,.07);
    color: #e09b9b;
}
.tw-worldtree-node.is-link-source .tw-worldtree-node__halo {
    stroke: rgba(212,175,55,.98);
    stroke-dasharray: none;
}
.tw-worldtree-node.is-link-target .tw-worldtree-node__halo {
    stroke: rgba(92,205,174,.98);
    stroke-dasharray: none;
}

/* ========================================================================== */
/* Phase 2G.1 · Recherche / Wissensbasis                                      */
/* ========================================================================== */
.tw-research-nav {
    min-height: 0;
}
.tw-research-nav-controls {
    padding: 0 12px 12px;
    border-bottom: 1px solid var(--tw-line);
}
.tw-research-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 8px;
}
.tw-research-filter-grid select {
    min-width: 0;
}
.tw-research-list {
    min-height: 0;
    overflow: auto;
    padding: 10px 9px 14px;
}
.tw-research-list-item {
    display: grid;
    width: 100%;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin: 0 0 7px;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--tw-text);
    text-align: left;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}
.tw-research-list-item:hover {
    border-color: rgba(120, 214, 198, .24);
    background: rgba(120, 214, 198, .055);
}
.tw-research-list-item.is-active {
    border-color: rgba(120, 214, 198, .48);
    background: linear-gradient(135deg, rgba(120, 214, 198, .12), rgba(120, 214, 198, .035));
    box-shadow: inset 3px 0 0 rgba(120, 214, 198, .78);
}
.tw-research-list-item__icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid rgba(120, 214, 198, .23);
    border-radius: 9px;
    background: rgba(120, 214, 198, .08);
    color: #a9eadf;
    font-size: .9rem;
}
.tw-research-list-item__body {
    min-width: 0;
}
.tw-research-list-item__body strong,
.tw-research-list-item__body small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-research-list-item__body strong {
    color: #e8ecec;
    font-size: .78rem;
    line-height: 1.25;
}
.tw-research-list-item__body small {
    margin-top: 4px;
    color: #77838a;
    font-size: .62rem;
}
.tw-research-list-item__restore {
    color: #9fe4d7;
    font-size: 1rem;
}
.tw-research-trash-banner {
    display: grid;
    gap: 3px;
    margin-bottom: 10px;
    padding: 10px 11px;
    border: 1px dashed rgba(226, 121, 121, .25);
    border-radius: 9px;
    background: rgba(226, 121, 121, .045);
}
.tw-research-trash-banner strong {
    color: #e9b3b3;
    font-size: .7rem;
}
.tw-research-trash-banner span {
    color: #7d878e;
    font-size: .62rem;
    line-height: 1.45;
}
.tw-research-nav-summary {
    color: #7d888f;
    font-size: .65rem;
}

.tw-research-workspace {
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: auto;
    padding: 22px clamp(18px, 3vw, 38px) 40px;
    background:
        radial-gradient(circle at 78% 12%, rgba(120, 214, 198, .05), transparent 28rem),
        var(--tw-bg-2);
}
.tw-research-empty {
    display: grid;
    min-height: 100%;
    place-items: center;
    align-content: center;
    padding: 40px 24px;
    text-align: center;
}
.tw-research-empty .tw-empty-icon {
    display: grid;
    width: 62px;
    height: 62px;
    place-items: center;
    margin-bottom: 14px;
    border: 1px solid rgba(120, 214, 198, .3);
    border-radius: 20px;
    background: rgba(120, 214, 198, .065);
    color: #9fe4d7;
    font-size: 1.8rem;
}
.tw-research-empty h2 {
    margin: 0;
    color: #edf1f1;
    font-size: 1.3rem;
}
.tw-research-empty p {
    max-width: 620px;
    margin: 10px 0 20px;
    color: #8b969d;
    font-size: .78rem;
    line-height: 1.7;
}
.tw-research-editor {
    width: min(1180px, 100%);
    margin: 0 auto;
}
.tw-research-editor__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--tw-line);
}
.tw-research-editor__head > div:first-child {
    min-width: 0;
    flex: 1;
}
.tw-research-title {
    width: 100%;
    margin-top: 4px;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: #f0f3f3;
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    font-weight: 760;
    line-height: 1.2;
}
.tw-research-title::placeholder {
    color: #59636a;
}
.tw-research-editor__actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
}
.tw-research-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}
.tw-research-card {
    padding: 18px;
    border: 1px solid var(--tw-line);
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(255,255,255,.026), rgba(255,255,255,.012));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.tw-research-card + .tw-research-card--wide,
.tw-research-card--wide + .tw-research-card--wide {
    margin-top: 14px;
}
.tw-research-card h3 {
    margin: 0 0 15px;
    color: #dce2e2;
    font-size: .82rem;
    letter-spacing: .02em;
}
.tw-research-card .tw-field:last-child {
    margin-bottom: 0;
}
.tw-research-card input,
.tw-research-card select,
.tw-research-card textarea {
    width: 100%;
    border: 1px solid var(--tw-line-strong);
    border-radius: 8px;
    outline: none;
    background: #101417;
    color: #e1e5e5;
}
.tw-research-card input,
.tw-research-card select {
    min-height: 40px;
    padding: 0 10px;
}
.tw-research-card textarea {
    resize: vertical;
    min-height: 94px;
    padding: 10px 11px;
    line-height: 1.55;
}
.tw-research-card input:focus,
.tw-research-card select:focus,
.tw-research-card textarea:focus {
    border-color: rgba(120, 214, 198, .5);
    box-shadow: 0 0 0 3px rgba(120, 214, 198, .065);
}
.tw-research-content {
    min-height: 300px !important;
    font-family: inherit;
    font-size: .84rem;
    line-height: 1.72 !important;
}
.tw-research-url-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}
.tw-research-url-row .tw-btn {
    min-height: 40px;
    padding-inline: 12px;
}
.tw-research-attachments-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 12px;
}
.tw-research-attachments-head h3 {
    margin-bottom: 4px;
}
.tw-research-attachments-head p {
    margin: 0;
    color: #77828a;
    font-size: .68rem;
}
.tw-research-upload-button {
    flex: 0 0 auto;
    cursor: pointer;
}
.tw-research-attachment-progress {
    margin: 0 0 10px;
    padding: 9px 11px;
    border: 1px solid rgba(120, 214, 198, .2);
    border-radius: 8px;
    background: rgba(120, 214, 198, .055);
    color: #a7d9d0;
    font-size: .7rem;
}
.tw-research-attachments {
    display: grid;
    gap: 8px;
    margin-bottom: 9px;
}
.tw-research-attachments-empty,
.tw-research-links-empty {
    padding: 12px;
    border: 1px dashed var(--tw-line-strong);
    border-radius: 8px;
    color: #6f7a81;
    font-size: .68rem;
    text-align: center;
}
.tw-research-attachment {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 11px;
    border: 1px solid var(--tw-line);
    border-radius: 9px;
    background: rgba(255,255,255,.018);
}
.tw-research-attachment__main {
    min-width: 0;
}
.tw-research-attachment__main strong,
.tw-research-attachment__main small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-research-attachment__main strong {
    color: #dfe5e4;
    font-size: .73rem;
}
.tw-research-attachment__main small {
    margin-top: 3px;
    color: #6f7a81;
    font-size: .61rem;
}
.tw-research-attachment__actions {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
}
.tw-research-attachment__actions .tw-btn {
    min-height: 32px;
    padding-inline: 10px;
    font-size: .65rem;
}

.tw-research-inspector {
    min-height: 0;
    height: 100%;
    overflow: auto;
}
.tw-research-inspector__empty {
    padding: 22px 16px;
    color: #748087;
    font-size: .73rem;
    line-height: 1.6;
}
.tw-research-inspector__empty strong {
    display: block;
    margin-bottom: 5px;
    color: #d5dddd;
}
.tw-research-inspector__empty p {
    margin: 0;
}
.tw-research-inspector__content {
    padding: 16px;
}
.tw-research-inspector__content > h3 {
    margin: 5px 0 4px;
    color: #e5ebea;
    font-size: 1rem;
    line-height: 1.3;
}
.tw-research-inspector__content > p {
    margin: 0;
    color: #758189;
    font-size: .67rem;
}
.tw-research-link-editor {
    margin-top: 16px;
    padding-top: 15px;
    border-top: 1px solid var(--tw-line);
}
.tw-research-link-editor .tw-field {
    margin-bottom: 9px;
}
.tw-research-link-editor .tw-field > span {
    font-size: .62rem;
}
.tw-research-link-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 26px;
    align-items: center;
    gap: 7px;
    margin-top: 7px;
    padding: 8px 7px 8px 9px;
    border: 1px solid var(--tw-line);
    border-radius: 8px;
    background: rgba(255,255,255,.018);
}
.tw-research-link-row > div {
    min-width: 0;
}
.tw-research-link-row strong,
.tw-research-link-row small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-research-link-row strong {
    color: #d8e0df;
    font-size: .65rem;
}
.tw-research-link-row small {
    margin-top: 3px;
    color: #6e7a81;
    font-size: .58rem;
}
.tw-research-link-row button {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #8a959b;
    cursor: pointer;
}
.tw-research-link-row button:hover {
    background: rgba(226,121,121,.12);
    color: #efaaaa;
}

/* Recherche bekommt im Weltenbaum eine eigene, ruhige Akzentfarbe. */
.tw-worldtree-dot.is-research { background: #78d6c6; }
.tw-worldtree-node[data-group='research'] .tw-worldtree-node__circle { fill: #4cae9e; }

@media (max-width: 1080px) {
    .tw-research-grid {
        grid-template-columns: 1fr;
    }
    .tw-research-editor__head {
        align-items: stretch;
        flex-direction: column;
    }
    .tw-research-editor__actions {
        justify-content: space-between;
    }
}
@media (max-width: 720px) {
    .tw-research-workspace {
        padding: 14px 12px 30px;
    }
    .tw-research-card {
        padding: 14px;
    }
    .tw-research-filter-grid,
    .tw-research-card .tw-setting-row {
        grid-template-columns: 1fr;
    }
    .tw-research-attachments-head,
    .tw-research-attachment {
        align-items: stretch;
        flex-direction: column;
    }
    .tw-research-attachment__actions .tw-btn {
        flex: 1;
    }
}

/* ========================================================================== */
/* Phase 2G.2b · Lektorat / Freigaben                                        */
/* ========================================================================== */
.tw-review-nav-intro {
    margin: 0 12px 10px;
    padding: 10px 11px;
    border: 1px solid rgba(212,175,55,.16);
    border-radius: 9px;
    background: rgba(212,175,55,.045);
    color: #8f9aa0;
    font-size: .64rem;
    line-height: 1.55;
}
.tw-review-share-list {
    min-height: 0;
    flex: 1;
    overflow: auto;
    padding: 0 8px 10px;
}
.tw-review-nav-item {
    display: grid;
    width: 100%;
    grid-template-columns: 9px minmax(0,1fr) auto;
    align-items: center;
    gap: 9px;
    margin: 3px 0;
    padding: 10px 9px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.tw-review-nav-item:hover { background: rgba(255,255,255,.035); }
.tw-review-nav-item.is-active {
    border-color: rgba(212,175,55,.24);
    background: rgba(212,175,55,.07);
}
.tw-review-nav-item > span:nth-child(2) { min-width: 0; }
.tw-review-nav-item strong,
.tw-review-nav-item small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-review-nav-item strong { color: #dbe1e2; font-size: .68rem; }
.tw-review-nav-item small { margin-top: 3px; color: #78848b; font-size: .58rem; }
.tw-review-nav-item__status {
    width: 7px;
    height: 7px;
    border-radius: 99px;
    background: #738087;
    box-shadow: 0 0 0 3px rgba(115,128,135,.09);
}
.tw-review-nav-item__status.is-active { background: var(--tw-green); box-shadow: 0 0 0 3px rgba(112,200,151,.10); }
.tw-review-nav-item__status.is-expired { background: var(--tw-gold); box-shadow: 0 0 0 3px rgba(212,175,55,.10); }
.tw-review-nav-item__status.is-revoked { background: var(--tw-red); box-shadow: 0 0 0 3px rgba(226,121,121,.10); }
.tw-review-nav-item__count { color: #66747c; font-size: .58rem; }

.tw-review-workspace {
    height: 100%;
    overflow: auto;
    padding: 24px 26px 40px;
}
.tw-review-workspace__head,
.tw-review-detail__head,
.tw-review-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}
.tw-review-workspace__head h1 { margin: 5px 0 7px; font-size: 1.55rem; color: #edf1f1; }
.tw-review-workspace__head p { max-width: 760px; margin: 0; color: #8a969d; font-size: .76rem; line-height: 1.6; }
.tw-review-workspace__actions,
.tw-review-detail__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.tw-review-security-note {
    display: grid;
    grid-template-columns: auto minmax(0,1fr);
    gap: 14px;
    align-items: center;
    margin: 18px 0;
    padding: 13px 15px;
    border: 1px solid rgba(112,200,151,.18);
    border-radius: 12px;
    background: rgba(112,200,151,.045);
}
.tw-review-security-note strong { color: #9edbb8; font-size: .72rem; }
.tw-review-security-note span { color: #7f8c92; font-size: .68rem; line-height: 1.55; }
.tw-review-empty {
    display: grid;
    min-height: 320px;
    place-items: center;
    align-content: center;
    gap: 8px;
    border: 1px dashed rgba(255,255,255,.11);
    border-radius: 14px;
    color: #79858c;
    text-align: center;
}
.tw-review-empty strong { color: #d9dfdf; }
.tw-review-empty p { max-width: 520px; margin: 0 0 8px; font-size: .72rem; line-height: 1.6; }
.tw-review-detail {
    display: grid;
    gap: 14px;
}
.tw-review-detail__head {
    padding: 16px 18px;
    border: 1px solid var(--tw-line);
    border-radius: 13px;
    background: rgba(255,255,255,.018);
}
.tw-review-detail__head h2 { margin: 6px 0 4px; color: #e4eaea; font-size: 1.12rem; }
.tw-review-detail__head p { margin: 0; color: #738088; font-size: .65rem; }
.tw-review-status {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 99px;
    background: rgba(115,128,135,.10);
    color: #99a4a9;
    font-size: .58rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.tw-review-status.is-active { background: rgba(112,200,151,.11); color: #9ddbb7; }
.tw-review-status.is-expired { background: rgba(212,175,55,.11); color: #e3c969; }
.tw-review-status.is-revoked { background: rgba(226,121,121,.11); color: #efaaaa; }
.tw-review-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 9px;
}
.tw-review-stats > div,
.tw-review-inspector-grid > div {
    padding: 11px 12px;
    border: 1px solid var(--tw-line);
    border-radius: 10px;
    background: rgba(255,255,255,.016);
}
.tw-review-stats span,
.tw-review-inspector-grid span { display: block; color: #68757d; font-size: .56rem; text-transform: uppercase; letter-spacing: .08em; }
.tw-review-stats strong,
.tw-review-inspector-grid strong { display: block; margin-top: 4px; color: #d8dfdf; font-size: .69rem; overflow-wrap: anywhere; }
.tw-review-card {
    padding: 16px 18px;
    border: 1px solid var(--tw-line);
    border-radius: 13px;
    background: rgba(255,255,255,.016);
}
.tw-review-card--future { border-style: dashed; }
.tw-review-card--future h3 { margin: 5px 0 5px; color: #dfe5e5; font-size: .9rem; }
.tw-review-card--future p { margin: 0; color: #748087; font-size: .67rem; line-height: 1.55; }
.tw-review-scope-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}
.tw-review-scope-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 9px;
    background: rgba(255,255,255,.022);
}
.tw-review-scope-chip span { color: #cbd3d4; font-size: .64rem; }
.tw-review-scope-chip strong { color: var(--tw-gold-soft); font-size: .57rem; font-weight: 700; }

.tw-review-inspector__empty { padding: 22px 16px; color: #748087; font-size: .7rem; line-height: 1.6; }
.tw-review-inspector__empty strong { display: block; margin-bottom: 5px; color: #d5dddd; }
.tw-review-inspector__empty p { margin: 0; }
.tw-review-inspector__content { padding: 16px; }
.tw-review-inspector-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }

.tw-review-share-modal { width: min(960px, calc(100vw - 32px)); max-height: min(860px, calc(100vh - 32px)); overflow: auto; }
.tw-review-share-form { display: grid; gap: 16px; }
.tw-review-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.tw-review-clear-code { margin-top: -6px; }
.tw-review-permissions,
.tw-review-targeted {
    padding: 14px;
    border: 1px solid var(--tw-line);
    border-radius: 12px;
    background: rgba(255,255,255,.014);
}
.tw-review-section-head h3 { margin: 4px 0 0; color: #e0e6e6; font-size: .9rem; }
.tw-review-section-head > p { max-width: 300px; margin: 0; color: #718087; font-size: .62rem; line-height: 1.5; text-align: right; }
.tw-review-area-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.tw-review-area {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) 122px;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--tw-line);
    border-radius: 10px;
    background: rgba(255,255,255,.018);
}
.tw-review-area > input { accent-color: var(--tw-gold); }
.tw-review-area span { min-width: 0; }
.tw-review-area strong,
.tw-review-area small { display: block; }
.tw-review-area strong { color: #d7dfdf; font-size: .65rem; }
.tw-review-area small { margin-top: 2px; color: #6d7a81; font-size: .56rem; }
.tw-review-area select,
.tw-review-target-add select,
.tw-review-target-add input {
    width: 100%;
    min-height: 36px;
    border: 1px solid var(--tw-line-strong);
    border-radius: 8px;
    background: #12171a;
    color: #cfd6d7;
    padding: 0 9px;
    font-size: .62rem;
}
.tw-review-area select:disabled { opacity: .38; }
.tw-review-targeted > summary { color: #dbe2e2; font-size: .72rem; font-weight: 700; cursor: pointer; }
.tw-review-target-add {
    display: grid;
    grid-template-columns: 135px minmax(0,1fr) 125px auto;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
}
.tw-review-target-list { display: grid; gap: 6px; margin-top: 10px; }
.tw-review-target-empty { color: #6c7980; font-size: .62rem; padding: 8px 2px 2px; }
.tw-review-target-row {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--tw-line);
    border-radius: 9px;
}
.tw-review-target-row strong,
.tw-review-target-row small { display: block; }
.tw-review-target-row strong { color: #cfd7d7; font-size: .63rem; }
.tw-review-target-row small { margin-top: 3px; color: #78858c; font-size: .56rem; }
.tw-review-token-modal { width: min(680px, calc(100vw - 32px)); }
.tw-review-token-modal > p { color: #849097; font-size: .72rem; line-height: 1.6; }
.tw-review-token-copy { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.tw-review-token-copy input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.tw-review-token-warning {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(212,175,55,.18);
    border-radius: 9px;
    background: rgba(212,175,55,.05);
    color: #a6965c;
    font-size: .64rem;
    line-height: 1.55;
}

@media (max-width: 1080px) {
    .tw-review-workspace__head,
    .tw-review-detail__head { flex-direction: column; }
    .tw-review-workspace__actions,
    .tw-review-detail__actions { justify-content: flex-start; }
    .tw-review-stats { grid-template-columns: 1fr 1fr; }
    .tw-review-form-grid,
    .tw-review-area-grid { grid-template-columns: 1fr; }
    .tw-review-target-add { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
    .tw-review-workspace { padding: 14px 12px 30px; }
    .tw-review-security-note { grid-template-columns: 1fr; gap: 5px; }
    .tw-review-stats,
    .tw-review-inspector-grid { grid-template-columns: 1fr; }
    .tw-review-detail__actions .tw-btn,
    .tw-review-workspace__actions .tw-btn { flex: 1; }
    .tw-review-area { grid-template-columns: auto minmax(0,1fr); }
    .tw-review-area select { grid-column: 2; }
    .tw-review-target-add { grid-template-columns: 1fr; }
    .tw-review-section-head { flex-direction: column; }
    .tw-review-section-head > p { text-align: left; }
    .tw-review-token-copy { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
 * Phase 2G.2c · Lektorat: Rückmeldungen im Autorenbereich
 * -------------------------------------------------------------------------- */
.tw-review-feedback-card {
    margin-top: 14px;
}
.tw-review-feedback-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 12px;
}
.tw-review-feedback-head h3 {
    margin: 4px 0 4px;
    color: #edf2f2;
    font-size: .88rem;
}
.tw-review-feedback-head p {
    margin: 0;
    color: #7f8b91;
    font-size: .64rem;
    line-height: 1.55;
}
.tw-review-feedback-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}
.tw-review-feedback-tools select {
    min-width: 110px;
}
.tw-review-feedback-tools > span {
    min-width: 30px;
    padding: 6px 8px;
    border: 1px solid var(--tw-line);
    border-radius: 8px;
    color: #c9d1d1;
    font-size: .62rem;
    text-align: center;
}
.tw-review-feedback-list {
    display: grid;
    gap: 10px;
}
.tw-review-feedback-thread {
    padding: 12px 13px;
    border: 1px solid var(--tw-line);
    border-radius: 11px;
    background: rgba(255,255,255,.018);
}
.tw-review-feedback-thread.is-resolved {
    opacity: .66;
}
.tw-review-feedback-thread__head,
.tw-review-inline-item > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.tw-review-feedback-thread__head span,
.tw-review-feedback-thread__head strong,
.tw-review-inline-item strong,
.tw-review-inline-item small {
    display: block;
}
.tw-review-feedback-thread__head span {
    color: #7f8a91;
    font-size: .56rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.tw-review-feedback-thread__head strong,
.tw-review-inline-item strong {
    margin-top: 2px;
    color: #e7ecec;
    font-size: .69rem;
}
.tw-review-feedback-thread__head > small,
.tw-review-inline-item small,
.tw-review-feedback-updated {
    color: #718087;
    font-size: .56rem;
}
.tw-review-feedback-thread blockquote,
.tw-review-inline-item blockquote {
    margin: 10px 0;
    padding: 8px 10px;
    border-left: 2px solid #d4af37;
    border-radius: 0 7px 7px 0;
    background: rgba(212,175,55,.055);
    color: #c7c0a4;
    font-size: .65rem;
    line-height: 1.5;
}
.tw-review-feedback-messages {
    display: grid;
    gap: 7px;
    margin-top: 8px;
}
.tw-review-feedback-message {
    padding: 8px 10px;
    border-radius: 8px;
    background: #171d20;
}
.tw-review-feedback-message.is-owner {
    background: rgba(70,119,94,.12);
}
.tw-review-feedback-message strong {
    display: block;
    margin-bottom: 3px;
    color: #aeb9ba;
    font-size: .58rem;
}
.tw-review-feedback-message p,
.tw-review-inline-item p {
    margin: 0;
    color: #ccd4d4;
    font-size: .66rem;
    line-height: 1.55;
    white-space: pre-wrap;
}
.tw-review-feedback-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}
.tw-review-feedback-actions form {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}
.tw-review-feedback-actions form input {
    min-width: 0;
    flex: 1;
}
.tw-review-feedback-updated {
    display: block;
    margin-top: 7px;
    text-align: right;
}
.tw-review-mark {
    cursor: pointer;
    border-bottom: 2px solid rgba(212,175,55,.95);
    background: rgba(212,175,55,.12);
    border-radius: 2px;
    transition: background .14s ease, border-color .14s ease;
}
.tw-review-mark:hover {
    background: rgba(212,175,55,.22);
}
.tw-review-mark.is-resolved {
    border-bottom-color: rgba(111,139,124,.58);
    background: rgba(111,139,124,.08);
}
.tw-review-marks-toggle.is-active {
    border-color: rgba(212,175,55,.42);
    color: #e1c45c;
    background: rgba(212,175,55,.075);
}
.tw-review-inline-drawer {
    width: min(420px, calc(100vw - 24px));
}
.tw-review-inline-list {
    display: grid;
    gap: 9px;
    padding: 12px;
    overflow: auto;
}
.tw-review-inline-item {
    padding: 11px;
    border: 1px solid var(--tw-line);
    border-radius: 10px;
    background: #181e21;
}
.tw-review-inline-item.is-resolved {
    opacity: .62;
}
.tw-review-inline-item .tw-quiet-button {
    margin-top: 9px;
}
.tw-analysis-review-filter {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.tw-analysis-review-filter input {
    accent-color: #d4af37;
}
.tw-analysis-dot.is-review {
    background: #d4af37;
    box-shadow: 0 0 0 2px rgba(212,175,55,.12);
}
@media (max-width: 720px) {
    .tw-review-feedback-head,
    .tw-review-feedback-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .tw-review-feedback-tools {
        justify-content: space-between;
    }
    .tw-review-feedback-actions form {
        flex-direction: column;
        align-items: stretch;
    }
}


/* -------------------------------------------------------------------------- */
/* Wiederherstellungspunkte                                                    */
/* -------------------------------------------------------------------------- */

.tw-modal--versions {
    width: min(780px, calc(100vw - 32px));
    max-height: min(760px, calc(100vh - 48px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tw-version-intro {
    margin: 6px 0 14px;
    color: var(--tw-muted);
    line-height: 1.55;
}

.tw-version-context {
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid var(--tw-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, .025);
    color: var(--tw-muted);
    font-size: 12px;
}

.tw-version-list {
    min-height: 160px;
    overflow: auto;
    display: grid;
    gap: 8px;
    padding-right: 3px;
}

.tw-version-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 13px 14px;
    border: 1px solid var(--tw-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, .02);
}

.tw-version-item__main {
    min-width: 0;
    display: grid;
    gap: 7px;
}

.tw-version-item__title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
}

.tw-version-item__title strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tw-version-type,
.tw-version-current {
    display: inline-flex;
    align-items: center;
    min-height: 21px;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid var(--tw-border);
    color: var(--tw-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .03em;
}

.tw-version-current {
    border-color: rgba(211, 176, 59, .45);
    background: rgba(211, 176, 59, .09);
    color: var(--tw-accent, #d3b03b);
}

.tw-version-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    color: var(--tw-muted);
    font-size: 11px;
}

.tw-version-restore {
    flex: 0 0 auto;
}

.tw-version-loading,
.tw-version-empty {
    min-height: 150px;
    display: grid;
    place-content: center;
    gap: 7px;
    text-align: center;
    color: var(--tw-muted);
    border: 1px dashed var(--tw-border);
    border-radius: 12px;
    padding: 20px;
}

.tw-version-empty strong {
    color: var(--tw-text);
}

.tw-version-empty span {
    max-width: 480px;
    line-height: 1.5;
}

.tw-version-actions {
    margin-top: 14px;
}

@media (max-width: 720px) {
    .tw-version-item {
        align-items: stretch;
        flex-direction: column;
    }

    .tw-version-restore {
        width: 100%;
    }

    .tw-modal--versions {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }
}


/* --------------------------------------------------------------------------
   TrueWriter Wörterbuch – eigener Verwaltungsbereich
   -------------------------------------------------------------------------- */
.tw-dictionary-nav-controls { display: grid; gap: 8px; padding: 0 12px 12px; }
.tw-dictionary-nav-stats { display: grid; gap: 6px; padding: 0 12px; }
.tw-dictionary-nav-stats button {
    display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px;
    width: 100%; padding: 9px 10px; border: 1px solid var(--tw-line); border-radius: 8px;
    background: #151a1d; color: #aeb6bb; text-align: left; cursor: pointer;
}
.tw-dictionary-nav-stats button:hover { border-color: rgba(212,175,55,.32); background: rgba(212,175,55,.05); }
.tw-dictionary-nav-stats button span { font-size: .67rem; }
.tw-dictionary-nav-stats button strong { color: #e0c66f; font-size: .72rem; }
.tw-dictionary-nav-hint { margin: 12px; color: #707b82; font-size: .62rem; line-height: 1.55; }
.tw-dictionary-nav-summary { color: #7f898f; font-size: .62rem; }

.tw-dictionary-workspace {
    height: 100%;
    min-height: 0;
    background: #20262b;
    color: #dfe3e5;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #465058 transparent;
}
.tw-dictionary-workspace__head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
    padding: 24px 28px 18px; border-bottom: 1px solid var(--tw-line); background: #1b2024;
}
.tw-dictionary-workspace__head h1 { margin: 3px 0 6px; color: #f0f2f3; font-size: 1.5rem; font-weight: 650; }
.tw-dictionary-workspace__head p { max-width: 720px; margin: 0; color: #879198; font-size: .74rem; line-height: 1.55; }
.tw-dictionary-workspace__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tw-dictionary-manager { display: grid; gap: 18px; padding: 22px 28px 56px; }
.tw-dictionary-add-card,
.tw-dictionary-card {
    border: 1px solid var(--tw-line); border-radius: 12px; background: #171c20;
    box-shadow: 0 10px 28px rgba(0,0,0,.12);
}
.tw-dictionary-add-card {
    display: grid; grid-template-columns: minmax(220px,.8fr) minmax(420px,1.5fr); gap: 24px; align-items: end;
    padding: 20px;
}
.tw-dictionary-add-card h2, .tw-dictionary-card h2 { margin: 3px 0 6px; color: #e7eaec; font-size: .92rem; }
.tw-dictionary-add-card p, .tw-dictionary-card__copy { margin: 0; color: #78838a; font-size: .66rem; line-height: 1.55; }
.tw-dictionary-add-fields { display: grid; grid-template-columns: minmax(180px,1fr) minmax(165px,.75fr) minmax(190px,.9fr) auto; gap: 10px; align-items: end; }
.tw-dictionary-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; align-items: start; }
.tw-dictionary-card { min-width: 0; overflow: hidden; }
.tw-dictionary-card--codex { grid-column: 1 / -1; }
.tw-dictionary-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 17px 18px 8px; }
.tw-dictionary-card__head strong {
    display: grid; place-items: center; min-width: 34px; height: 30px; padding: 0 8px;
    border: 1px solid rgba(212,175,55,.22); border-radius: 9px; background: rgba(212,175,55,.07); color: #dec168; font-size: .72rem;
}
.tw-dictionary-card__copy { padding: 0 18px 14px; }
.tw-dictionary-manager-list {
    display: grid;
    min-height: 0;
    max-height: 320px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #465058 transparent;
    border-top: 1px solid var(--tw-line);
}
.tw-dictionary-card--codex .tw-dictionary-manager-list {
    max-height: clamp(180px, 30vh, 320px);
}
.tw-dictionary-manager-list--readonly { grid-template-columns: repeat(2,minmax(0,1fr)); }
.tw-dictionary-manager-row {
    display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px;
    min-width: 0; padding: 10px 13px 10px 18px; border-bottom: 1px solid rgba(255,255,255,.045);
}
.tw-dictionary-manager-row:last-child { border-bottom: 0; }
.tw-dictionary-manager-row:hover { background: rgba(255,255,255,.02); }
.tw-dictionary-manager-word { min-width: 0; display: grid; gap: 2px; }
.tw-dictionary-manager-word strong { overflow: hidden; color: #dfe3e5; font-size: .74rem; font-weight: 580; text-overflow: ellipsis; white-space: nowrap; }
.tw-dictionary-manager-word small { color: #68747b; font-size: .56rem; }
.tw-dictionary-remove { width: 27px; height: 27px; color: #8a949a; }
.tw-dictionary-remove:hover:not(:disabled) { color: #e49b9b; border-color: rgba(214,93,93,.32); background: rgba(214,93,93,.06); }
.tw-dictionary-auto-badge { padding: 3px 7px; border-radius: 999px; background: rgba(93,149,196,.09); color: #83accd; font-size: .54rem; text-transform: uppercase; letter-spacing: .05em; }
.tw-dictionary-empty { padding: 22px 18px; color: #707b82; font-size: .66rem; text-align: center; }
.tw-dictionary-inspector { padding: 0 13px 18px; }
.tw-dictionary-inspector-stats { display: grid; gap: 7px; margin-bottom: 15px; }
.tw-dictionary-inspector-stats > div {
    display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: center;
    padding: 9px 10px; border: 1px solid var(--tw-line); border-radius: 8px; background: #151a1d;
}
.tw-dictionary-inspector-stats span { color: #7b868d; font-size: .62rem; }
.tw-dictionary-inspector-stats strong { color: #dbc36e; font-size: .7rem; }

@media (max-width: 1100px) {
    .tw-dictionary-add-card { grid-template-columns: 1fr; }
    .tw-dictionary-add-fields { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
    .tw-dictionary-workspace__head { flex-direction: column; padding: 18px; }
    .tw-dictionary-manager { padding: 16px 18px 24px; }
    .tw-dictionary-columns { grid-template-columns: 1fr; }
    .tw-dictionary-card--codex { grid-column: auto; }
    .tw-dictionary-manager-list--readonly { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .tw-dictionary-add-fields { grid-template-columns: 1fr; }
}

/* ========================================================================== */
/* TrueWriter Guide / interaktives Tutorial                                   */
/* ========================================================================== */
.tw-tutorial-welcome-backdrop,
#twTutorialCenter {
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.tw-tutorial-welcome {
    width: min(760px, calc(100vw - 32px));
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 22px;
    overflow: hidden;
    background:
        radial-gradient(circle at 15% 0%, rgba(212,175,55,.11), transparent 38%),
        linear-gradient(145deg, #20272b 0%, #171c20 100%);
    box-shadow: 0 30px 90px rgba(0,0,0,.48);
    color: #e9edee;
}

.tw-tutorial-welcome__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    background: rgba(255,255,255,.018);
}

.tw-tutorial-welcome__mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(212,175,55,.28);
    background: rgba(212,175,55,.09);
    color: #e0c66f;
    font-size: 1.05rem;
}

.tw-tutorial-welcome__brand div { display: grid; gap: 2px; }
.tw-tutorial-welcome__brand span:not(.tw-tutorial-welcome__mark) { color: #edf1f1; font-size: .76rem; font-weight: 700; }
.tw-tutorial-welcome__brand small { color: #748087; font-size: .61rem; }

.tw-tutorial-welcome__copy { padding: 34px 34px 26px; }
.tw-tutorial-welcome__copy h2 {
    max-width: 650px;
    margin: 8px 0 14px;
    color: #f3f5f5;
    font-size: clamp(1.65rem, 4vw, 2.35rem);
    line-height: 1.08;
    letter-spacing: -.035em;
}
.tw-tutorial-welcome__copy > p {
    max-width: 650px;
    margin: 0;
    color: #99a3a8;
    font-size: .82rem;
    line-height: 1.72;
}
.tw-tutorial-welcome__features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}
.tw-tutorial-welcome__features span {
    padding: 7px 10px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 999px;
    background: rgba(255,255,255,.025);
    color: #b4bdc1;
    font-size: .64rem;
}
.tw-tutorial-welcome__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 22px;
    border-top: 1px solid rgba(255,255,255,.06);
    background: rgba(0,0,0,.08);
}

.tw-tutorial-center {
    width: min(980px, calc(100vw - 32px));
    max-height: min(860px, calc(100vh - 32px));
    overflow: auto;
    position: relative;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 20px;
    background:
        radial-gradient(circle at 100% 0%, rgba(212,175,55,.075), transparent 34%),
        #1c2226;
    box-shadow: 0 30px 90px rgba(0,0,0,.5);
    color: #dfe4e5;
}
.tw-tutorial-center__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    padding: 28px 30px 20px;
}
.tw-tutorial-center__head h2 { margin: 5px 0 8px; color: #f0f3f3; font-size: 1.65rem; }
.tw-tutorial-center__head p { max-width: 650px; margin: 0; color: #89949a; font-size: .72rem; line-height: 1.65; }
.tw-tutorial-center__progress {
    min-width: 120px;
    padding: 14px 16px;
    border: 1px solid rgba(212,175,55,.16);
    border-radius: 14px;
    background: rgba(212,175,55,.05);
    text-align: right;
}
.tw-tutorial-center__progress strong { display: block; color: #e0c66f; font-size: 1.28rem; }
.tw-tutorial-center__progress span { color: #778289; font-size: .57rem; }
.tw-tutorial-center__bar { height: 3px; margin: 0 30px 4px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.055); }
.tw-tutorial-center__bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #a8892e, #e0c66f); transition: width .3s ease; }

.tw-tutorial-modules { display: grid; gap: 9px; padding: 18px 30px 28px; }
.tw-tutorial-module {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px 15px;
    border: 1px solid rgba(255,255,255,.065);
    border-radius: 13px;
    background: rgba(255,255,255,.018);
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.tw-tutorial-module:not(.is-coming):hover { border-color: rgba(212,175,55,.2); background: rgba(212,175,55,.035); transform: translateY(-1px); }
.tw-tutorial-module.is-coming { opacity: .58; }
.tw-tutorial-module__icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    border: 1px solid rgba(255,255,255,.08);
    background: #22292e;
    color: #d9be64;
    font-size: .9rem;
}
.tw-tutorial-module__copy { min-width: 0; }
.tw-tutorial-module__title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.tw-tutorial-module__title strong { color: #e7ebec; font-size: .76rem; }
.tw-tutorial-module__copy p { margin: 4px 0 3px; color: #818c92; font-size: .64rem; line-height: 1.45; }
.tw-tutorial-module__copy small { color: #657078; font-size: .56rem; }
.tw-tutorial-status {
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(255,255,255,.055);
    color: #8e999f;
    font-size: .52rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.tw-tutorial-status.is-completed { background: rgba(112,200,151,.1); color: #88d4aa; }
.tw-tutorial-status.is-progress { background: rgba(212,175,55,.1); color: #d7bc61; }
.tw-tutorial-status.is-dismissed { background: rgba(255,255,255,.045); color: #747f86; }
.tw-tutorial-module__soon { color: #68737a; font-size: .59rem; }
.tw-tutorial-center__footer {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 15px 30px;
    border-top: 1px solid rgba(255,255,255,.055);
    color: #68737a;
    font-size: .59rem;
}

html.tw-tutorial-open,
body.tw-tutorial-open {
    overflow: hidden !important;
}
.tw-tutorial-layer {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    pointer-events: auto;
    touch-action: none;
    overscroll-behavior: contain;
}
.tw-tutorial-focus {
    position: fixed;
    z-index: 1;
    border: 1px solid rgba(224,198,111,.88);
    border-radius: 12px;
    box-shadow:
        0 0 0 9999px rgba(8,11,13,.72),
        0 0 0 4px rgba(212,175,55,.09),
        0 8px 28px rgba(0,0,0,.26);
    opacity: 0;
    transition: left .22s ease, top .22s ease, width .22s ease, height .22s ease, opacity .15s ease;
    pointer-events: none;
}
.tw-tutorial-target-active { }
.tw-tutorial-coach {
    position: fixed;
    z-index: 3;
    width: min(390px, calc(100vw - 32px));
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 16px;
    background: linear-gradient(145deg, #22292e 0%, #181e22 100%);
    box-shadow: 0 24px 72px rgba(0,0,0,.5);
    color: #e7ebec;
    pointer-events: auto;
}
.tw-tutorial-coach__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 15px 10px;
}
.tw-tutorial-coach__top > span { color: #d2b85e; font-size: .57rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.tw-tutorial-coach__close {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #78848a;
    cursor: pointer;
    font-size: 1rem;
}
.tw-tutorial-coach__close:hover { background: rgba(255,255,255,.05); color: #dce1e2; }
.tw-tutorial-coach__progress { height: 2px; margin: 0 15px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.055); }
.tw-tutorial-coach__progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #9d7e25, #e3c86e); transition: width .22s ease; }
.tw-tutorial-coach h3 { margin: 18px 18px 8px; color: #f1f3f3; font-size: 1.03rem; line-height: 1.25; }
.tw-tutorial-coach > p { margin: 0 18px; color: #9aa4a9; font-size: .72rem; line-height: 1.62; }
.tw-tutorial-coach__meta { display: grid; gap: 3px; margin: 15px 18px 2px; }
.tw-tutorial-coach__meta span:first-child { color: #d1b65d; font-size: .56rem; font-weight: 700; }
.tw-tutorial-coach__meta span:last-child { color: #69757c; font-size: .57rem; line-height: 1.45; }
.tw-tutorial-coach__actions { display: flex; justify-content: flex-end; gap: 8px; padding: 15px 18px 17px; }
.tw-tutorial-coach__actions .tw-btn { min-width: 92px; }
.tw-tutorial-coach__actions .tw-btn:disabled { opacity: .35; cursor: default; }

@media (max-width: 720px) {
    .tw-tutorial-welcome { width: calc(100vw - 20px); border-radius: 16px; }
    .tw-tutorial-welcome__copy { padding: 25px 20px 20px; }
    .tw-tutorial-welcome__actions { padding: 14px; }
    .tw-tutorial-welcome__actions .tw-btn { flex: 1; }
    .tw-tutorial-center { width: calc(100vw - 18px); max-height: calc(100vh - 18px); border-radius: 16px; }
    .tw-tutorial-center__head { grid-template-columns: 1fr; gap: 14px; padding: 22px 18px 16px; }
    .tw-tutorial-center__progress { text-align: left; }
    .tw-tutorial-center__bar { margin-inline: 18px; }
    .tw-tutorial-modules { padding: 14px 18px 20px; }
    .tw-tutorial-module { grid-template-columns: 38px minmax(0, 1fr); }
    .tw-tutorial-module__action { grid-column: 2; }
    .tw-tutorial-center__footer { align-items: flex-start; flex-direction: column; padding: 14px 18px; }
    .tw-tutorial-coach {
        left: 10px !important;
        right: 10px !important;
        top: auto !important;
        bottom: max(10px, env(safe-area-inset-bottom)) !important;
        width: auto !important;
        max-height: min(46dvh, 380px);
        border-radius: 16px;
        overflow: auto;
    }
    .tw-tutorial-coach__top { padding: 11px 13px 8px; }
    .tw-tutorial-coach h3 { margin: 14px 15px 7px; font-size: .98rem; }
    .tw-tutorial-coach > p { margin: 0 15px; font-size: .7rem; line-height: 1.52; }
    .tw-tutorial-coach__meta { margin: 12px 15px 0; }
    .tw-tutorial-coach__actions {
        position: sticky;
        bottom: 0;
        padding: 12px 15px max(13px, env(safe-area-inset-bottom));
        background: linear-gradient(180deg, rgba(24,30,34,.76), #181e22 28%);
    }
    .tw-tutorial-coach__actions .tw-btn { flex: 1; min-width: 0; }
}

@media (min-width: 721px) and (max-height: 720px) {
    .tw-tutorial-coach { max-height: calc(100dvh - 24px); }
    .tw-tutorial-coach h3 { margin-top: 13px; }
    .tw-tutorial-coach__meta { margin-top: 10px; }
    .tw-tutorial-coach__actions { padding-top: 11px; padding-bottom: 12px; }
}

/* --------------------------------------------------------------------------
 * Phase 2H.1 hotfix · Guide readability, mobile centering & precise targets
 * -------------------------------------------------------------------------- */
.tw-tutorial-center__head p {
    color: #a6b0b5;
    font-size: .82rem;
    line-height: 1.62;
}
.tw-tutorial-center__progress span {
    color: #9aa5aa;
    font-size: .66rem;
}
.tw-tutorial-module__title strong {
    color: #eef1f2;
    font-size: .84rem;
}
.tw-tutorial-module__copy p {
    color: #a3adb2;
    font-size: .73rem;
    line-height: 1.52;
}
.tw-tutorial-module__copy small {
    color: #87939a;
    font-size: .64rem;
    line-height: 1.45;
}
.tw-tutorial-status {
    font-size: .58rem;
}
.tw-tutorial-module__soon,
.tw-tutorial-center__footer {
    color: #8d989e;
    font-size: .66rem;
}
.tw-tutorial-coach__top > span {
    font-size: .63rem;
}
.tw-tutorial-coach h3 {
    font-size: 1.08rem;
}
.tw-tutorial-coach > p {
    color: #b5bec2;
    font-size: .80rem;
    line-height: 1.6;
}
.tw-tutorial-coach__meta span:first-child {
    font-size: .63rem;
}
.tw-tutorial-coach__meta span:last-child {
    color: #909ba1;
    font-size: .66rem;
    line-height: 1.5;
}

@media (max-width: 720px) {
    #twTutorialCenter,
    #twTutorialWelcome {
        padding: 12px;
    }
    .tw-tutorial-center,
    .tw-tutorial-welcome {
        width: 100%;
        max-width: 100%;
        margin: auto;
        justify-self: center;
        align-self: center;
    }
    .tw-tutorial-center {
        max-height: calc(100dvh - 24px);
    }
    .tw-tutorial-center__head h2 {
        font-size: 1.5rem;
        line-height: 1.18;
    }
    .tw-tutorial-center__head p {
        font-size: .80rem;
        line-height: 1.58;
    }
    .tw-tutorial-module__title strong {
        font-size: .83rem;
    }
    .tw-tutorial-module__copy p {
        font-size: .72rem;
    }
    .tw-tutorial-module__copy small,
    .tw-tutorial-module__soon {
        font-size: .64rem;
    }
    .tw-tutorial-coach {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%);
        width: min(430px, calc(100dvw - 24px)) !important;
        bottom: max(12px, env(safe-area-inset-bottom)) !important;
        max-height: min(48dvh, 410px);
    }
    .tw-tutorial-coach h3 {
        font-size: 1.05rem;
    }
    .tw-tutorial-coach > p {
        font-size: .78rem;
        line-height: 1.55;
    }
    .tw-tutorial-coach__meta span:last-child {
        font-size: .65rem;
    }
}
.tw-tutorial-module.is-coming {
    opacity: .78;
}

/* ========================================================================== 
   HOTFIX 2026-10-06 – KAPITELANSICHT: ZENTRIERUNG + SCHREIBFORMAT            
   ========================================================================== */
/*
 * Der Kapitelkopf bleibt kompakt. Die eigentlichen Papierseiten bekommen
 * dagegen die komplette Breite des Schreibbereichs als Zentrierfläche.
 * Dadurch kann A4 inklusive Dokument-Zoom nicht mehr im alten 1040px-Wrapper
 * nach rechts in Richtung Inspector überlaufen.
 */
.tw-chapter-view {
    width: 100%;
    max-width: none;
    padding: 36px clamp(18px, 4vw, 56px) 88px;
}
.tw-chapter-view__head,
.tw-chapter-view__hint {
    width: min(1040px, 100%);
    margin-left: auto;
    margin-right: auto;
}
.tw-chapter-scenes {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
}
.tw-chapter-scene {
    display: flex;
    width: 100%;
    min-width: 0;
    max-height: none;
    overflow: visible;
    flex-direction: column;
    align-items: center;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--tw-paper-text);
    box-shadow: none;
}
/* Meta-Leiste und Papier werden unabhängig innerhalb der vollen Arbeitsfläche
   zentriert. So entspricht die Lage der normalen Szenenansicht. */
.tw-chapter-scene__head {
    width: min(var(--tw-editor-page-width), 100%);
    min-height: 42px;
    box-sizing: border-box;
    margin: 0 auto 8px;
    border: 1px solid rgba(255,255,255,.075);
    border-radius: 8px;
    background: rgba(16,20,23,.72);
}
.tw-chapter-scene__content {
    width: min(var(--tw-editor-page-width), 100%);
    min-width: 0;
    min-height: calc(100vh - var(--tw-top) - var(--tw-status) - 145px);
    box-sizing: border-box;
    margin: 0 auto;
    padding: clamp(44px, 7vw, 76px) clamp(38px, 8vw, 84px) 110px;
    border-radius: 3px;
    background: var(--tw-paper);
    color: var(--tw-paper-text);
    box-shadow: 0 24px 70px rgba(0,0,0,.18);
    font-family: var(--tw-editor-font-family);
    font-size: var(--tw-editor-font-size);
    line-height: var(--tw-editor-line-height);
    zoom: var(--tw-editor-zoom);
}
.tw-chapter-scene__content p {
    min-height: 1em;
    margin: 0 0 var(--tw-editor-paragraph-spacing);
    white-space: pre-wrap;
}
.tw-chapter-scene__content p:last-child { margin-bottom: 0; }
.tw-chapter-scene__content h1,
.tw-chapter-scene__content h2,
.tw-chapter-scene__content h3 {
    margin: 1.25em 0 .65em;
    color: inherit;
    font-family: var(--tw-editor-font-family);
    font-weight: 650;
    line-height: 1.25;
    text-indent: 0;
}
.tw-chapter-scene__content h1 { font-size: 1.65em; }
.tw-chapter-scene__content h2 { font-size: 1.38em; }
.tw-chapter-scene__content h3 { font-size: 1.18em; }
.tw-chapter-scene__content ul,
.tw-chapter-scene__content ol {
    margin: .6em 0 var(--tw-editor-paragraph-spacing) 1.75em;
    padding: 0;
}
.tw-chapter-scene__content li > p {
    margin-bottom: .3em;
    text-indent: 0;
}
.tw-chapter-scene__content blockquote {
    margin: 1em 0;
    padding: .15em 0 .15em 1.05em;
    border-left: 3px solid rgba(128,104,39,.45);
    color: color-mix(in srgb, currentColor 80%, transparent);
}
.tw-chapter-scene__content hr {
    width: 34%;
    margin: 2em auto;
    border: 0;
    border-top: 1px solid rgba(80,70,55,.32);
}
/* A4 bekommt dieselbe physische Seite wie der Editor. Der äußere Artikel
   bleibt jedoch 100% breit und dient nur als Zentrierfläche. */
.tw-app[data-page-mode='a4'] .tw-chapter-scene {
    width: 100%;
    min-width: 0;
}
.tw-app[data-page-mode='a4'] .tw-chapter-scene__head,
.tw-app[data-page-mode='a4'] .tw-chapter-scene__content {
    width: 210mm;
    min-width: 210mm;
}
.tw-app[data-page-mode='a4'] .tw-chapter-scene__content {
    min-height: 297mm;
    padding: var(--tw-editor-page-padding);
}
.tw-app[data-page-mode='flow'] .tw-chapter-scene__head,
.tw-app[data-page-mode='flow'] .tw-chapter-scene__content {
    width: min(var(--tw-editor-page-width), 100%);
    min-width: 0;
}
.tw-app[data-paper-theme='white'] .tw-chapter-scene__content {
    background: #fff;
    color: #202020;
}
.tw-app[data-paper-theme='sepia'] .tw-chapter-scene__content {
    background: #eee1c6;
    color: #2f2921;
}
.tw-app[data-paper-theme='dark'] .tw-chapter-scene__content {
    background: #171a1d;
    color: #e6e3dc;
    border: 1px solid rgba(255,255,255,.07);
}
@media (max-width: 900px) {
    .tw-chapter-view {
        width: 100%;
        padding: 24px 18px 72px;
    }
}
@media (max-width: 720px) {
    .tw-chapter-view {
        width: 100%;
        padding: 18px 8px 64px;
    }
    .tw-chapter-scene {
        align-items: center;
    }
    .tw-chapter-scene__head {
        width: 100%;
    }
    .tw-chapter-scene__content {
        padding: clamp(44px, 7vw, 76px) clamp(38px, 8vw, 84px) 110px;
        font-size: var(--tw-editor-font-size);
    }
    .tw-app[data-page-mode='a4'] .tw-chapter-scene__head,
    .tw-app[data-page-mode='a4'] .tw-chapter-scene__content {
        width: 210mm;
        min-width: 210mm;
    }
    .tw-app[data-page-mode='a4'] .tw-chapter-scene__content {
        padding: var(--tw-editor-page-padding);
    }
}


/* ========================================================================== */
/* Import – Analyse & Kapitelvorschau                                          */
/* ========================================================================== */
.tw-import-workspace {
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: clamp(24px, 3vw, 46px) clamp(24px, 4vw, 64px) 70px;
    scrollbar-width: thin;
    scrollbar-color: #4a535a transparent;
}
.tw-import-workspace__head {
    display: flex;
    width: min(1180px, 100%);
    margin: 0 auto 18px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}
.tw-import-workspace__head h1 {
    margin: 5px 0 7px;
    color: #f2f3f4;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 500;
}
.tw-import-workspace__head p {
    max-width: 760px;
    margin: 0;
    color: #9aa4aa;
    font-size: .86rem;
    line-height: 1.65;
}
.tw-import-workspace__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.tw-import-security-note,
.tw-import-drop-card,
.tw-import-result {
    width: min(1180px, 100%);
    margin-inline: auto;
}
.tw-import-security-note {
    display: flex;
    gap: 14px;
    margin-bottom: 18px;
    padding: 13px 16px;
    border: 1px solid rgba(94, 185, 139, .2);
    border-radius: 10px;
    background: rgba(45, 105, 76, .08);
    color: #8f9a9f;
    font-size: .73rem;
    line-height: 1.5;
}
.tw-import-security-note strong {
    flex: 0 0 auto;
    color: #8fd0ad;
}
.tw-import-drop-card {
    padding: clamp(18px, 3vw, 34px);
    border: 1px solid var(--tw-line);
    border-radius: 16px;
    background: rgba(19, 24, 28, .62);
}
.tw-import-dropzone {
    display: flex;
    width: 100%;
    min-height: 250px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    padding: 34px;
    border: 1px dashed rgba(212, 175, 55, .38);
    border-radius: 14px;
    background: rgba(212, 175, 55, .035);
    color: #9ba4aa;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.tw-import-dropzone:hover,
.tw-import-dropzone.is-dragover {
    border-color: rgba(212, 175, 55, .82);
    background: rgba(212, 175, 55, .075);
    transform: translateY(-1px);
}
.tw-import-dropzone:disabled {
    opacity: .55;
    cursor: wait;
}
.tw-import-dropzone__icon {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border: 1px solid rgba(212, 175, 55, .35);
    border-radius: 15px;
    color: var(--tw-gold-soft);
    font-size: 1.65rem;
}
.tw-import-dropzone strong {
    color: #eef0f1;
    font-size: 1.12rem;
}
.tw-import-dropzone > span:last-child {
    font-size: .74rem;
}
.tw-import-progress {
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid var(--tw-line);
    border-radius: 10px;
    background: rgba(0, 0, 0, .13);
}
.tw-import-progress__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 9px;
    color: #aab2b7;
    font-size: .72rem;
}
.tw-import-progress__row strong { color: #e2e5e7; font-weight: 650; }
.tw-import-progress__track {
    height: 5px;
    overflow: hidden;
    border-radius: 99px;
    background: rgba(255,255,255,.06);
}
.tw-import-progress__track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--tw-gold);
    transition: width .15s ease;
}
.tw-import-drop-card__hint {
    margin-top: 18px;
    padding: 15px 16px;
    border-radius: 10px;
    background: rgba(255,255,255,.025);
}
.tw-import-drop-card__hint strong { color: #dfe3e5; font-size: .76rem; }
.tw-import-drop-card__hint p { margin: 5px 0 0; color: #879198; font-size: .72rem; line-height: 1.55; }
.tw-import-result__summary {
    display: grid;
    grid-template-columns: minmax(0, 2fr) repeat(3, minmax(120px, .65fr));
    gap: 10px;
    margin-bottom: 14px;
}
.tw-import-result__summary > div {
    min-width: 0;
    padding: 14px 15px;
    border: 1px solid var(--tw-line);
    border-radius: 10px;
    background: rgba(18, 23, 27, .58);
}
.tw-import-result__summary span,
.tw-import-result__summary strong { display: block; }
.tw-import-result__summary span {
    margin-bottom: 5px;
    color: #6f7a81;
    font-size: .59rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.tw-import-result__summary strong {
    overflow: hidden;
    color: #e6e9ea;
    font-size: .79rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-import-warning-list {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}
.tw-import-warning-list > div {
    display: flex;
    gap: 11px;
    padding: 11px 13px;
    border: 1px solid rgba(212,175,55,.22);
    border-radius: 9px;
    background: rgba(212,175,55,.045);
    font-size: .7rem;
    line-height: 1.5;
}
.tw-import-warning-list strong { color: var(--tw-gold-soft); }
.tw-import-warning-list span { color: #9ca5aa; }
.tw-import-preview-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 0 13px;
    border-bottom: 1px solid var(--tw-line);
}
.tw-import-preview-head h2 {
    margin: 4px 0 5px;
    color: #edf0f1;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.42rem;
    font-weight: 500;
}
.tw-import-preview-head p { max-width: 780px; margin: 0; color: #879198; font-size: .73rem; line-height: 1.55; }
.tw-import-chapter-list {
    display: grid;
    gap: 10px;
    padding: 14px 0 20px;
}
.tw-import-chapter {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    padding: 15px;
    border: 1px solid var(--tw-line);
    border-radius: 11px;
    background: rgba(18, 23, 27, .7);
    transition: opacity .15s ease, border-color .15s ease;
}
.tw-import-chapter.is-excluded { opacity: .45; border-style: dashed; }
.tw-import-chapter__index {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 9px;
    background: rgba(212,175,55,.08);
    color: var(--tw-gold-soft);
    font-size: .72rem;
    font-weight: 800;
}
.tw-import-chapter__title-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}
.tw-import-chapter__title-row label { flex: 1; min-width: 0; }
.tw-import-chapter__title-row label > span {
    display: block;
    margin-bottom: 5px;
    color: #6f7a81;
    font-size: .58rem;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.tw-import-chapter__title-row input {
    width: 100%;
    min-height: 38px;
    padding: 0 11px;
    border: 1px solid var(--tw-line-strong);
    border-radius: 7px;
    outline: none;
    background: #11161a;
    color: #eef0f1;
    font-size: .82rem;
}
.tw-import-chapter__title-row input:focus { border-color: rgba(212,175,55,.58); box-shadow: 0 0 0 2px rgba(212,175,55,.08); }
.tw-import-detection {
    flex: 0 0 auto;
    margin-bottom: 9px;
    color: #818b91;
    font-size: .62rem;
}
.tw-import-chapter__body > p {
    display: -webkit-box;
    overflow: hidden;
    margin: 9px 0;
    color: #9ca5aa;
    font-size: .72rem;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
.tw-import-chapter__meta { display: flex; gap: 13px; flex-wrap: wrap; color: #6f7a81; font-size: .62rem; }
.tw-import-chapter__actions { display: flex; align-items: flex-end; flex-direction: column; gap: 7px; padding-top: 19px; }
.tw-import-next-step {
    padding: 16px 18px;
    border: 1px dashed rgba(212,175,55,.26);
    border-radius: 11px;
    background: rgba(212,175,55,.035);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.tw-import-next-step > div { min-width: 0; }
.tw-import-next-step strong { color: var(--tw-gold-soft); font-size: .76rem; }
.tw-import-next-step p { margin: 5px 0 0; color: #8d979d; font-size: .71rem; line-height: 1.55; }
.tw-import-next-step .tw-btn { flex: 0 0 auto; min-width: 190px; }

@media (min-width: 721px) {
    .tw-app[data-workspace-mode='import'] .tw-workspace {
        grid-template-columns: var(--tw-rail) minmax(0, 1fr) !important;
    }
    .tw-app[data-workspace-mode='import'] .tw-navigator,
    .tw-app[data-workspace-mode='import'] .tw-inspector { display: none !important; }
}

@media (max-width: 920px) {
    .tw-import-result__summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tw-import-chapter { grid-template-columns: 34px minmax(0, 1fr); }
    .tw-import-chapter__actions { grid-column: 2; align-items: flex-start; flex-direction: row; flex-wrap: wrap; padding-top: 0; }
}

@media (max-width: 720px) {
    .tw-import-workspace { padding: 20px 14px 90px; }
    .tw-import-workspace__head { align-items: stretch; flex-direction: column; gap: 14px; }
    .tw-import-workspace__actions { justify-content: flex-start; }
    .tw-import-security-note { align-items: flex-start; flex-direction: column; gap: 5px; }
    .tw-import-drop-card { padding: 12px; border-radius: 12px; }
    .tw-import-dropzone { min-height: 210px; padding: 24px 16px; text-align: center; }
    .tw-import-result__summary { grid-template-columns: 1fr 1fr; }
    .tw-import-result__summary > div:first-child { grid-column: 1 / -1; }
    .tw-import-chapter { grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 12px; }
    .tw-import-chapter__index { width: 28px; height: 28px; }
    .tw-import-chapter__title-row { align-items: stretch; flex-direction: column; gap: 6px; }
    .tw-import-detection { margin: 0; }
    .tw-import-chapter__actions { grid-column: 1 / -1; padding-left: 38px; }
    .tw-import-next-step { align-items: stretch; flex-direction: column; }
    .tw-import-next-step .tw-btn { width: 100%; min-width: 0; }
}

/* --------------------------------------------------------------------------
   TrueWriter Phase 2J.1 - Export
   -------------------------------------------------------------------------- */
.tw-export-overview {
    display: grid;
    gap: 18px;
}
.tw-export-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.tw-export-option {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 14px 15px;
    border: 1px solid var(--tw-line);
    border-radius: 10px;
    background: rgba(18, 23, 27, .58);
    cursor: pointer;
}
.tw-export-option input {
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: var(--tw-gold);
}
.tw-export-option > span { min-width: 0; }
.tw-export-option strong,
.tw-export-option small { display: block; }
.tw-export-option strong { color: #e5e8e9; font-size: .76rem; }
.tw-export-option small { margin-top: 4px; color: #7f8a91; font-size: .67rem; line-height: 1.5; }
.tw-export-format-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.tw-export-format-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 15px;
    align-items: start;
    padding: 20px;
    border: 1px solid var(--tw-line);
    border-radius: 12px;
    background: rgba(18, 23, 27, .7);
}
.tw-export-format-card__icon {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 1px solid rgba(212,175,55,.28);
    border-radius: 12px;
    background: rgba(212,175,55,.07);
    color: var(--tw-gold-soft);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.12rem;
    font-weight: 700;
}
.tw-export-format-card h2,
.tw-export-ebook-card h2,
.tw-export-backup-card h2 {
    margin: 5px 0 7px;
    color: #edf0f1;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.24rem;
    font-weight: 500;
}
.tw-export-format-card p,
.tw-export-ebook-card p,
.tw-export-backup-card p {
    margin: 0;
    color: #879198;
    font-size: .71rem;
    line-height: 1.6;
}
.tw-export-format-card .tw-btn {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 4px;
}
.tw-export-ebook-card,
.tw-export-backup-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 20px;
    border-radius: 12px;
}
.tw-export-ebook-card {
    border: 1px solid rgba(212,175,55,.24);
    background: rgba(212,175,55,.04);
}
.tw-export-backup-card {
    border: 1px dashed var(--tw-line-strong);
    background: rgba(255,255,255,.018);
}
.tw-export-ebook-card > div,
.tw-export-backup-card > div { min-width: 0; }
.tw-export-ebook-card .tw-btn { flex: 0 0 auto; }

@media (min-width: 721px) {
    .tw-app[data-workspace-mode='export'] .tw-workspace {
        grid-template-columns: var(--tw-rail) minmax(0, 1fr) !important;
    }
    .tw-app[data-workspace-mode='export'] .tw-navigator,
    .tw-app[data-workspace-mode='export'] .tw-inspector { display: none !important; }
}

@media (max-width: 920px) {
    .tw-export-format-grid,
    .tw-export-options { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .tw-export-ebook-card,
    .tw-export-backup-card { align-items: stretch; flex-direction: column; }
    .tw-export-ebook-card .tw-btn { width: 100%; }
}

/* --------------------------------------------------------------------------
   TrueWriter Phase 2J.2 - Portable backup / migration
   -------------------------------------------------------------------------- */
.tw-export-backup-card--active {
    display: grid;
    grid-template-columns: minmax(220px, .72fr) minmax(0, 1.8fr);
    align-items: start;
    border-style: solid;
    border-color: rgba(212,175,55,.2);
    background: rgba(12,16,19,.72);
}
.tw-backup-intro {
    position: sticky;
    top: 18px;
}
.tw-backup-builder {
    display: grid;
    gap: 12px;
    min-width: 0;
}
.tw-backup-everything,
.tw-backup-scope label,
.tw-backup-category {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    border: 1px solid var(--tw-line);
    border-radius: 10px;
    background: rgba(18,23,27,.6);
    cursor: pointer;
}
.tw-backup-everything {
    padding: 15px 16px;
    border-color: rgba(212,175,55,.3);
    background: rgba(212,175,55,.055);
}
.tw-backup-everything input,
.tw-backup-scope input,
.tw-backup-category input {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: var(--tw-gold);
}
.tw-backup-everything span,
.tw-backup-scope label > span,
.tw-backup-category > span {
    min-width: 0;
}
.tw-backup-everything strong,
.tw-backup-everything small,
.tw-backup-scope strong,
.tw-backup-scope small,
.tw-backup-category strong,
.tw-backup-category small {
    display: block;
}
.tw-backup-everything strong,
.tw-backup-scope strong,
.tw-backup-category strong {
    color: #e7eaeb;
    font-size: .75rem;
}
.tw-backup-everything small,
.tw-backup-scope small,
.tw-backup-category small {
    margin-top: 3px;
    color: #7f8a91;
    font-size: .66rem;
    line-height: 1.45;
}
.tw-backup-scope {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 0;
    padding: 0;
    border: 0;
}
.tw-backup-scope legend {
    grid-column: 1 / -1;
    margin-bottom: 1px;
    color: #939ca1;
    font-size: .67rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.tw-backup-scope label {
    padding: 12px 13px;
}
.tw-backup-selection-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 2px;
}
.tw-backup-selection-head > div {
    min-width: 0;
}
.tw-backup-selection-head strong,
.tw-backup-selection-head small {
    display: block;
}
.tw-backup-selection-head strong {
    color: #dfe3e5;
    font-size: .74rem;
}
.tw-backup-selection-head small {
    margin-top: 3px;
    color: #6f7a80;
    font-size: .64rem;
    line-height: 1.45;
}
.tw-btn--compact {
    min-height: 30px;
    padding: 6px 10px;
    font-size: .66rem;
    white-space: nowrap;
}
.tw-backup-category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.tw-backup-category {
    min-height: 62px;
    padding: 11px 12px;
}
.tw-backup-category:has(input:checked) {
    border-color: rgba(212,175,55,.22);
    background: rgba(212,175,55,.035);
}
.tw-backup-category input:disabled,
.tw-backup-scope input:disabled,
.tw-backup-everything input:disabled {
    cursor: wait;
}
.tw-backup-security-note {
    display: grid;
    gap: 3px;
    padding: 12px 13px;
    border: 1px solid rgba(84,171,128,.22);
    border-radius: 9px;
    background: rgba(84,171,128,.04);
}
.tw-backup-security-note strong {
    color: #a9cfba;
    font-size: .68rem;
}
.tw-backup-security-note span {
    color: #75847b;
    font-size: .63rem;
    line-height: 1.5;
}
.tw-backup-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 2px;
}
.tw-backup-actions > div {
    min-width: 0;
}
.tw-backup-actions strong,
.tw-backup-actions small {
    display: block;
}
.tw-backup-actions strong {
    color: #dde1e3;
    font-size: .72rem;
}
.tw-backup-actions small {
    margin-top: 4px;
    color: #788389;
    font-size: .64rem;
    line-height: 1.45;
}
.tw-backup-actions .tw-btn {
    flex: 0 0 auto;
}

@media (max-width: 1080px) {
    .tw-export-backup-card--active {
        grid-template-columns: 1fr;
    }
    .tw-backup-intro {
        position: static;
    }
}

@media (max-width: 720px) {
    .tw-export-backup-card--active {
        display: grid;
    }
    .tw-backup-scope,
    .tw-backup-category-grid {
        grid-template-columns: 1fr;
    }
    .tw-backup-selection-head,
    .tw-backup-actions {
        align-items: stretch;
        flex-direction: column;
    }
    .tw-backup-actions .tw-btn,
    .tw-backup-selection-head .tw-btn {
        width: 100%;
    }
}


/* ========================================================================== */
/* 2K.3 – Access, Trial & Lifetime Purchase UI                                */
/* ========================================================================== */
.tw-access-badge {
    appearance: none;
    font: inherit;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease;
}
.tw-access-badge:hover,
.tw-access-badge:focus-visible {
    border-color: rgba(212, 175, 55, 0.52);
    background: rgba(212, 175, 55, 0.11);
    color: #f2d978;
    outline: none;
}
.tw-access-badge:active {
    transform: translateY(1px);
}
.tw-access-badge[data-access-state='lifetime'] {
    border-color: rgba(112, 200, 151, 0.34);
    background: rgba(112, 200, 151, 0.07);
    color: #a9ddb9;
}
.tw-access-badge[data-access-state='readonly'] {
    border-color: rgba(226, 121, 121, 0.3);
    background: rgba(226, 121, 121, 0.06);
    color: #e0a0a0;
}
.tw-access-badge[data-access-state='trial'] {
    text-transform: none;
    letter-spacing: 0.025em;
}
.tw-readonly-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}
.tw-inline-link {
    appearance: none;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--tw-gold-soft);
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}
.tw-modal--access {
    width: min(840px, 100%);
}
.tw-access-options {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: stretch;
}
.tw-access-card {
    min-height: 205px;
}
.tw-access-card--purchase {
    min-width: 0;
}
.tw-access-card--status {
    max-width: 520px;
}
.tw-access-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 9px;
}
.tw-access-price strong {
    margin: 0;
    color: #fff;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.55rem;
    font-weight: 500;
}
.tw-access-price__old {
    color: #748087;
    font-size: 0.76rem;
    text-decoration: line-through;
}
.tw-access-discount {
    padding: 3px 6px;
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.08);
    color: var(--tw-gold-soft);
    font-size: 0.64rem;
    font-weight: 800;
}
.tw-access-meta,
.tw-access-footnote {
    display: block;
    margin-top: 6px;
    color: #7f8b92;
    font-size: 0.67rem;
    line-height: 1.45;
}
.tw-purchase-legal {
    display: grid;
    gap: 8px;
    margin: 2px 0 13px;
    padding: 11px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.12);
}
.tw-purchase-legal.has-error {
    border-color: rgba(226, 121, 121, 0.45);
}
.tw-access-check {
    display: grid;
    grid-template-columns: 16px 1fr;
    gap: 8px;
    align-items: start;
    color: #99a3a9;
    font-size: 0.67rem;
    line-height: 1.45;
}
.tw-access-check input {
    width: 14px;
    height: 14px;
    margin: 2px 0 0;
    accent-color: #d4af37;
}
.tw-access-check a {
    color: var(--tw-gold-soft);
}
.tw-access-card .tw-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}
@media (max-width: 760px) {
    .tw-access-badge[data-access-state='trial'] {
        max-width: 138px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .tw-modal--access {
        width: min(620px, 100%);
    }
}
.tw-modal-close[hidden] {
    display: none !important;
}

/* ========================================================================== */
/* Public landing – final responsive polish + rotating product preview         */
/* ========================================================================== */
.tw-window-preview__project {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-window-preview__tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--tw-line);
    background: #0f1418;
    overflow-x: auto;
    scrollbar-width: none;
}
.tw-window-preview__tabs::-webkit-scrollbar {
    display: none;
}
.tw-window-preview__tabs button {
    flex: 0 0 auto;
    padding: 7px 11px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #7f8a91;
    font: inherit;
    font-size: 0.72rem;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.tw-window-preview__tabs button:hover,
.tw-window-preview__tabs button.is-active {
    border-color: rgba(212, 175, 55, 0.24);
    background: rgba(212, 175, 55, 0.08);
    color: var(--tw-gold-soft);
}
.tw-window-preview__views {
    min-height: 400px;
}
.tw-preview-view {
    display: none;
}
.tw-preview-view.is-active {
    display: block;
    animation: tw-preview-enter 260ms ease both;
}
@keyframes tw-preview-enter {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}
.tw-preview-module {
    display: grid;
    grid-template-columns: 205px minmax(0, 1fr);
    min-height: 400px;
    background: #20262b;
}
.tw-preview-module__nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px 16px;
    border-right: 1px solid var(--tw-line);
    background: #161b1f;
    color: #7f8990;
    font-size: 0.78rem;
}
.tw-preview-module__nav strong {
    margin-bottom: 4px;
    color: #e8eaeb;
}
.tw-preview-module__nav span {
    padding: 8px 9px;
    border-radius: 7px;
}
.tw-preview-module__nav span.is-active {
    background: var(--tw-gold-dim);
    color: var(--tw-gold-soft);
}
.tw-preview-module__main {
    min-width: 0;
    padding: 26px;
    color: #d9dddf;
}
.tw-preview-module__heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.tw-preview-module__heading small,
.tw-preview-entity small,
.tw-preview-stats small,
.tw-preview-entity-detail small {
    color: var(--tw-gold);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.09em;
}
.tw-preview-module__heading h2 {
    margin: 4px 0 0;
    color: #f2f3f3;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.42rem;
    font-weight: 500;
}
.tw-preview-module__heading > span {
    color: #7f8990;
    font-size: 0.72rem;
}
.tw-preview-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.tw-preview-column {
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 9px;
    background: rgba(10, 14, 17, 0.34);
}
.tw-preview-column > strong {
    display: block;
    margin-bottom: 10px;
    color: #aeb6bb;
    font-size: 0.72rem;
}
.tw-preview-column article {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 8px;
    padding: 11px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 8px;
    background: #171d21;
}
.tw-preview-column article.is-accent {
    border-color: rgba(212,175,55,.35);
    background: rgba(212,175,55,.07);
}
.tw-preview-column article small {
    color: var(--tw-gold);
    font-size: .58rem;
}
.tw-preview-column article b {
    color: #edf0f1;
    font-size: .8rem;
}
.tw-preview-column article span {
    color: #7f8990;
    font-size: .68rem;
    line-height: 1.45;
}
.tw-preview-world-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(220px, .95fr);
    gap: 10px;
}
.tw-preview-entity,
.tw-preview-entity-detail,
.tw-preview-stats article {
    padding: 15px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 9px;
    background: #171d21;
}
.tw-preview-entity {
    display: flex;
    min-height: 94px;
    flex-direction: column;
    gap: 7px;
}
.tw-preview-entity.is-active {
    border-color: rgba(212,175,55,.34);
    background: rgba(212,175,55,.065);
}
.tw-preview-entity b,
.tw-preview-entity-detail strong {
    color: #edf0f1;
    font-size: .88rem;
}
.tw-preview-entity span,
.tw-preview-entity-detail p {
    color: #7f8990;
    font-size: .69rem;
    line-height: 1.5;
}
.tw-preview-entity-detail {
    grid-column: 3;
    grid-row: 1 / span 2;
}
.tw-preview-entity-detail strong {
    display: block;
    margin: 9px 0 14px;
}
.tw-preview-entity-detail p {
    margin: 0 0 10px;
    padding: 9px;
    border-radius: 7px;
    background: rgba(255,255,255,.025);
}
.tw-preview-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.tw-preview-stats article {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 7px;
}
.tw-preview-stats strong {
    color: #f0f1f2;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.35rem;
    font-weight: 500;
}
.tw-preview-stats span {
    color: #79848b;
    font-size: .66rem;
}
.tw-preview-bars {
    display: flex;
    align-items: end;
    gap: 9px;
    height: 125px;
    margin-top: 20px;
    padding: 16px 14px 0;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 9px;
    background: rgba(10,14,17,.25);
}
.tw-preview-bars span {
    flex: 1;
    height: var(--tw-bar);
    min-width: 8px;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, rgba(212,175,55,.85), rgba(212,175,55,.18));
}
.tw-landing-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
    padding: 34px 0 0;
    color: #66727a;
    font-size: .72rem;
    letter-spacing: .02em;
}

@media (max-width: 900px) {
    .tw-preview-module {
        grid-template-columns: 160px minmax(0, 1fr);
    }
    .tw-preview-world-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .tw-preview-entity-detail {
        grid-column: 1 / -1;
        grid-row: auto;
    }
    .tw-preview-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .tw-landing {
        width: min(100% - 24px, 1220px);
        padding-top: 18px;
        padding-bottom: 42px;
    }
    .tw-landing-body .tw-brand--landing {
        display: flex;
    }
    .tw-landing-copy {
        padding: 58px 0 34px;
    }
    .tw-landing-copy h1 {
        max-width: 100%;
        font-size: clamp(2rem, 8.5vw, 3rem);
        line-height: .99;
        letter-spacing: -.035em;
        overflow-wrap: anywhere;
        hyphens: auto;
    }
    .tw-landing-lead {
        font-size: 1rem;
        line-height: 1.67;
    }
    .tw-window-preview {
        display: block;
        margin-top: 20px;
        border-radius: 14px;
    }
    .tw-window-preview__top {
        grid-template-columns: auto minmax(0, 1fr) auto;
        min-height: 42px;
        padding: 0 11px;
        font-size: .68rem;
    }
    .tw-window-preview__project {
        padding: 0 8px;
        text-align: center;
    }
    .tw-window-preview__tabs {
        padding: 5px 7px;
    }
    .tw-window-preview__tabs button {
        padding: 6px 9px;
        font-size: .66rem;
    }
    .tw-window-preview__views {
        min-height: 310px;
    }
    .tw-window-preview__body {
        grid-template-columns: 36px 112px minmax(0, 1fr);
        min-height: 310px;
    }
    .tw-window-preview__rail {
        gap: 16px;
        padding-top: 14px;
        font-size: .72rem;
    }
    .tw-window-preview__tree {
        gap: 9px;
        padding: 15px 10px;
        font-size: .66rem;
    }
    .tw-window-preview__paper {
        min-width: 0;
        padding: 32px 18px;
    }
    .tw-window-preview__paper h2 {
        margin-bottom: 20px;
        font-size: 1.15rem;
    }
    .tw-window-preview__paper p {
        font-size: .73rem;
        line-height: 1.58;
    }
    .tw-window-preview__inspector {
        display: none;
    }
    .tw-preview-module {
        grid-template-columns: 116px minmax(0, 1fr);
        min-height: 310px;
    }
    .tw-preview-module__nav {
        gap: 6px;
        padding: 14px 9px;
        font-size: .65rem;
    }
    .tw-preview-module__nav span {
        padding: 7px 6px;
    }
    .tw-preview-module__main {
        padding: 16px 12px;
    }
    .tw-preview-module__heading {
        align-items: flex-start;
        margin-bottom: 12px;
    }
    .tw-preview-module__heading h2 {
        font-size: 1.05rem;
    }
    .tw-preview-module__heading > span {
        display: none;
    }
    .tw-preview-board {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
    }
    .tw-preview-board::-webkit-scrollbar {
        display: none;
    }
    .tw-preview-column {
        flex: 0 0 145px;
        scroll-snap-align: start;
    }
    .tw-preview-world-grid {
        grid-template-columns: 1fr;
    }
    .tw-preview-entity:nth-of-type(n+3) {
        display: none;
    }
    .tw-preview-entity-detail {
        grid-column: auto;
    }
    .tw-preview-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }
    .tw-preview-stats article {
        padding: 11px;
    }
    .tw-preview-stats strong {
        font-size: 1.05rem;
    }
    .tw-preview-bars {
        height: 88px;
        margin-top: 10px;
        gap: 5px;
        padding: 10px 8px 0;
    }
    .tw-landing-principles {
        padding-top: 28px;
    }
}

@media (max-width: 520px) {
    .tw-landing-copy {
        padding-top: 44px;
    }
    .tw-landing-copy h1 {
        font-size: clamp(1.9rem, 8.9vw, 2.55rem);
        line-height: 1;
        letter-spacing: -.025em;
    }
    .tw-landing-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
    .tw-landing-actions .tw-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
    .tw-window-preview__top {
        grid-template-columns: auto 1fr;
    }
    .tw-window-preview__saved {
        display: none;
    }
    .tw-window-preview__body {
        grid-template-columns: 34px minmax(0, 1fr);
    }
    .tw-window-preview__tree {
        display: none;
    }
    .tw-window-preview__paper {
        padding: 28px 18px;
    }
    .tw-preview-module {
        grid-template-columns: 88px minmax(0, 1fr);
    }
    .tw-preview-module__nav {
        padding-left: 7px;
        padding-right: 7px;
    }
    .tw-preview-module__nav strong {
        font-size: .69rem;
    }
    .tw-preview-module__nav span {
        font-size: .59rem;
    }
    .tw-preview-stats article:nth-child(n+3) {
        display: none;
    }
    .tw-preview-bars span:nth-child(even) {
        display: none;
    }
    .tw-landing-meta {
        padding-top: 26px;
        font-size: .66rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tw-preview-view.is-active {
        animation: none;
    }
}

/* ========================================================================== */
/* HOTFIX 2026-10-07 – Schreiblayout, Kapitelansicht, A4-Seiten & Lineal      */
/* ========================================================================== */

/* Nur der eigentliche Papierbereich scrollt. Metadaten, Titel, Formatleiste
   und optionales Lineal bleiben ruhig an ihrer Position. */
.tw-editor-shell {
    display: flex;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
}

.tw-editor-empty,
.tw-chapter-view {
    flex: 1 1 auto;
    min-height: 0;
}

.tw-editor-document:not([hidden]) {
    display: grid;
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
    grid-template-rows: auto auto auto auto minmax(0, 1fr);
    overflow: hidden;
    padding-bottom: 0;
}

.tw-paper-wrap {
    min-height: 0;
    height: 100%;
    align-items: flex-start;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 0 0 72px;
    scrollbar-width: thin;
    scrollbar-color: #4a535a transparent;
}

/* Formatleiste etwas griffiger, ohne den kompakten Charakter zu verlieren. */
.tw-formatbar {
    flex: 0 0 auto;
    margin-bottom: 8px;
    padding: 5px 6px;
}

.tw-format-btn {
    min-width: 32px;
    height: 30px;
    padding-inline: 7px;
    font-size: .78rem;
}

.tw-format-btn--icon {
    padding: 0;
}

.tw-format-btn--icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Das Lineal bildet die physische A4-Breite 0–21 cm ab. Bei A4 werden die
   festen 2,5-cm-Seitenränder sichtbar markiert. */
.tw-ruler {
    flex: 0 0 auto;
    margin-bottom: 8px;
}

.tw-ruler__track {
    inset: 0;
}

.tw-ruler__page-margin {
    position: absolute;
    z-index: 0;
    top: 0;
    bottom: 0;
    background: rgba(212,175,55,.055);
    pointer-events: none;
}

.tw-ruler__page-margin.is-left {
    left: 0;
    border-right: 1px solid rgba(212,175,55,.28);
}

.tw-ruler__page-margin.is-right {
    right: 0;
    border-left: 1px solid rgba(212,175,55,.28);
}

.tw-ruler__tick {
    z-index: 1;
}

/* A4 wird im Editor als echte Seitenfolge visualisiert. ProseMirror bleibt ein
   einziges Dokument; Seitenwechsel werden nur als Layout-Dekoration berechnet. */
.tw-app[data-page-mode='a4'] .tw-paper {
    position: relative;
    overflow: visible;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none;
}

.tw-page-sheets {
    position: absolute;
    z-index: 0;
    inset: 0 0 auto;
    width: 100%;
    pointer-events: none;
}

.tw-page-sheet {
    position: absolute;
    left: 0;
    width: 100%;
    border-radius: 3px;
    background: var(--tw-paper);
    box-shadow: 0 20px 58px rgba(0,0,0,.18);
}

.tw-app[data-paper-theme='white'] .tw-page-sheet {
    background: #fff;
}

.tw-app[data-paper-theme='sepia'] .tw-page-sheet {
    background: #eee1c6;
}

.tw-app[data-paper-theme='dark'] .tw-page-sheet {
    border: 1px solid rgba(255,255,255,.07);
    background: #171a1d;
}

.tw-app[data-page-mode='a4'] .tw-editor,
.tw-app[data-page-mode='a4'] .tw-editor .ProseMirror {
    position: relative;
    z-index: 1;
    min-height: calc(297mm - var(--tw-editor-page-padding) - var(--tw-editor-page-padding));
}

.tw-page-break-widget {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    pointer-events: none;
    user-select: none;
}

/* Kapitelansicht: Außenfläche bleibt dunkel. Nur die eigentliche Seite trägt
   die Papierfarbe. Dadurch entsteht kein riesiger weißer Block mehr. */
.tw-chapter-view {
    width: 100%;
    max-width: none;
    overflow: auto;
    padding: 32px 8px 80px;
    scrollbar-width: thin;
    scrollbar-color: #4a535a transparent;
}

.tw-chapter-view__head,
.tw-chapter-view__hint {
    width: min(1040px, 100%);
    margin-right: auto;
    margin-left: auto;
}

.tw-chapter-title {
    display: block;
    width: min(720px, 100%);
    margin: 7px 0 6px;
    padding: 0 0 2px;
    border: 0;
    border-bottom: 1px solid transparent;
    outline: none;
    background: transparent;
    color: #f2f3f3;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 500;
    line-height: 1.08;
}

.tw-chapter-title:hover,
.tw-chapter-title:focus {
    border-bottom-color: rgba(212,175,55,.24);
}

.tw-chapter-title:disabled {
    opacity: .82;
}

.tw-chapter-scenes {
    width: 100%;
}

.tw-chapter-scene {
    display: flex;
    width: 100%;
    max-height: none;
    align-items: center;
    flex-direction: column;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none;
}

.tw-chapter-scene__head,
.tw-chapter-scene__content,
.tw-app[data-page-mode='a4'] .tw-chapter-scene__head,
.tw-app[data-page-mode='a4'] .tw-chapter-scene__content {
    width: min(210mm, 100%);
    min-width: 0;
    box-sizing: border-box;
}

.tw-chapter-scene__head {
    min-height: 44px;
    flex: 0 0 auto;
    border: 1px solid rgba(255,255,255,.09);
    border-bottom: 1px solid rgba(255,255,255,.075);
    border-radius: 10px 10px 0 0;
    background: rgba(16,20,23,.94);
}

.tw-chapter-scene__head > div:last-child {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}

.tw-chapter-scene__head .tw-quiet-button {
    flex: 0 0 auto;
}

.tw-chapter-scene__content,
.tw-app[data-page-mode='a4'] .tw-chapter-scene__content {
    min-height: 297mm;
    margin: 0 auto;
    padding: var(--tw-editor-page-padding);
    border-radius: 0 0 3px 3px;
    background: var(--tw-paper);
    box-shadow: 0 20px 58px rgba(0,0,0,.16);
}

.tw-app[data-paper-theme='white'] .tw-chapter-scene__content {
    background: #fff;
    color: #202020;
}

.tw-app[data-paper-theme='sepia'] .tw-chapter-scene__content {
    background: #eee1c6;
    color: #2f2921;
}

.tw-app[data-paper-theme='dark'] .tw-chapter-scene__content {
    border: 1px solid rgba(255,255,255,.07);
    background: #171a1d;
    color: #e6e3dc;
}

/* Bei 1440px mit geöffnetem Inspector muss A4 weiterhin in die Mittelspalte
   passen. Die alte große horizontale Dokumentpolsterung war hier der Engpass. */
@media (min-width: 921px) and (max-width: 1500px) {
    .tw-editor-document {
        padding-right: 8px;
        padding-left: 8px;
    }

    .tw-document-meta,
    .tw-document-title,
    .tw-formatbar {
        width: min(790px, 100%);
        max-width: 100%;
    }
}

@media (max-width: 720px) {
    .tw-editor-document:not([hidden]) {
        padding-bottom: 0;
    }

    .tw-paper-wrap {
        padding-bottom: 56px;
    }

    .tw-format-btn {
        min-width: 31px;
        height: 29px;
    }

    .tw-chapter-view {
        padding: 18px 8px 64px;
    }

    .tw-chapter-scene__head,
    .tw-chapter-scene__content,
    .tw-app[data-page-mode='a4'] .tw-chapter-scene__head,
    .tw-app[data-page-mode='a4'] .tw-chapter-scene__content {
        width: 100%;
    }

    .tw-chapter-scene__content,
    .tw-app[data-page-mode='a4'] .tw-chapter-scene__content {
        padding: clamp(30px, 8vw, 25mm);
    }
}

.tw-chapter-view__head > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
}

@media (max-width: 860px) {
    .tw-chapter-view__head {
        align-items: stretch;
        flex-direction: column;
    }

    .tw-chapter-view__actions {
        justify-content: flex-start;
    }
}

/* ========================================================================== */
/* PHASE 2L.1 – EIGENE NOTIZEN & KOMMENTARE IM SCHREIBBEREICH                */
/* ========================================================================== */

.tw-annotation-toolbar {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
    margin-left: 2px;
}

.tw-annotation-toolbar__control {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    border-radius: 7px;
    background: rgba(255,255,255,.018);
}

.tw-annotation-toggle span {
    margin-left: 4px;
    color: #c7cdd0;
    font-variant-numeric: tabular-nums;
}

.tw-annotation-toggle.is-note.is-active {
    border-color: rgba(212,175,55,.34);
    background: rgba(212,175,55,.10);
    color: #f2dda0;
}

.tw-annotation-toggle.is-comment.is-active {
    border-color: rgba(103,160,214,.34);
    background: rgba(75,133,188,.10);
    color: #c7dff4;
}

.tw-annotation-add {
    min-width: 25px;
    width: 25px;
    padding: 0;
    font-size: .88rem;
}

.tw-annotation-add.is-note:not(:disabled):hover {
    color: #f2dda0;
}

.tw-annotation-add.is-comment:not(:disabled):hover {
    color: #c7dff4;
}

.tw-writing-canvas {
    position: relative;
    display: grid;
    width: max-content;
    max-width: 100%;
    min-height: 100%;
    grid-template-columns: 0 minmax(0, auto) 0;
    align-items: stretch;
    column-gap: 0;
    margin: 0 auto;
    transition: column-gap .16s ease;
}

.tw-writing-canvas.show-notes:not(.show-comments),
.tw-writing-canvas.show-comments:not(.show-notes) {
    /* Immer zwei symmetrische Randplaetze reservieren. Dadurch bleibt die
       Papiermitte exakt auf der Mitte der Schreibflaeche, auch wenn nur eine
       der beiden Annotation-Seiten sichtbar ist. */
    grid-template-columns: 210px minmax(0, auto) 210px;
    column-gap: 14px;
}

.tw-writing-canvas.show-notes.show-comments {
    grid-template-columns: 210px minmax(0, auto) 210px;
    column-gap: 14px;
}

.tw-annotation-rail {
    position: relative;
    width: 210px;
    min-height: 100%;
    align-self: stretch;
    overflow: visible;
}

.tw-annotation-card {
    position: absolute;
    z-index: 5;
    left: 0;
    width: 100%;
    min-height: 78px;
    padding: 9px 10px 8px;
    border: 1px solid rgba(255,255,255,.095);
    border-left: 3px solid var(--tw-annotation-accent, #d4af37);
    border-radius: 9px;
    outline: 0;
    background: rgba(18,22,25,.95);
    color: #dce1e3;
    box-shadow: 0 8px 24px rgba(0,0,0,.14);
    cursor: pointer;
    transition: border-color .14s ease, background .14s ease, transform .14s ease, opacity .14s ease;
}

.tw-annotation-card:hover,
.tw-annotation-card:focus-visible {
    border-color: color-mix(in srgb, var(--tw-annotation-accent, #d4af37) 52%, rgba(255,255,255,.08));
    background: rgba(24,29,33,.98);
    transform: translateY(-1px);
}

.tw-annotation-card.is-gold { --tw-annotation-accent: #d4af37; }
.tw-annotation-card.is-blue { --tw-annotation-accent: #69a8df; }
.tw-annotation-card.is-green { --tw-annotation-accent: #67b58f; }
.tw-annotation-card.is-red { --tw-annotation-accent: #d77979; }
.tw-annotation-card.is-purple { --tw-annotation-accent: #a982d2; }
.tw-annotation-card.is-gray { --tw-annotation-accent: #8d989f; }

.tw-annotation-card.is-done {
    opacity: .56;
}

.tw-annotation-card.is-orphaned {
    border-style: dashed;
}

.tw-annotation-card__head {
    display: grid;
    grid-template-columns: 8px minmax(0,1fr) auto 24px;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.tw-annotation-card__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--tw-annotation-accent, #d4af37);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--tw-annotation-accent, #d4af37) 15%, transparent);
}

.tw-annotation-card__head strong {
    overflow: hidden;
    color: #f1f3f4;
    font-size: .68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tw-annotation-card__head small {
    color: #8f999f;
    font-size: .57rem;
    text-transform: uppercase;
    letter-spacing: .055em;
}

.tw-annotation-card__head button {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #7f8a90;
    cursor: pointer;
}

.tw-annotation-card__head button:hover {
    background: rgba(255,255,255,.055);
    color: #e8ecee;
}

.tw-annotation-card p {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: #b6bec2;
    font-size: .68rem;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.tw-annotation-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 7px;
    color: #778289;
    font-size: .57rem;
}

.tw-annotation-card__meta em {
    color: #d5a76f;
    font-style: normal;
}

.tw-annotation-mark {
    border-radius: 2px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.tw-annotation-mark.is-note.is-gold { background: rgba(212,175,55,.17); box-shadow: inset 0 -1px 0 rgba(212,175,55,.62); }
.tw-annotation-mark.is-note.is-blue { background: rgba(105,168,223,.14); box-shadow: inset 0 -1px 0 rgba(105,168,223,.58); }
.tw-annotation-mark.is-note.is-green { background: rgba(103,181,143,.14); box-shadow: inset 0 -1px 0 rgba(103,181,143,.58); }
.tw-annotation-mark.is-note.is-red { background: rgba(215,121,121,.13); box-shadow: inset 0 -1px 0 rgba(215,121,121,.58); }
.tw-annotation-mark.is-note.is-purple { background: rgba(169,130,210,.13); box-shadow: inset 0 -1px 0 rgba(169,130,210,.58); }
.tw-annotation-mark.is-note.is-gray { background: rgba(141,152,159,.12); box-shadow: inset 0 -1px 0 rgba(141,152,159,.52); }

.tw-annotation-mark.is-comment {
    text-decoration-line: underline;
    text-decoration-style: dotted;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}
.tw-annotation-mark.is-comment.is-gold { text-decoration-color: #d4af37; }
.tw-annotation-mark.is-comment.is-blue { text-decoration-color: #69a8df; background: rgba(105,168,223,.075); }
.tw-annotation-mark.is-comment.is-green { text-decoration-color: #67b58f; background: rgba(103,181,143,.065); }
.tw-annotation-mark.is-comment.is-red { text-decoration-color: #d77979; background: rgba(215,121,121,.065); }
.tw-annotation-mark.is-comment.is-purple { text-decoration-color: #a982d2; background: rgba(169,130,210,.065); }
.tw-annotation-mark.is-comment.is-gray { text-decoration-color: #8d989f; background: rgba(141,152,159,.06); }
.tw-annotation-mark.is-hidden {
    background: transparent !important;
    box-shadow: none !important;
    text-decoration: none !important;
    pointer-events: none;
}
.tw-annotation-mark.is-done { opacity: .55; }

.tw-modal--annotation {
    width: min(560px, calc(100vw - 28px));
}

.tw-annotation-anchor-preview {
    margin: -4px 0 16px;
    padding: 9px 11px;
    border: 1px solid rgba(212,175,55,.14);
    border-radius: 8px;
    background: rgba(212,175,55,.04);
    color: #9aa4aa;
    font-size: .7rem;
    line-height: 1.5;
}

.tw-annotation-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.tw-annotation-colors {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 14px 0 4px;
    padding: 0;
    border: 0;
}

.tw-annotation-colors legend {
    margin: 0 12px 0 0;
    color: #8c969d;
    font-size: .66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.tw-annotation-colors label {
    position: relative;
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    cursor: pointer;
}

.tw-annotation-colors input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tw-annotation-colors span {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(255,255,255,.08);
    transition: transform .12s ease, box-shadow .12s ease;
}

.tw-annotation-colors span.is-gold { background: #d4af37; }
.tw-annotation-colors span.is-blue { background: #69a8df; }
.tw-annotation-colors span.is-green { background: #67b58f; }
.tw-annotation-colors span.is-red { background: #d77979; }
.tw-annotation-colors span.is-purple { background: #a982d2; }
.tw-annotation-colors span.is-gray { background: #8d989f; }

.tw-annotation-colors input:checked + span {
    transform: scale(1.18);
    box-shadow: 0 0 0 2px #111518, 0 0 0 4px rgba(233,236,238,.58);
}

.tw-annotation-modal-actions {
    align-items: center;
}

.tw-annotation-modal-spacer {
    flex: 1 1 auto;
}

/* Die Randkarten sind eine Desktop-/Fokusfunktion. Auf kleineren Layouts
   bleiben die Daten erhalten, werden aber bewusst nicht als Seitenränder
   angeboten, damit der Manuskriptbereich nicht zusammengedrückt wird. */
@media (max-width: 920px) {
    .tw-annotation-toolbar,
    .tw-annotation-rail {
        display: none !important;
    }
    .tw-writing-canvas,
    .tw-writing-canvas.show-notes,
    .tw-writing-canvas.show-comments,
    .tw-writing-canvas.show-notes.show-comments {
        display: block;
        width: max-content;
        max-width: 100%;
        margin: 0 auto;
    }
}

@media (max-width: 560px) {
    .tw-annotation-form-grid {
        grid-template-columns: 1fr;
    }
    .tw-annotation-colors {
        flex-wrap: wrap;
    }
}

/* ========================================================================== */
/* HOTFIX 2026-10-07 – Annotation-Rails: feste Grid-Spaltenzuordnung          */
/* ========================================================================== */
/*
 * Die Randspalten werden per [hidden] vollständig aus dem Layout genommen.
 * Ohne feste Grid-Zuordnung rückte dadurch das Papier beim Auto-Placement in
 * die erste (0px breite) Grid-Spalte und begann optisch erst in der Mitte der
 * Schreibfläche. Die drei Bestandteile bekommen deshalb immer ihre semantische
 * Spalte – unabhängig davon, ob eine Randspalte aktuell sichtbar ist.
 */
.tw-writing-canvas > .tw-annotation-rail.is-notes {
    grid-column: 1;
    grid-row: 1;
}

.tw-writing-canvas > .tw-paper {
    grid-column: 2;
    grid-row: 1;
}

.tw-writing-canvas > .tw-annotation-rail.is-comments {
    grid-column: 3;
    grid-row: 1;
}

/* ========================================================================== */
/* PHASE 2L.2 – ANNOTATION-POLISH                                             */
/* ========================================================================== */

/* Karten werden mit Einfachklick zur Textstelle fokussiert und per
   Doppelklick bearbeitet. Das X bleibt bewusst die einzige permanente
   Kartenaktion, damit die Randspalten ruhig und kompakt bleiben. */
.tw-annotation-card__delete {
    font-size: 1rem;
    line-height: 1;
}

.tw-annotation-card__delete:hover,
.tw-annotation-card__delete:focus-visible {
    background: rgba(226, 121, 121, .10) !important;
    color: #f0a0a0 !important;
}

.tw-annotation-card__delete:active {
    transform: scale(.94);
}

/* Bei vielen Anmerkungen wächst die Rail durch das JS bis unter die letzte
   kollisionsfrei positionierte Karte. Die Karten selbst bleiben darüber
   absolut an ihrer Textstelle orientiert. */
.tw-annotation-rail {
    contain: layout style;
}

/* ========================================================================== */
/* PHASE 2L.3 – PLOTBOARD-ANNOTATIONEN & ABSCHLUSS                            */
/* ========================================================================== */

.tw-plan-card__annotations {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    min-height: 18px;
    margin-top: 1px;
}

.tw-plan-annotation-badge {
    display: inline-flex;
    min-width: 28px;
    height: 18px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 6px;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 999px;
    background: rgba(255,255,255,.025);
    color: #7f8990;
    font-size: .56rem;
    font-weight: 750;
    line-height: 1;
}

.tw-plan-annotation-badge i {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: currentColor;
    opacity: .9;
}

.tw-plan-annotation-badge.is-note {
    color: #c8aa45;
}

.tw-plan-annotation-badge.is-comment {
    color: #6eaee4;
}

.tw-plan-annotation-badge.is-priority {
    border-color: rgba(226,121,121,.12);
    background: rgba(226,121,121,.045);
    color: #d98a8a;
}

.tw-plan-annotation-head {
    margin-top: 18px;
}

.tw-plan-annotation-list {
    display: grid;
    gap: 7px;
    margin: 0 0 14px;
}

.tw-plan-annotation-empty {
    padding: 11px 12px;
    border: 1px dashed rgba(255,255,255,.08);
    border-radius: 8px;
    color: #6f7980;
    font-size: .69rem;
    line-height: 1.45;
}

.tw-plan-annotation-item {
    position: relative;
    display: grid;
    gap: 6px;
    padding: 9px 10px;
    border: 1px solid rgba(255,255,255,.07);
    border-left: 2px solid rgba(212,175,55,.55);
    border-radius: 8px;
    outline: none;
    background: rgba(255,255,255,.018);
    cursor: default;
    transition: border-color 120ms ease, background 120ms ease;
}

.tw-plan-annotation-item:hover,
.tw-plan-annotation-item:focus-visible {
    border-color: rgba(255,255,255,.12);
    background: rgba(255,255,255,.03);
}

.tw-plan-annotation-item.is-comment {
    border-left-color: rgba(105,168,223,.8);
}

.tw-plan-annotation-item.is-gold { border-left-color: rgba(212,175,55,.8); }
.tw-plan-annotation-item.is-blue { border-left-color: rgba(105,168,223,.8); }
.tw-plan-annotation-item.is-green { border-left-color: rgba(103,181,143,.8); }
.tw-plan-annotation-item.is-red { border-left-color: rgba(215,121,121,.82); }
.tw-plan-annotation-item.is-purple { border-left-color: rgba(169,130,210,.82); }
.tw-plan-annotation-item.is-gray { border-left-color: rgba(141,152,159,.72); }

.tw-plan-annotation-item.is-done {
    opacity: .62;
}

.tw-plan-annotation-item__head {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.tw-plan-annotation-item__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    color: #c8aa45;
}

.tw-plan-annotation-item.is-comment .tw-plan-annotation-item__dot {
    color: #6eaee4;
}

.tw-plan-annotation-item__head strong {
    color: #d9dddf;
    font-size: .66rem;
}

.tw-plan-annotation-item__head small {
    overflow: hidden;
    color: #707b82;
    font-size: .56rem;
    font-weight: 700;
    text-align: right;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.tw-plan-annotation-item__delete {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #68737a;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.tw-plan-annotation-item__delete:hover,
.tw-plan-annotation-item__delete:focus-visible {
    background: rgba(226,121,121,.08);
    color: #e59a9a;
}

.tw-plan-annotation-item p {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: #9aa3a9;
    font-size: .68rem;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.tw-plan-annotation-item__meta {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
    color: #667179;
    font-size: .56rem;
}

.tw-plan-annotation-item__meta span {
    flex: 0 0 auto;
    color: #7e8990;
}

.tw-plan-annotation-item__meta em {
    overflow: hidden;
    min-width: 0;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ========================================================================== */
/* Phase 2M.1 – Analyseengine-Fundament                                       */
/* ========================================================================== */
.tw-analysis-mode-switch {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--tw-line);
    border-radius: 8px;
    background: rgba(0,0,0,.14);
}
.tw-analysis-mode-switch button {
    min-height: 27px;
    padding: 0 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #717d84;
    font-size: .62rem;
    font-weight: 700;
    cursor: pointer;
}
.tw-analysis-mode-switch button:hover { color: #c7ced2; }
.tw-analysis-mode-switch button.is-active {
    background: rgba(212,175,55,.1);
    color: var(--tw-gold-soft);
    box-shadow: inset 0 0 0 1px rgba(212,175,55,.18);
}
.tw-analysis-report-summary {
    margin: 0 0 12px;
    padding: 10px;
    border: 1px solid rgba(212,175,55,.12);
    border-radius: 9px;
    background: rgba(212,175,55,.018);
}
.tw-analysis-report-summary .tw-inspector-section-head { margin: 0 0 8px; }
.tw-analysis-severity-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 6px;
}
.tw-analysis-severity-grid > div {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    min-height: 34px;
    padding: 7px 8px;
    border: 1px solid rgba(255,255,255,.05);
    border-radius: 7px;
    background: rgba(0,0,0,.09);
}
.tw-analysis-severity-grid span {
    color: #778289;
    font-size: .59rem;
}
.tw-analysis-severity-grid strong {
    color: #e5e9ea;
    font-size: .76rem;
}
.tw-analysis-severity-grid .is-error { border-left: 2px solid #d35f5f; }
.tw-analysis-severity-grid .is-warning { border-left: 2px solid #d59a54; }
.tw-analysis-severity-grid .is-review { border-left: 2px solid #9d7fc6; }
.tw-analysis-severity-grid .is-info { border-left: 2px solid #6f98b6; }
#twAnalysisCurrentMeta {
    max-width: 64%;
    color: #68747b;
    font-size: .57rem;
    line-height: 1.35;
    text-align: right;
}
@media (max-width: 1120px) {
    .tw-analysis-toolbar { width: calc(100% - 24px); }
    .tw-analysis-toolbar__top,
    .tw-analysis-toolbar__bottom { column-gap: 8px; }
    .tw-analysis-toolbar__actions { gap: 6px; }
    .tw-analysis-toolbar__actions .tw-btn { padding-left: 10px; padding-right: 10px; }
}
@media (max-width: 920px) {
    #twAnalysisCurrentMeta { max-width: 58%; }
}

/* ========================================================================== */
/* Phase 2M.2A.4 – Analyse-Toolbar: finaler Mobile-Layout-Fix                 */
/* ========================================================================== */
/*
 * Root cause:
 * .tw-editor-shell ist ein fester Flex-Container. Der Analyse-Toolbar war als
 * Flex-Item weiter schrumpfbar, während .tw-editor-document mit height:100%
 * ebenfalls Platz beansprucht. Sobald die Mobile-Toolbar mehrzeilig wurde,
 * schrumpfte der Toolbar und overflow:hidden schnitt den unteren Filterbereich
 * ab. Daher: Toolbar nie schrumpfen lassen; im Analysemodus darf stattdessen
 * das Dokument den verbleibenden Platz übernehmen.
 */
.tw-analysis-toolbar {
    flex: 0 0 auto;
}

@media (max-width: 920px) {
    .tw-analysis-toolbar {
        width: calc(100% - 16px);
        margin: 10px 8px 8px;
    }

    .tw-analysis-toolbar__top,
    .tw-analysis-toolbar__bottom {
        column-gap: 8px;
    }

    .tw-analysis-toolbar__actions,
    .tw-analysis-toolbar__filters {
        width: 100%;
        min-width: 0;
    }

    .tw-analysis-mode-switch,
    .tw-analysis-service-state {
        justify-self: end;
    }
}

@media (max-width: 640px) {
    /* Das Dokument schrumpft auf die Resthöhe – nicht mehr der Toolbar. */
    .tw-app[data-workspace-mode='analysis'] .tw-editor-document:not([hidden]) {
        flex: 1 1 0 !important;
        height: auto !important;
        min-height: 0 !important;
    }

    .tw-analysis-toolbar {
        display: flex !important;
        width: calc(100% - 16px);
        height: auto !important;
        min-height: 0 !important;
        margin: 8px;
        flex: 0 0 auto !important;
        flex-direction: column;
        overflow: hidden;
        border-radius: 10px;
    }

    .tw-analysis-toolbar__top,
    .tw-analysis-toolbar__bottom {
        position: static !important;
        inset: auto !important;
        transform: none !important;
        display: flex !important;
        width: 100%;
        height: auto !important;
        min-height: 0 !important;
        box-sizing: border-box;
        flex: 0 0 auto !important;
    }

    .tw-analysis-toolbar__top {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 8px;
    }

    .tw-analysis-toolbar__actions {
        position: static !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        height: auto !important;
        min-height: 0 !important;
        gap: 6px;
        overflow: visible;
    }

    .tw-analysis-toolbar__actions .tw-btn {
        width: 100%;
        min-width: 0;
        min-height: 36px;
        margin: 0;
        padding-right: 8px;
        padding-left: 8px;
        overflow: hidden;
        font-size: .68rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tw-analysis-mode-switch {
        position: static !important;
        align-self: flex-end;
        margin: 0;
    }

    /* Eigene, wirklich sichtbare Filterzone statt horizontal abgeschnittener Rail. */
    .tw-analysis-toolbar__bottom {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
        margin: 0;
        padding: 7px 8px 8px;
        border-top: 1px solid rgba(255,255,255,.055);
    }

    .tw-analysis-toolbar__filters {
        position: static !important;
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        min-width: 0;
        height: auto !important;
        min-height: 0 !important;
        margin: 0;
        padding: 0;
        gap: 4px;
        overflow: visible !important;
    }

    .tw-analysis-toolbar__filters label {
        display: flex;
        width: 100%;
        min-width: 0;
        min-height: 27px;
        margin: 0;
        padding: 0 5px;
        gap: 4px;
        overflow: hidden;
        font-size: .58rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tw-analysis-toolbar__filters input {
        width: 13px;
        height: 13px;
        margin: 0;
        flex: 0 0 13px;
    }

    .tw-analysis-toolbar__filters .tw-analysis-dot {
        width: 6px;
        height: 6px;
        flex-basis: 6px;
    }

    .tw-analysis-service-state {
        position: static !important;
        min-width: 0;
        align-self: flex-end;
        margin: 0;
        font-size: .58rem;
    }

    .tw-analysis-service-state:not(.is-busy):not(.is-error) {
        display: none;
    }

    /* Im Analysemodus bleibt die mobile Oberfläche ruhig und zeigt nicht
       zusätzlich die komplette Schreib-Formatleiste. */
    .tw-app[data-workspace-mode='analysis'] .tw-formatbar {
        display: none !important;
    }
}

@media (max-width: 360px) {
    .tw-analysis-toolbar__filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 420px) {
    .tw-analysis-toolbar__actions .tw-btn {
        min-height: 34px;
        padding-right: 6px;
        padding-left: 6px;
        font-size: .64rem;
    }

    .tw-analysis-mode-switch button {
        min-height: 25px;
        padding-right: 7px;
        padding-left: 7px;
        font-size: .59rem;
    }
}


/* Phase 2M.2B: Expertenwerte + Wiederholungsprofil */
.tw-analysis-profile__expert {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,.055);
}
.tw-analysis-profile__expert-head {
    margin: 0 0 7px;
    color: var(--tw-gold-soft);
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.tw-analysis-profile__note {
    margin: 8px 1px 0;
    color: #69757c;
    font-size: .58rem;
    line-height: 1.45;
}
.tw-analysis-repeat-profile {
    margin: 0 0 14px;
    padding: 11px;
    border: 1px solid rgba(212,175,55,.10);
    border-radius: 9px;
    background: rgba(255,255,255,.012);
}
.tw-analysis-repeat-profile .tw-inspector-section-head { margin: 0 0 9px; }
.tw-analysis-repeat-profile__columns {
    display: grid;
    grid-template-columns: minmax(0,1fr);
    gap: 10px;
}
.tw-analysis-repeat-profile__columns > div > strong {
    display: block;
    margin-bottom: 5px;
    color: #8c969c;
    font-size: .61rem;
    font-weight: 650;
}
.tw-analysis-repeat-profile__list {
    display: grid;
    gap: 4px;
}
.tw-analysis-repeat-profile__list:empty::after {
    content: 'Keine auffällige Häufung';
    color: #657178;
    font-size: .59rem;
}
.tw-analysis-repeat-profile__list > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    padding: 5px 7px;
    border-radius: 6px;
    background: rgba(0,0,0,.08);
}
.tw-analysis-repeat-profile__list span {
    min-width: 0;
    overflow: hidden;
    color: #aeb6ba;
    font-size: .61rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-analysis-repeat-profile__list strong {
    flex: 0 0 auto;
    color: #d6c06a;
    font-size: .61rem;
}


/* ========================================================================== */
/* Phase 2M.2B.1 - Analyse-Fundstellen-Popup                                  */
/* ========================================================================== */
.tw-modal--analysis-finding {
    width: min(640px, 100%);
    padding: 30px;
}
.tw-analysis-finding-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 2px 0 14px;
}
.tw-analysis-finding-modal__head small {
    color: #98a2a9;
    font-size: 0.76rem;
    line-height: 1.4;
    text-align: right;
}
.tw-analysis-finding-modal__message {
    margin: 0;
    color: #f0f2f3;
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.65;
    overflow-wrap: anywhere;
}
.tw-analysis-finding-modal__excerpt {
    margin: 18px 0 0;
    padding: 15px 16px;
    border: 1px solid rgba(219, 183, 70, 0.20);
    border-radius: 10px;
    background: rgba(219, 183, 70, 0.055);
    color: #cbd1d5;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 0.98rem;
    line-height: 1.65;
    white-space: normal;
    overflow-wrap: anywhere;
}
.tw-analysis-finding-modal__replacements {
    margin-top: 16px;
}
.tw-analysis-finding-modal__actions {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--tw-line);
}
.tw-analysis-finding-modal__tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
@media (max-width: 640px) {
    .tw-analysis-finding-backdrop {
        align-items: end;
        padding: 10px;
    }
    .tw-modal--analysis-finding {
        width: 100%;
        max-height: min(82vh, 720px);
        padding: 24px 18px 18px;
        border-radius: 15px 15px 10px 10px;
    }
    .tw-analysis-finding-modal__head {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }
    .tw-analysis-finding-modal__head small {
        text-align: left;
    }
    .tw-analysis-finding-modal__message {
        font-size: 0.96rem;
    }
    .tw-analysis-finding-modal__excerpt {
        font-size: 0.92rem;
    }
    .tw-analysis-finding-modal__actions {
        align-items: stretch;
        flex-direction: column;
    }
    .tw-analysis-finding-modal__tools {
        width: 100%;
    }
    .tw-analysis-finding-modal__actions > .tw-btn {
        width: 100%;
    }
}

/* Phase 2M.4A.1: Beim ersten Paint den serverseitigen Default-Arbeitsbereich
   nicht zeigen. JavaScript stellt waehrend data-state=booting zuerst den
   gespeicherten Workspace her; ab data-state=loading ist die korrekte Ansicht
   sichtbar. */
.tw-app[data-state='booting'] .tw-workspace {
    visibility: hidden;
}

/* Phase 2M.4B — Perspektive, Dialogtiefe & Figurenstimmen */
.tw-analysis-voice-profiles {
    display: grid;
    gap: 7px;
    margin-top: 10px;
}
.tw-analysis-voice-row {
    display: grid;
    gap: 4px;
    padding: 9px 10px;
    border: 1px solid var(--tw-border-soft, rgba(148, 163, 184, .16));
    border-radius: 10px;
    background: rgba(255, 255, 255, .025);
}
.tw-analysis-voice-row > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}
.tw-analysis-voice-row strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--tw-text, #e5e7eb);
    font-size: 12px;
}
.tw-analysis-voice-row span,
.tw-analysis-voice-row small,
.tw-analysis-voice-empty {
    color: var(--tw-text-muted, #94a3b8);
    font-size: 10.5px;
    line-height: 1.45;
}
.tw-analysis-voice-row span {
    text-align: right;
}
.tw-analysis-voice-empty {
    padding: 8px 2px 2px;
}
@media (max-width: 520px) {
    .tw-analysis-voice-row > div {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }
    .tw-analysis-voice-row span {
        text-align: left;
    }
}



/* ========================================================================== */
/* Phase 2M.4C – Dialog Spotlight & Gesprächsfluss                            */
/* ========================================================================== */
.tw-analysis-toolbar__bottom { grid-template-columns: minmax(0,1fr) auto auto; }

.tw-analysis-dialogue-view {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
    color: #8f999f;
    font-size: .61rem;
    white-space: nowrap;
}
.tw-analysis-dialogue-view > span {
    color: var(--tw-gold-soft);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.tw-analysis-dialogue-view select {
    min-width: 132px;
    height: 28px;
    padding: 0 24px 0 8px;
    border: 1px solid rgba(208,173,58,.22);
    border-radius: 7px;
    outline: none;
    background: #101519;
    color: #c9d0d3;
    font: inherit;
    cursor: pointer;
}
.tw-analysis-dialogue-view select:focus-visible {
    border-color: rgba(208,173,58,.6);
    box-shadow: 0 0 0 2px rgba(208,173,58,.12);
}

.tw-editor .ProseMirror .tw-dialog-spotlight,
.tw-chapter-scene__content .tw-dialog-spotlight {
    border-radius: 3px;
    transition: opacity .16s ease, background-color .16s ease, box-shadow .16s ease;
}
.tw-editor .ProseMirror .tw-dialog-spotlight.is-dialogue,
.tw-chapter-scene__content .tw-dialog-spotlight.is-dialogue {
    background: rgba(211,176,58,.15);
    box-shadow: inset 0 -1px 0 rgba(211,176,58,.38);
}
.tw-editor .ProseMirror .tw-dialog-spotlight.is-tag,
.tw-chapter-scene__content .tw-dialog-spotlight.is-tag {
    background: rgba(105,160,208,.13);
    box-shadow: inset 0 -1px 0 rgba(105,160,208,.45);
}
.tw-editor .ProseMirror .tw-dialog-spotlight.is-beat,
.tw-chapter-scene__content .tw-dialog-spotlight.is-beat {
    background: rgba(103,178,143,.11);
    box-shadow: inset 0 -1px 0 rgba(103,178,143,.34);
}
.tw-editor .ProseMirror .tw-dialog-spotlight.is-dim,
.tw-chapter-scene__content .tw-dialog-spotlight.is-dim { opacity: .24; }
.tw-editor .ProseMirror .tw-dialog-spotlight.is-focus-speaker,
.tw-chapter-scene__content .tw-dialog-spotlight.is-focus-speaker { opacity: 1; font-weight: 600; }
.tw-editor .ProseMirror .tw-dialog-spotlight.is-speaker-0,
.tw-chapter-scene__content .tw-dialog-spotlight.is-speaker-0 { background-color: rgba(213,176,58,.2); box-shadow: inset 0 -2px 0 rgba(213,176,58,.56); }
.tw-editor .ProseMirror .tw-dialog-spotlight.is-speaker-1,
.tw-chapter-scene__content .tw-dialog-spotlight.is-speaker-1 { background-color: rgba(90,153,191,.18); box-shadow: inset 0 -2px 0 rgba(90,153,191,.54); }
.tw-editor .ProseMirror .tw-dialog-spotlight.is-speaker-2,
.tw-chapter-scene__content .tw-dialog-spotlight.is-speaker-2 { background-color: rgba(107,171,137,.18); box-shadow: inset 0 -2px 0 rgba(107,171,137,.54); }
.tw-editor .ProseMirror .tw-dialog-spotlight.is-speaker-3,
.tw-chapter-scene__content .tw-dialog-spotlight.is-speaker-3 { background-color: rgba(166,124,188,.17); box-shadow: inset 0 -2px 0 rgba(166,124,188,.52); }
.tw-editor .ProseMirror .tw-dialog-spotlight.is-speaker-4,
.tw-chapter-scene__content .tw-dialog-spotlight.is-speaker-4 { background-color: rgba(200,123,91,.17); box-shadow: inset 0 -2px 0 rgba(200,123,91,.52); }
.tw-editor .ProseMirror .tw-dialog-spotlight.is-speaker-5,
.tw-chapter-scene__content .tw-dialog-spotlight.is-speaker-5 { background-color: rgba(89,174,174,.17); box-shadow: inset 0 -2px 0 rgba(89,174,174,.52); }
.tw-editor .ProseMirror .tw-dialog-spotlight.is-unassigned,
.tw-chapter-scene__content .tw-dialog-spotlight.is-unassigned {
    background: rgba(255,255,255,.055);
    box-shadow: inset 0 -1px 0 rgba(255,255,255,.16);
}

.tw-analysis-dialogue-flow {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid rgba(208,173,58,.18);
    border-radius: 10px;
    background: rgba(208,173,58,.025);
}
.tw-analysis-dialogue-flow .tw-inspector-section-head { margin: 0 0 7px; }
.tw-analysis-dialogue-flow .tw-analysis-profile__note { margin: 0 0 8px; }
.tw-analysis-dialogue-flow-list {
    display: grid;
    gap: 4px;
    max-height: 292px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}
.tw-analysis-dialogue-flow-row {
    display: grid;
    grid-template-columns: 9px minmax(0,1fr);
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.tw-analysis-dialogue-flow-row:hover,
.tw-analysis-dialogue-flow-row:focus-visible { outline: none; background: rgba(255,255,255,.04); }
.tw-analysis-dialogue-flow-dot {
    width: 7px;
    height: 24px;
    border-radius: 999px;
    background: rgba(255,255,255,.1);
}
.tw-analysis-dialogue-flow-dot.is-speaker-0 { background: rgb(213 176 58 / .7); }
.tw-analysis-dialogue-flow-dot.is-speaker-1 { background: rgb(90 153 191 / .7); }
.tw-analysis-dialogue-flow-dot.is-speaker-2 { background: rgb(107 171 137 / .7); }
.tw-analysis-dialogue-flow-dot.is-speaker-3 { background: rgb(166 124 188 / .7); }
.tw-analysis-dialogue-flow-dot.is-speaker-4 { background: rgb(200 123 91 / .7); }
.tw-analysis-dialogue-flow-dot.is-speaker-5 { background: rgb(89 174 174 / .7); }
.tw-analysis-dialogue-flow-dot.is-unassigned { background: rgba(255,255,255,.14); }
.tw-analysis-dialogue-flow-copy { display: grid; min-width: 0; gap: 2px; }
.tw-analysis-dialogue-flow-copy strong { color: #dce1e3; font-size: .65rem; }
.tw-analysis-dialogue-flow-copy small {
    overflow: hidden;
    color: #78848b;
    font-size: .59rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-analysis-dialogue-flow-more { padding: 6px 8px 2px 25px; color: #68747a; font-size: .59rem; }

@media (max-width: 920px) {
    .tw-analysis-dialogue-view > span { display: none; }
    .tw-analysis-dialogue-view select { min-width: 118px; }
}
@media (max-width: 640px) {
    .tw-analysis-toolbar__bottom { grid-template-columns: none; }
    .tw-analysis-dialogue-view { width: 100%; justify-content: space-between; padding-top: 2px; }
    .tw-analysis-dialogue-view > span { display: inline; }
    .tw-analysis-dialogue-view select { width: min(100%, 210px); min-width: 0; }
}

/* ========================================================================== */
/* MOBILE PORTRAIT HOTFIX 2026-10-08                                          */
/* ========================================================================== */
/* hidden muss auch gegen spaetere mobile !important-Layoutregeln gewinnen.
   Das behebt u.a. die Analyse-Toolbar, die unter "Schreiben" sichtbar wurde. */
.tw-app [hidden] {
    display: none !important;
}

@media (max-width: 720px) and (orientation: portrait) {
    /* Mobile Manuskriptansicht: keine seitlich abgeschnittene A4-Flaeche.
       Die eigentliche Skalierung kommt aus effectiveDocumentZoom(); hier wird
       nur verhindert, dass ein ueberstehendes Papier den Workspace verbreitert. */
    .tw-app[data-workspace-mode='write'] .tw-editor-shell,
    .tw-app[data-workspace-mode='analysis'] .tw-editor-shell,
    .tw-app[data-workspace-mode='write'] .tw-editor-document,
    .tw-app[data-workspace-mode='analysis'] .tw-editor-document,
    .tw-app[data-workspace-mode='write'] .tw-paper-wrap,
    .tw-app[data-workspace-mode='analysis'] .tw-paper-wrap {
        min-width: 0;
        max-width: 100%;
    }

    .tw-app[data-workspace-mode='write'] .tw-paper-wrap,
    .tw-app[data-workspace-mode='analysis'] .tw-paper-wrap {
        overflow-x: hidden;
        overscroll-behavior-x: none;
    }

    .tw-app[data-workspace-mode='analysis'] .tw-analysis-toolbar:not([hidden]) {
        display: flex !important;
    }
}

/* Mobile Querformat wird vorerst bewusst blockiert. */
@media (orientation: landscape) and (max-width: 1100px) and (max-height: 600px) {
    body {
        overflow: hidden !important;
    }

    body::after {
        content: '';
        position: fixed;
        z-index: 2147483645;
        inset: 0;
        background: #0d1215;
    }

    body::before {
        content: 'TrueWriter ist mobil fuer Hochformat optimiert.\A Bitte drehe dein Geraet.';
        position: fixed;
        z-index: 2147483646;
        top: 50%;
        left: 50%;
        width: min(460px, calc(100vw - 48px));
        transform: translate(-50%, -50%);
        padding: 24px 28px;
        border: 1px solid rgba(212, 175, 55, .34);
        border-radius: 14px;
        background: #12181c;
        color: #e7eaeb;
        box-shadow: 0 24px 80px rgba(0, 0, 0, .48);
        font: 600 16px/1.55 system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
        text-align: center;
        white-space: pre-line;
        pointer-events: auto;
    }

    .tw-app {
        pointer-events: none !important;
        user-select: none !important;
    }
}



/* ========================================================================== */
/* Desktop Analyse-Inspector: lesefreundliche Vollansicht                    */
/* ========================================================================== */
.tw-analysis-inspector-expand {
    display: none;
}

@media (min-width: 921px) {
    .tw-app[data-workspace-mode='analysis'] .tw-analysis-inspector-expand {
        display: grid;
    }

    .tw-analysis-inspector-expand.is-active {
        border-color: rgba(212,175,55,.34);
        background: rgba(212,175,55,.10);
        color: var(--tw-gold-soft);
    }

    /* Im ausgefahrenen Analysebericht bleibt die linke Navigation exakt so,
       wie der Nutzer sie gerade eingestellt hat. Der Editor bekommt 0 px und
       der Inspector übernimmt die gesamte Restbreite bis an Navigator/Toolrail. */
    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-workspace {
        grid-template-columns: var(--tw-rail) var(--tw-nav-layout) 0 minmax(0, 1fr);
    }

    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-editor-area {
        min-width: 0;
        width: 0;
        overflow: hidden;
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
    }

    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-inspector {
        min-width: 0;
        border-left: 1px solid var(--tw-line);
        background: #171c20;
    }

    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-inspector > .tw-panel-heading {
        padding-right: 20px;
        padding-left: 24px;
        background: rgba(0,0,0,.08);
    }

    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-inspector__content {
        width: min(100%, 1420px);
        margin: 0 auto;
        padding: 24px 28px 42px;
    }

    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-report-summary,
    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-profile,
    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-repeat-profile,
    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-dialogue-flow,
    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-current {
        padding: 16px;
        border-radius: 11px;
    }

    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-summary-grid,
    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-severity-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-summary-grid button:first-child {
        grid-column: auto;
    }

    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-summary-grid button {
        min-height: 50px;
        padding: 10px 12px;
        font-size: .71rem;
    }

    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-summary-grid strong,
    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-severity-grid strong {
        font-size: .92rem;
    }

    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-profile__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 9px;
    }

    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-repeat-profile__columns,
    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-voice-profiles {
        grid-template-columns: minmax(0, 1fr);
    }

    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-current {
        margin-top: 14px;
        margin-bottom: 20px;
    }

    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-current > strong {
        font-size: .9rem;
        line-height: 1.55;
    }

    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-current__excerpt {
        padding: 12px 14px;
        font-size: .83rem;
        line-height: 1.65;
    }

    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-findings {
        grid-template-columns: minmax(0, 1fr);
        gap: 9px;
    }

    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-finding {
        min-height: 82px;
        padding: 12px 14px;
        gap: 6px;
    }

    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-finding strong {
        font-size: .76rem;
    }

    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-finding span,
    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-finding small {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-finding span {
        color: #b9c1c5;
        font-size: .71rem;
        line-height: 1.5;
    }

    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-finding small {
        font-size: .64rem;
        line-height: 1.45;
    }

    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-dialogue-flow-list {
        max-height: 420px;
    }
}

@media (min-width: 1280px) {
    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-summary-grid,
    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-severity-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-profile__grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-repeat-profile__columns,
    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-voice-profiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-findings {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* Phase 2M.5E.1 - structured character knowledge contract */
.tw-codex-knowledge {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--tw-border);
}
.tw-codex-knowledge > .tw-field-help {
    margin: 0 0 12px;
}
.tw-codex-knowledge-item {
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--tw-border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--tw-panel) 90%, transparent);
}
.tw-codex-knowledge-item__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}
.tw-codex-knowledge-add {
    display: inline-flex;
    width: fit-content;
    min-height: 32px;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    padding: 5px 10px;
    border: 1px solid var(--tw-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, .018);
    color: #8d989f;
    white-space: nowrap;
}
.tw-codex-knowledge-add:hover {
    border-color: rgba(212, 175, 55, .35);
    background: rgba(212, 175, 55, .045);
    color: var(--tw-gold-soft);
}

/* --------------------------------------------------------------------------
 * Phase 2M.5F.1 · Kontinuitätsbericht im Analyse-Inspector
 * -------------------------------------------------------------------------- */
.tw-analysis-continuity-report {
    margin: 0 0 14px;
    padding: 10px;
    border: 1px solid rgba(212,175,55,.12);
    border-radius: 9px;
    background: rgba(212,175,55,.018);
}
.tw-analysis-continuity-report .tw-inspector-section-head { margin: 0 0 6px; }
.tw-analysis-continuity-report__note {
    margin: 0 0 9px;
    color: #748087;
    font-size: .59rem;
    line-height: 1.5;
}
.tw-analysis-continuity-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 6px;
}
.tw-analysis-continuity-grid button {
    display: flex;
    min-height: 36px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 8px;
    border: 1px solid rgba(255,255,255,.05);
    border-radius: 7px;
    background: rgba(0,0,0,.09);
    color: #818c92;
    font-size: .6rem;
    cursor: pointer;
}
.tw-analysis-continuity-grid button:first-child { grid-column: 1 / -1; }
.tw-analysis-continuity-grid button:hover,
.tw-analysis-continuity-grid button.is-active {
    border-color: rgba(212,175,55,.28);
    background: rgba(212,175,55,.055);
    color: #dce0e2;
}
.tw-analysis-continuity-grid strong { color: #e5e9ea; font-size: .76rem; }
@media (min-width: 921px) {
    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-continuity-report {
        padding: 16px;
        border-radius: 11px;
    }
    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-continuity-grid {
        grid-template-columns: repeat(5,minmax(0,1fr));
        gap: 10px;
    }
    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-continuity-grid button:first-child { grid-column: auto; }
    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-continuity-grid button {
        min-height: 48px;
        padding: 10px 12px;
        font-size: .69rem;
    }
    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-continuity-grid strong { font-size: .9rem; }
}

/* --------------------------------------------------------------------------
 * Phase 2M.5F.2 · Quellen-Navigation im Kontinuitätsbericht
 * -------------------------------------------------------------------------- */
.tw-analysis-finding-card {
    display: grid;
    gap: 4px;
    min-width: 0;
}
.tw-analysis-finding-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 0;
    padding: 0 5px 2px;
}
.tw-analysis-finding-source {
    max-width: 100%;
    min-height: 25px;
    overflow: hidden;
    padding: 4px 8px;
    border: 1px solid rgba(91,196,215,.16);
    border-radius: 999px;
    background: rgba(91,196,215,.035);
    color: #8fb9c1;
    font-size: .58rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}
.tw-analysis-finding-source:hover,
.tw-analysis-finding-source:focus-visible {
    border-color: rgba(91,196,215,.34);
    background: rgba(91,196,215,.08);
    color: #c4e5eb;
    outline: none;
}
@media (min-width: 921px) {
    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-finding-sources {
        gap: 7px;
        padding: 0 8px 3px;
    }
    .tw-app[data-workspace-mode='analysis'].is-analysis-inspector-expanded .tw-analysis-finding-source {
        min-height: 29px;
        padding: 5px 10px;
        font-size: .64rem;
    }
}


/* ========================================================================== */
/* Projektzentrale                                                            */
/* ========================================================================== */
.tw-projects-workspace { padding-bottom: 90px; }
.tw-projects-toolbar {
    display: flex;
    width: min(1180px, 100%);
    margin: 0 auto 18px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.tw-projects-search { flex: 1 1 340px; max-width: 520px; }
.tw-projects-search input {
    width: 100%;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--tw-line);
    border-radius: 10px;
    outline: none;
    background: rgba(9, 13, 16, .72);
    color: #eef0f2;
    font: inherit;
}
.tw-projects-search input:focus {
    border-color: rgba(212, 175, 55, .58);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, .08);
}
.tw-projects-filters {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--tw-line);
    border-radius: 10px;
    background: rgba(11, 15, 18, .66);
}
.tw-projects-filter {
    min-height: 32px;
    padding: 0 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #8f999f;
    font: inherit;
    font-size: .72rem;
    cursor: pointer;
}
.tw-projects-filter:hover { color: #eef0f2; }
.tw-projects-filter.is-active {
    background: rgba(212, 175, 55, .12);
    color: #e6c95f;
}
.tw-projects-grid {
    display: grid;
    width: min(1180px, 100%);
    margin: 0 auto;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}
.tw-project-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--tw-line);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(24, 29, 34, .94), rgba(15, 19, 23, .96));
    box-shadow: 0 16px 36px rgba(0, 0, 0, .14);
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.tw-project-card:hover {
    transform: translateY(-2px);
    border-color: rgba(212, 175, 55, .32);
    box-shadow: 0 20px 42px rgba(0, 0, 0, .2);
}
.tw-project-card.is-current { border-color: rgba(212, 175, 55, .48); }
.tw-project-card.is-archived { opacity: .72; }
.tw-project-card__cover {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-bottom: 1px solid var(--tw-line);
    background: #0d1114;
    cursor: pointer;
}
.tw-project-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 34%;
    transition: transform .2s ease;
}
.tw-project-card:hover .tw-project-card__cover img { transform: scale(1.025); }
.tw-project-card__cover-empty {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    align-content: center;
    gap: 5px;
    background:
        radial-gradient(circle at 28% 20%, rgba(212,175,55,.16), transparent 34%),
        linear-gradient(145deg, #222a30, #12171b 62%, #0d1114);
    color: #d8bb56;
}
.tw-project-card__cover-empty b {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2.9rem;
    font-weight: 500;
}
.tw-project-card__cover-empty small {
    color: #7e898f;
    font-size: .62rem;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.tw-project-card__status,
.tw-project-card__current {
    position: absolute;
    top: 10px;
    padding: 5px 8px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 999px;
    backdrop-filter: blur(10px);
    background: rgba(8, 12, 15, .76);
    color: #d6dcdf;
    font-size: .62rem;
    line-height: 1;
}
.tw-project-card__status { left: 10px; }
.tw-project-card__current {
    right: 10px;
    border-color: rgba(212,175,55,.28);
    color: #e6c95f;
}
.tw-project-card__body { padding: 15px; }
.tw-project-card__heading h2 {
    margin: 4px 0 3px;
    overflow: hidden;
    color: #f0f2f3;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.18rem;
    font-weight: 500;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-project-card__heading p {
    margin: 0;
    overflow: hidden;
    color: #8e999f;
    font-size: .75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-project-card__meta {
    display: grid;
    gap: 7px;
    margin: 14px 0 16px;
}
.tw-project-card__meta div {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 10px;
}
.tw-project-card__meta dt,
.tw-project-card__meta dd { margin: 0; font-size: .68rem; line-height: 1.35; }
.tw-project-card__meta dt { color: #677279; }
.tw-project-card__meta dd {
    overflow: hidden;
    color: #aeb7bb;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-project-card__actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}
.tw-project-card__delete {
    display: grid;
    width: 31px;
    height: 31px;
    margin-left: auto;
    place-items: center;
    border: 1px solid rgba(203, 91, 91, .22);
    border-radius: 8px;
    background: rgba(151, 48, 48, .08);
    color: #b87a7a;
    font-size: 1rem;
    cursor: pointer;
}
.tw-project-card__delete:hover {
    border-color: rgba(203, 91, 91, .5);
    background: rgba(151, 48, 48, .16);
    color: #e19a9a;
}
.tw-projects-empty {
    grid-column: 1 / -1;
    display: flex;
    min-height: 250px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    padding: 32px;
    border: 1px dashed var(--tw-line-strong);
    border-radius: 16px;
    color: #7f8a90;
    text-align: center;
}
.tw-projects-empty strong { color: #d9dddf; font-size: 1rem; }
.tw-projects-empty .tw-btn { margin-top: 8px; }

@media (min-width: 721px) {
    .tw-app[data-workspace-mode='projects'] .tw-workspace {
        grid-template-columns: var(--tw-rail) minmax(0, 1fr) !important;
    }
    .tw-app[data-workspace-mode='projects'] .tw-navigator,
    .tw-app[data-workspace-mode='projects'] .tw-inspector { display: none !important; }
}
@media (max-width: 720px) {
    .tw-projects-toolbar { align-items: stretch; flex-direction: column; }
    .tw-projects-search { flex-basis: auto; max-width: none; }
    .tw-projects-filters { width: 100%; }
    .tw-projects-filter { flex: 1 1 0; }
    .tw-projects-grid { grid-template-columns: 1fr; }
}

/* ========================================================================== */
/* Projektbeziehungen                                                        */
/* ========================================================================== */
.tw-modal--project-relations {
    width: min(780px, calc(100vw - 36px));
    max-width: 780px;
}
.tw-project-relations-intro {
    max-width: 650px;
}
.tw-project-relations-current {
    display: grid;
    gap: 3px;
    margin: 4px 0 18px;
    padding: 12px 14px;
    border: 1px solid rgba(212, 175, 55, .2);
    border-radius: 10px;
    background: rgba(212, 175, 55, .045);
}
.tw-project-relations-current span {
    color: #8d969b;
    font-size: .62rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.tw-project-relations-current strong {
    overflow: hidden;
    color: #e8ecee;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-project-relations-section,
.tw-project-relation-form {
    display: grid;
    gap: 11px;
    padding: 14px;
    border: 1px solid var(--tw-line);
    border-radius: 11px;
    background: rgba(255, 255, 255, .012);
}
.tw-project-relation-form {
    margin-top: 14px;
}
.tw-project-relations-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--tw-line);
}
.tw-project-relations-section__head > div {
    display: grid;
    gap: 2px;
}
.tw-project-relations-section__head span {
    color: #e4e8ea;
    font-size: .8rem;
    font-weight: 750;
}
.tw-project-relations-section__head small {
    color: #737e84;
    font-size: .64rem;
    line-height: 1.4;
}
.tw-project-relations-list {
    display: grid;
    gap: 8px;
}
.tw-project-relations-empty {
    padding: 20px 14px;
    border: 1px dashed var(--tw-line-strong);
    border-radius: 9px;
    color: #7f8a90;
    font-size: .72rem;
    line-height: 1.55;
    text-align: center;
}
.tw-project-relation-row {
    display: grid;
    grid-template-columns: minmax(92px, auto) minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px 11px;
    border: 1px solid rgba(255, 255, 255, .055);
    border-radius: 9px;
    background: rgba(7, 10, 12, .22);
}
.tw-project-relation-row__type {
    justify-self: start;
    padding: 5px 8px;
    border: 1px solid rgba(212, 175, 55, .2);
    border-radius: 999px;
    background: rgba(212, 175, 55, .07);
    color: #dcc45e;
    font-size: .62rem;
    line-height: 1;
    white-space: nowrap;
}
.tw-project-relation-row__copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}
.tw-project-relation-row__copy strong {
    overflow: hidden;
    color: #dfe3e5;
    font-size: .76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-project-relation-row__copy span {
    overflow: hidden;
    color: #78838a;
    font-size: .64rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-project-relation-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.tw-project-relation-custom {
    grid-column: span 1;
}
.tw-project-relations-actions {
    align-items: center;
}
.tw-project-relations-actions > .tw-field-help {
    margin-right: auto;
}
@media (max-width: 620px) {
    .tw-modal--project-relations {
        width: calc(100vw - 20px);
        padding: 18px 15px;
    }
    .tw-project-relation-grid {
        grid-template-columns: 1fr;
    }
    .tw-project-relation-row {
        grid-template-columns: 1fr auto;
    }
    .tw-project-relation-row__type {
        grid-column: 1 / -1;
    }
    .tw-project-relations-actions {
        flex-wrap: wrap;
    }
    .tw-project-relations-actions > .tw-field-help {
        width: 100%;
        margin-right: 0;
    }
}

/* ========================================================================== */
/* Reihen-/Bandfundament                                                     */
/* ========================================================================== */
.tw-project-series-section {
    margin-bottom: 14px;
    border-color: rgba(212, 175, 55, .16);
    background: rgba(212, 175, 55, .025);
}
.tw-project-series-form {
    display: grid;
    gap: 10px;
}
.tw-project-series-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(150px, .55fr);
    gap: 10px;
}
.tw-project-series-new-name {
    grid-column: 1 / -1;
}
.tw-project-series-legacy {
    padding: 9px 11px;
    border: 1px solid rgba(212, 175, 55, .16);
    border-radius: 8px;
    background: rgba(212, 175, 55, .045);
    color: #929da3;
    font-size: .66rem;
    line-height: 1.5;
}
.tw-project-series-legacy strong {
    color: #d8dde0;
    font-weight: 650;
}
.tw-project-series-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 2px;
}
.tw-project-series-actions > .tw-field-help {
    margin-right: auto;
}
@media (max-width: 620px) {
    .tw-project-series-grid {
        grid-template-columns: 1fr;
    }
    .tw-project-series-new-name {
        grid-column: auto;
    }
    .tw-project-series-actions {
        align-items: stretch;
        flex-direction: column;
    }
    .tw-project-series-actions > .tw-field-help {
        margin-right: 0;
    }
    .tw-project-series-actions .tw-btn,
    .tw-project-series-actions .tw-quiet-button {
        width: 100%;
    }
}


/* ========================================================================== */
/* Reihenzentrale                                                            */
/* ========================================================================== */
.tw-projects-view-switch {
    display: flex;
    width: min(1180px, 100%);
    margin: 0 auto 14px;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--tw-line);
    border-radius: 11px;
    background: rgba(11, 15, 18, .66);
}
.tw-projects-view {
    min-width: 112px;
    min-height: 34px;
    padding: 0 15px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #8f999f;
    font: inherit;
    font-size: .75rem;
    cursor: pointer;
}
.tw-projects-view:hover { color: #eef0f2; }
.tw-projects-view.is-active {
    background: rgba(212, 175, 55, .12);
    color: #e6c95f;
}
.tw-series-toolbar__hint {
    color: #778188;
    font-size: .68rem;
    line-height: 1.4;
    text-align: right;
}
.tw-series-grid {
    display: grid;
    width: min(1180px, 100%);
    margin: 0 auto;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}
.tw-series-card {
    display: grid;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--tw-line);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(24, 29, 34, .94), rgba(15, 19, 23, .96));
    box-shadow: 0 16px 36px rgba(0, 0, 0, .14);
}
.tw-series-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 13px;
    border-bottom: 1px solid var(--tw-line);
}
.tw-series-card__head h2 {
    margin: 4px 0 0;
    color: #f0f2f3;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.25;
}
.tw-series-card__count {
    flex: 0 0 auto;
    padding: 5px 8px;
    border: 1px solid rgba(212,175,55,.18);
    border-radius: 999px;
    background: rgba(212,175,55,.06);
    color: #d8bb56;
    font-size: .62rem;
}
.tw-series-card__members {
    display: grid;
    gap: 0;
    padding: 4px 16px;
}
.tw-series-card__member {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,.045);
}
.tw-series-card__member:last-child { border-bottom: 0; }
.tw-series-card__volume {
    color: #8c969c;
    font-size: .66rem;
}
.tw-series-card__title {
    overflow: hidden;
    color: #cbd1d4;
    font-size: .72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-series-card__more {
    padding: 4px 0 10px;
    color: #737d83;
    font-size: .65rem;
}
.tw-series-card__empty {
    padding: 18px 16px;
    color: #737d83;
    font-size: .7rem;
}
.tw-series-card__actions {
    display: flex;
    justify-content: flex-end;
    padding: 12px 16px 15px;
    border-top: 1px solid var(--tw-line);
}
.tw-modal--series-manage {
    width: min(820px, calc(100vw - 36px));
    max-width: 820px;
}
.tw-series-manage-intro { max-width: 690px; }
.tw-series-name-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
    margin: 16px 0 18px;
}
.tw-series-name-form .tw-field,
.tw-series-add-grid .tw-field,
.tw-series-member-row .tw-field {
    margin-bottom: 0;
}
.tw-series-name-form > .tw-btn,
.tw-series-add-grid > .tw-btn {
    min-height: 38px;
    align-self: end;
}
.tw-series-manage-section {
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid var(--tw-line);
    border-radius: 12px;
    background: rgba(8, 12, 15, .36);
}
.tw-series-members {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}
.tw-series-member-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 125px auto;
    align-items: end;
    gap: 9px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,.055);
    border-radius: 9px;
    background: rgba(255,255,255,.018);
}
.tw-series-member-row__project {
    display: grid;
    gap: 3px;
    align-self: center;
    min-width: 0;
}
.tw-series-member-row__project strong {
    overflow: hidden;
    color: #dce0e2;
    font-size: .74rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-series-member-row__project span {
    color: #727d83;
    font-size: .62rem;
}
.tw-series-member-row__actions {
    display: flex;
    gap: 6px;
    align-items: center;
    padding-bottom: 1px;
}
.tw-series-members-empty {
    padding: 14px;
    border: 1px dashed var(--tw-line-strong);
    border-radius: 9px;
    color: #788288;
    font-size: .7rem;
    text-align: center;
}
.tw-series-add-form {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid rgba(212,175,55,.15);
    border-radius: 12px;
    background: rgba(212,175,55,.025);
}
.tw-series-add-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(135px, .65fr) auto;
    align-items: end;
    gap: 10px;
}
.tw-series-manage-danger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 14px;
    border: 1px solid rgba(203,91,91,.18);
    border-radius: 10px;
    background: rgba(151,48,48,.045);
}
.tw-series-manage-danger > div {
    display: grid;
    gap: 3px;
}
.tw-series-manage-danger strong { color: #d8b1b1; font-size: .72rem; }
.tw-series-manage-danger span { color: #82777a; font-size: .64rem; line-height: 1.45; }
@media (max-width: 720px) {
    .tw-projects-view-switch { display: flex; }
    .tw-projects-view { flex: 1 1 0; }
    .tw-series-toolbar__hint { text-align: left; }
    .tw-series-grid { grid-template-columns: 1fr; }
    .tw-series-name-form,
    .tw-series-add-grid,
    .tw-series-member-row { grid-template-columns: 1fr; }
    .tw-series-member-row__actions { flex-wrap: wrap; }
    .tw-series-manage-danger { align-items: stretch; flex-direction: column; }
    .tw-series-manage-danger .tw-quiet-button { width: 100%; }
}

/* Neues Projekt aus bestehendem Projekt */
.tw-project-copy-block {
    margin-top: 6px;
    padding: 16px;
    border: 1px solid var(--tw-border, #d8d5cf);
    border-radius: 14px;
    background: var(--tw-panel-soft, rgba(0, 0, 0, 0.025));
}
.tw-project-copy-block__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}
.tw-project-copy-block__head > div {
    display: grid;
    gap: 3px;
}
.tw-project-copy-block__head strong {
    font-size: .96rem;
}
.tw-project-copy-block__head span:not(.tw-phase-chip) {
    font-size: .82rem;
    line-height: 1.45;
    color: var(--tw-muted, #6c6a66);
}
.tw-project-copy-options {
    display: grid;
    gap: 9px;
    margin-top: 4px;
}
.tw-project-copy-options[hidden] {
    display: none;
}
.tw-project-copy-options__title {
    margin-top: 2px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--tw-muted, #6c6a66);
}
.tw-project-copy-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: flex-start;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--tw-border, #d8d5cf);
    border-radius: 11px;
    cursor: pointer;
}
.tw-project-copy-option input {
    margin-top: 3px;
}
.tw-project-copy-option > span {
    display: grid;
    gap: 3px;
}
.tw-project-copy-option strong {
    font-size: .88rem;
}
.tw-project-copy-option small,
.tw-project-copy-note {
    font-size: .78rem;
    line-height: 1.45;
    color: var(--tw-muted, #6c6a66);
}
.tw-project-copy-note {
    margin: 3px 2px 0;
}
@media (max-width: 720px) {
    .tw-project-copy-block {
        padding: 13px;
    }
    .tw-project-copy-block__head {
        gap: 10px;
    }
}

/* ========================================================================== */
/* Gemeinsame Welten: Fundament                                              */
/* ========================================================================== */
.tw-shared-world-toolbar {
    align-items: center;
}
.tw-shared-world-toolbar > .tw-btn {
    flex: 0 0 auto;
}
.tw-shared-world-grid {
    display: grid;
    width: min(1180px, 100%);
    margin: 0 auto;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}
.tw-shared-world-card {
    display: grid;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--tw-line);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(24, 29, 34, .94), rgba(15, 19, 23, .96));
    box-shadow: 0 16px 36px rgba(0, 0, 0, .14);
}
.tw-shared-world-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 13px;
    border-bottom: 1px solid var(--tw-line);
}
.tw-shared-world-card__head h2 {
    margin: 4px 0 0;
    color: #f0f2f3;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.25;
}
.tw-shared-world-card__description {
    margin: 0;
    padding: 13px 16px 0;
    color: #89949a;
    font-size: .69rem;
    line-height: 1.5;
}
.tw-shared-world-card__members {
    display: grid;
    gap: 0;
    padding: 6px 16px 10px;
}
.tw-shared-world-card__member {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255,255,255,.045);
}
.tw-shared-world-card__member:last-child { border-bottom: 0; }
.tw-shared-world-card__member span {
    overflow: hidden;
    color: #cbd1d4;
    font-size: .72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-shared-world-card__member small {
    flex: 0 0 auto;
    color: #727d83;
    font-size: .61rem;
}
.tw-shared-world-card__more {
    padding: 4px 0 0;
    color: #737d83;
    font-size: .65rem;
}
.tw-modal--shared-world {
    width: min(820px, calc(100vw - 36px));
    max-width: 820px;
}
.tw-shared-world-intro {
    max-width: 700px;
}
.tw-shared-world-form {
    display: grid;
    gap: 10px;
    margin: 16px 0;
}
.tw-shared-world-form .tw-field,
.tw-shared-world-add-form .tw-field {
    margin-bottom: 0;
}
.tw-shared-world-form__actions {
    padding-top: 2px;
}
.tw-shared-world-form__actions > .tw-field-help {
    margin-right: auto;
}
.tw-shared-world-members-section {
    margin: 16px 0;
    padding: 14px;
    border: 1px solid var(--tw-line);
    border-radius: 12px;
    background: rgba(8, 12, 15, .36);
}
.tw-shared-world-members {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}
.tw-shared-world-member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,.055);
    border-radius: 9px;
    background: rgba(255,255,255,.018);
}
.tw-shared-world-member-row > div:first-child {
    display: grid;
    gap: 3px;
    min-width: 0;
}
.tw-shared-world-member-row strong {
    overflow: hidden;
    color: #dce0e2;
    font-size: .74rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-shared-world-member-row span {
    color: #727d83;
    font-size: .62rem;
}
.tw-shared-world-member-row__actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
}
.tw-shared-world-add-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--tw-line);
}
.tw-shared-world-add-form > .tw-btn {
    min-height: 38px;
}
.tw-shared-world-danger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 14px;
    border: 1px solid rgba(203,91,91,.18);
    border-radius: 10px;
    background: rgba(151,48,48,.045);
}
.tw-shared-world-danger > div {
    display: grid;
    gap: 3px;
}
.tw-shared-world-danger strong {
    color: #d8b1b1;
    font-size: .72rem;
}
.tw-shared-world-danger span {
    color: #82777a;
    font-size: .64rem;
    line-height: 1.45;
}
@media (max-width: 720px) {
    .tw-shared-world-toolbar {
        align-items: stretch;
        flex-direction: column;
    }
    .tw-shared-world-toolbar > .tw-btn { width: 100%; }
    .tw-shared-world-grid { grid-template-columns: 1fr; }
    .tw-shared-world-member-row {
        align-items: stretch;
        flex-direction: column;
    }
    .tw-shared-world-member-row__actions { flex-wrap: wrap; }
    .tw-shared-world-add-form { grid-template-columns: 1fr; }
    .tw-shared-world-add-form > .tw-btn { width: 100%; }
    .tw-shared-world-danger {
        align-items: stretch;
        flex-direction: column;
    }
    .tw-shared-world-danger .tw-quiet-button { width: 100%; }
}


/* ========================================================================== */
/* Gemeinsame Codex-Ressourcen                                               */
/* ========================================================================== */
.tw-shared-world-resources-section {
    margin: 16px 0;
    padding: 14px;
    border: 1px solid var(--tw-line);
    border-radius: 12px;
    background: rgba(8, 12, 15, .36);
}
.tw-shared-world-resource-hint {
    margin: 8px 0 0;
    color: #7d888e;
    font-size: .65rem;
    line-height: 1.5;
}
.tw-shared-world-resources {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}
.tw-shared-world-resource-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,.055);
    border-radius: 9px;
    background: rgba(255,255,255,.018);
}
.tw-shared-world-resource-row__main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    min-width: 0;
}
.tw-shared-world-resource-row__icon {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 8px;
    color: #aeb8bd;
    background: rgba(255,255,255,.025);
    font-size: .78rem;
}
.tw-shared-world-resource-row__text {
    display: grid;
    gap: 3px;
    min-width: 0;
}
.tw-shared-world-resource-row__text strong {
    overflow: hidden;
    color: #dce0e2;
    font-size: .74rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-shared-world-resource-row__text span {
    overflow: hidden;
    color: #727d83;
    font-size: .62rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-shared-world-resource-form .tw-field { margin-bottom: 0; }
.tw-shared-world-resource-form > .tw-btn { min-height: 38px; }
@media (max-width: 720px) {
    .tw-shared-world-resource-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .tw-shared-world-resource-row > .tw-quiet-button { width: 100%; }
}

.tw-shared-world-card .tw-series-card__meta {
    display: grid;
    justify-items: end;
    gap: 3px;
    flex: 0 0 auto;
}
.tw-shared-world-card .tw-series-card__meta small {
    color: #69747a;
    font-size: .59rem;
}

/* Gemeinsame Codex-Ressourcen im Projekt-Codex */
.tw-codex-list-scope {
    margin: 10px 6px 4px;
    padding: 6px 8px;
    border: 1px solid rgba(255,255,255,.055);
    border-radius: 7px;
    background: rgba(255,255,255,.018);
    color: #8c969c;
    font-size: .58rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.tw-codex-list-scope.is-shared {
    border-color: rgba(212,175,55,.16);
    background: rgba(212,175,55,.035);
    color: #bfa95f;
}

.tw-codex-list-item.is-shared {
    border-color: rgba(212,175,55,.075);
}

.tw-codex-list-item.is-shared .tw-codex-list-item__icon {
    border-color: rgba(212,175,55,.16);
    color: #c0aa61;
}

.tw-codex-list-item__copy strong {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
}

.tw-codex-shared-chip {
    display: inline-flex;
    min-width: 0;
    flex: 0 0 auto;
    align-items: center;
    padding: 2px 5px;
    border: 1px solid rgba(212,175,55,.22);
    border-radius: 999px;
    background: rgba(212,175,55,.07);
    color: #cfb85f;
    font-size: .48rem;
    font-weight: 800;
    letter-spacing: .06em;
    line-height: 1.1;
    text-transform: uppercase;
}


/* ========================================================================== */
/* Produktversion, Änderungsverlauf & Feature-Gate                             */
/* ========================================================================== */
.tw-tool.is-feature-locked {
    opacity: .42;
    cursor: not-allowed;
    filter: saturate(.45);
}
.tw-tool.is-feature-locked:hover {
    background: transparent;
    color: #68737b;
}
.tw-tool-lock {
    margin-top: 1px;
    color: #7b848a;
    font-size: .46rem !important;
    font-weight: 700;
    letter-spacing: .05em !important;
    text-transform: uppercase;
}
.tw-version-button {
    padding: 3px 7px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: #7d878e;
    font: inherit;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.tw-version-button:hover,
.tw-version-button:focus-visible {
    border-color: rgba(212, 175, 55, .22);
    background: rgba(212, 175, 55, .07);
    color: var(--tw-gold-soft);
    outline: none;
}
.tw-release-workspace { padding-bottom: 90px; }
.tw-release-workspace__head { margin-bottom: 24px; }
.tw-release-current {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    padding: 0 11px;
    border: 1px solid rgba(212, 175, 55, .22);
    border-radius: 8px;
    background: rgba(212, 175, 55, .06);
    color: #d8bd57;
    font-size: .72rem;
    font-weight: 700;
}
.tw-release-list {
    display: grid;
    width: min(1180px, 100%);
    margin: 0 auto;
    gap: 16px;
}
.tw-release-card {
    padding: clamp(18px, 2.6vw, 28px);
    border: 1px solid var(--tw-line);
    border-radius: 15px;
    background: linear-gradient(180deg, rgba(22, 27, 31, .92), rgba(15, 19, 23, .94));
}
.tw-release-card.is-current {
    border-color: rgba(212, 175, 55, .34);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .13);
}
.tw-release-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}
.tw-release-card__head h2 {
    margin: 7px 0 0;
    color: #edf0f1;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.15rem, 2vw, 1.55rem);
    font-weight: 500;
}
.tw-release-card__head time {
    flex: 0 0 auto;
    padding-top: 4px;
    color: #778188;
    font-size: .7rem;
}
.tw-release-version-line {
    display: flex;
    align-items: center;
    gap: 9px;
}
.tw-release-version-line strong {
    color: var(--tw-gold-soft);
    font-size: .82rem;
    letter-spacing: .04em;
}
.tw-release-version-line span {
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(81, 175, 123, .11);
    color: #8bd0aa;
    font-size: .58rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.tw-release-summary {
    max-width: 900px;
    margin: 15px 0 0;
    color: #a1abb0;
    font-size: .82rem;
    line-height: 1.65;
}
.tw-release-card ul {
    display: grid;
    margin: 17px 0 0;
    padding: 15px 0 0 20px;
    gap: 8px;
    border-top: 1px solid var(--tw-line);
    color: #c2c8cc;
    font-size: .78rem;
    line-height: 1.55;
}
.tw-release-card li::marker { color: #caae46; }
.tw-release-empty {
    display: grid;
    gap: 5px;
    padding: 28px;
    border: 1px dashed var(--tw-line-strong);
    border-radius: 14px;
    color: #7f898f;
    text-align: center;
}
.tw-release-empty strong { color: #c7cdd0; }
@media (max-width: 720px) {
    .tw-release-card__head { flex-direction: column; gap: 8px; }
    .tw-statusbar > div:last-child { gap: 4px; }
    .tw-version-button { padding-inline: 4px; }
}

/* TrueWriter v1.1.0 hotfix: Release-/Changelog-Workspace ist wie Import,
   Export und Projekte ein eigenstaendiger Arbeitsbereich. Ohne diese
   Grid-Umschaltung landet .tw-editor-area bei ausgeblendeter Navigation
   im ehemaligen Navigator-Slot und wird auf dessen Breite zusammengedrueckt. */
@media (min-width: 721px) {
    .tw-app[data-workspace-mode='releaseNotes'] .tw-workspace {
        grid-template-columns: var(--tw-rail) minmax(0, 1fr) !important;
    }
    .tw-app[data-workspace-mode='releaseNotes'] .tw-navigator,
    .tw-app[data-workspace-mode='releaseNotes'] .tw-inspector {
        display: none !important;
    }
}


/* ========================================================================== */
/* Audit-Hotfix 2026-10-11 – iPhone/Safari, Projektkarten & App-Bestaetigung */
/* ========================================================================== */

/* TrueWriter-eigene Laufzeit-Bestaetigung statt Browser-window.confirm(). */
.tw-modal--confirm {
    width: min(520px, 100%);
}
.tw-confirm-copy {
    white-space: pre-line;
}
.tw-btn--danger {
    border-color: rgba(226, 121, 121, .46);
    background: linear-gradient(145deg, #b55f5f, #8e4545);
    color: #fff5f5;
    box-shadow: 0 10px 25px rgba(151, 48, 48, .14);
}
.tw-btn--danger:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

/* Mobile Serienkarte: Zaehler darf nicht zu einer schmalen Wortsaeule werden. */
@media (max-width: 720px) {
    .tw-series-card__head {
        min-width: 0;
    }
    .tw-series-card__head > div:first-child {
        min-width: 0;
    }
    .tw-series-card__count {
        min-width: 72px;
        text-align: center;
        white-space: nowrap;
        line-height: 1.15;
    }
}

/*
 * Mobile Viewport – stabile App-Geometrie.
 *
 * Die App darf NICHT an visualViewport.height gekoppelt werden: dieser Wert
 * schrumpft sowohl bei der Bildschirmtastatur als auch bei Pinch-Zoom. Genau
 * dadurch wurde bislang der gesamte Workspace kleiner und die Statusleiste
 * nach oben gezogen. Der App-Rahmen bleibt deshalb am Layout-/Dynamic-Viewport;
 * visualViewport liefert nur noch einen optionalen Scroll-Inset fuer die
 * Bildschirmtastatur.
 */
@supports (height: 100dvh) {
    .tw-app-body,
    .tw-app {
        height: 100dvh;
        min-height: 100dvh;
    }
    .tw-app.is-focus .tw-editor-area,
    .tw-app.is-focus .tw-editor-shell {
        height: 100dvh;
    }
    .tw-modal {
        max-height: calc(100dvh - 40px);
    }
}

@media (max-width: 720px) and (orientation: portrait) {
    .tw-app-body,
    .tw-app {
        height: 100dvh;
        min-height: 100dvh;
        max-height: 100dvh;
    }

    /* Keine mobile Eingabeflaeche darf unter der iOS-Fokuszoom-Schwelle liegen.
       Das gilt bewusst global fuer TrueWriter und nicht nur fuer ProseMirror. */
    .tw-app input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='color']):not([type='file']):not([type='hidden']),
    .tw-app select,
    .tw-app textarea {
        font-size: 16px;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
        touch-action: manipulation;
    }

    /* Drawer bleiben an der stabilen App-Hoehe verankert. Der optionale
       Tastatur-Inset vergroessert nur den scrollbaren Nachlauf, damit auch die
       letzten Felder oberhalb der Tastatur erreichbar bleiben. */
    .tw-settings-drawer {
        z-index: 410;
        top: var(--tw-top);
        right: 0;
        bottom: var(--tw-status);
        height: auto;
        max-height: none;
        box-sizing: border-box;
        overflow: hidden;
        padding: 0;
    }

    .tw-settings-drawer__body {
        padding-bottom: calc(18px + var(--tw-mobile-keyboard-inset, 0px));
        scroll-padding-bottom: calc(24px + var(--tw-mobile-keyboard-inset, 0px));
    }

    .tw-side-drawer,
    .tw-navigator,
    .tw-inspector {
        max-height: none;
        scroll-padding-bottom: calc(24px + var(--tw-mobile-keyboard-inset, 0px));
    }

    .tw-editor-shell,
    .tw-paper-wrap {
        scroll-padding-bottom: calc(24px + var(--tw-mobile-keyboard-inset, 0px));
    }

    /* Bei mobiler Texteingabe wird die Statusleiste nur optisch ausgeblendet.
       Ihre Grid-Zeile bleibt bestehen: kein Aufklappen, kein Hoehensprung. */
    .tw-app.is-mobile-keyboard-open .tw-statusbar {
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .tw-app.is-focus .tw-editor-area,
    .tw-app.is-focus .tw-editor-shell {
        height: 100dvh;
    }

    .tw-paper {
        min-height: calc(100dvh - var(--tw-top) - var(--tw-status) - 115px);
    }

    .tw-statusbar {
        padding-left: max(10px, env(safe-area-inset-left));
        padding-right: max(8px, env(safe-area-inset-right));
    }

    .tw-modal-backdrop {
        padding:
            max(12px, env(safe-area-inset-top))
            max(12px, env(safe-area-inset-right))
            max(12px, env(safe-area-inset-bottom))
            max(12px, env(safe-area-inset-left));
    }

    .tw-modal {
        max-height: calc(100dvh - 24px);
    }
}


/* ========================================================================== */
/* Mobile Schreibansicht 2026-10-11 – responsive Breite statt Mini-A4        */
/* ========================================================================== */
/*
 * Auf Smartphones bedeutet "Breite" jetzt: echte responsive Schreibflaeche.
 * Die gespeicherte A4-Einstellung wird nicht veraendert. "Seite" bleibt die
 * maßstaeblich verkleinerte A4-Vorschau. Dadurch bleibt editierbarer Text in
 * iOS/Safari mindestens 16 px groß und loest beim Fokus keinen Auto-Zoom aus.
 */
@media (max-width: 720px) and (orientation: portrait) {
    .tw-app[data-mobile-writing-view='flow'] .tw-paper-wrap {
        justify-content: stretch;
        overflow-x: hidden;
        padding-right: 0;
        padding-left: 0;
    }

    .tw-app[data-mobile-writing-view='flow'][data-page-mode='a4'] .tw-paper {
        width: 100%;
        min-width: 0;
        min-height: 0 !important;
        box-sizing: border-box;
        zoom: 1 !important;
        padding: 24px 18px calc(76px + env(safe-area-inset-bottom));
        border-radius: 0;
        background: var(--tw-paper) !important;
        color: var(--tw-paper-text);
        box-shadow: none;
    }

    /* Im normalen A4-Modus ist .tw-paper absichtlich transparent, weil die
       sichtbaren Seiten durch .tw-page-sheet gezeichnet werden. In der mobilen
       Breitenansicht blenden wir diese Seitenblaetter aus; deshalb muss die
       Schreibflaeche selbst wieder die gewaehlte Papierfarbe tragen. */
    .tw-app[data-mobile-writing-view='flow'][data-page-mode='a4'][data-paper-theme='white'] .tw-paper {
        background: #fff !important;
        color: #202020;
    }

    .tw-app[data-mobile-writing-view='flow'][data-page-mode='a4'][data-paper-theme='sepia'] .tw-paper {
        background: #eee1c6 !important;
        color: #2f2921;
    }

    .tw-app[data-mobile-writing-view='flow'][data-page-mode='a4'][data-paper-theme='dark'] .tw-paper {
        background: #171a1d !important;
        color: #e6e3dc;
    }

    .tw-app[data-mobile-writing-view='flow'] .tw-editor,
    .tw-app[data-mobile-writing-view='flow'] .tw-editor .ProseMirror {
        min-height: 0;
        /*
         * iOS Safari zoomt editierbare Flaechen je nach Font-Metrik trotz
         * nominell 16px noch automatisch an. 18px schafft einen sicheren
         * Abstand zur Fokus-Zoom-Schwelle, ohne den Desktop-/A4-Satz zu
         * veraendern. touch-action: manipulation verhindert zusaetzlich
         * Double-Tap-Smart-Zoom, laesst normales Scrollen und Pinch-Zoom aber zu.
         */
        font-size: max(18px, var(--tw-editor-font-size));
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
        touch-action: manipulation;
    }

    .tw-app[data-mobile-writing-view='flow'] .tw-editor .ProseMirror[contenteditable='true'] {
        font-size: max(18px, var(--tw-editor-font-size)) !important;
        touch-action: manipulation;
    }

    /* Seitenlineal und physische Seitenblaetter gehoeren zur Layoutvorschau,
       nicht zur mobilen Schreibansicht. */
    .tw-app[data-mobile-writing-view='flow'] .tw-ruler,
    .tw-app[data-mobile-writing-view='flow'] .tw-page-sheets,
    .tw-app[data-mobile-writing-view='flow'] .tw-page-sheet {
        display: none !important;
    }

    /* In "Breite" ist 100 % die echte mobile CSS-Groesse. +/- und die
       Prozentanzeige wuerden hier nur einen A4-Massstab suggerieren. */
    .tw-app[data-mobile-writing-view='flow'] .tw-document-zoom .tw-zoom-button,
    .tw-app[data-mobile-writing-view='flow'] .tw-document-zoom .tw-zoom-value {
        display: none;
    }

    .tw-app[data-mobile-writing-view='flow'] .tw-document-zoom {
        overflow: visible;
    }

    .tw-app[data-mobile-writing-view='flow'] .tw-zoom-fit {
        min-height: 36px;
        padding-inline: 12px;
    }
}

/* ========================================================================== */
/* Virtuelle Sammelbände / Collection-Workspace                              */
/* ========================================================================== */
.tw-projects-empty__actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
.tw-project-card.is-collection {
    border-color: rgba(212, 175, 55, .24);
}
.tw-project-card__cover-empty.is-collection {
    background:
        radial-gradient(circle at 50% 14%, rgba(212,175,55,.2), transparent 34%),
        linear-gradient(145deg, #252b30, #14191d 62%, #0d1114);
}
.tw-project-card__cover-empty.is-collection b {
    font-family: inherit;
    font-size: 3.2rem;
    font-weight: 300;
    letter-spacing: -.1em;
}
.tw-modal--collection {
    width: min(560px, calc(100vw - 36px));
    max-width: 560px;
}
.tw-modal--collection > p {
    margin: 0 0 16px;
    color: #89949a;
    font-size: .76rem;
    line-height: 1.55;
}
.tw-modal--collection form {
    display: grid;
    gap: 12px;
}
.tw-collection-workspace {
    padding-bottom: 90px;
}
.tw-collection-workspace__head,
.tw-collection-note,
.tw-collection-layout {
    width: min(1280px, 100%);
    margin-left: auto;
    margin-right: auto;
}
.tw-collection-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 10px 13px;
    border: 1px solid rgba(212, 175, 55, .18);
    border-radius: 10px;
    background: rgba(212, 175, 55, .035);
}
.tw-collection-note strong {
    flex: 0 0 auto;
    color: #dec75f;
    font-size: .7rem;
}
.tw-collection-note span {
    color: #818c92;
    font-size: .68rem;
    line-height: 1.45;
}
.tw-collection-layout {
    display: grid;
    grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.tw-collection-source,
.tw-collection-composition {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--tw-line);
    border-radius: 15px;
    background: linear-gradient(180deg, rgba(24, 29, 34, .92), rgba(15, 19, 23, .96));
    box-shadow: 0 16px 36px rgba(0, 0, 0, .12);
}
.tw-collection-source {
    position: sticky;
    top: 16px;
}
.tw-collection-panel-head {
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 15px;
    border-bottom: 1px solid var(--tw-line);
}
.tw-collection-panel-head > div {
    min-width: 0;
}
.tw-collection-panel-head h2 {
    margin: 3px 0 0;
    color: #eef1f2;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.08rem;
    font-weight: 500;
}
.tw-collection-panel-head > span {
    max-width: 52%;
    overflow: hidden;
    color: #778289;
    font-size: .64rem;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-collection-source > .tw-field {
    margin: 13px 14px 10px;
}
.tw-collection-source-primary {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 11px;
    align-items: center;
    margin: 0 12px 10px;
    padding: 12px;
    border: 1px solid rgba(212, 175, 55, .24);
    border-radius: 11px;
    background: rgba(212, 175, 55, .045);
}
.tw-collection-source-primary.is-included {
    border-color: rgba(100, 190, 141, .24);
    background: rgba(74, 158, 112, .04);
}
.tw-collection-source-primary__icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid rgba(212,175,55,.2);
    border-radius: 9px;
    color: #d9bf57;
    font-size: .9rem;
}
.tw-collection-source-primary__copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}
.tw-collection-source-primary__copy > strong {
    overflow: hidden;
    color: #e9edef;
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-collection-source-primary__copy > span:not(.tw-panel-eyebrow) {
    color: #89949a;
    font-size: .63rem;
}
.tw-collection-source-primary__copy > small {
    color: #707b82;
    font-size: .6rem;
    line-height: 1.45;
}
.tw-collection-source-primary__action {
    align-self: center;
}
.tw-collection-source-hint {
    margin: 0 12px 9px;
    padding: 8px 10px;
    border: 1px solid rgba(212,175,55,.12);
    border-radius: 8px;
    background: rgba(212,175,55,.025);
    color: #8c969c;
    font-size: .62rem;
    line-height: 1.45;
}
.tw-collection-source-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px 10px;
    border-top: 1px solid rgba(255,255,255,.04);
}
.tw-collection-source-detail-head > span {
    color: #68747b;
    font-size: .59rem;
    line-height: 1.4;
    text-align: right;
}
.tw-collection-detail-toggle {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: #d5bd59;
    font: inherit;
    font-size: .66rem;
    font-weight: 700;
    cursor: pointer;
}
.tw-collection-detail-toggle:disabled {
    color: #657077;
    cursor: default;
}
.tw-collection-source-details[hidden] { display: none !important; }
.tw-collection-source-list {
    display: grid;
    max-height: calc(100dvh - 315px);
    overflow: auto;
    overscroll-behavior: contain;
    border-top: 1px solid rgba(255, 255, 255, .035);
}
.tw-collection-source-chapter {
    border-bottom: 1px solid rgba(255, 255, 255, .045);
}
.tw-collection-source-scenes {
    display: grid;
    background: rgba(7, 10, 12, .2);
}
.tw-collection-source-orphans {
    display: grid;
    gap: 0;
    padding-top: 10px;
}
.tw-collection-source-orphans > .tw-panel-eyebrow {
    padding: 0 14px 7px;
}
.tw-collection-source-row {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    padding: 10px 12px;
}
.tw-collection-source-row.is-scene {
    padding-left: 25px;
}
.tw-collection-source-row + .tw-collection-source-row {
    border-top: 1px solid rgba(255, 255, 255, .035);
}
.tw-collection-source-icon {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    color: #d4b84f;
    font-size: .72rem;
}
.tw-collection-source-row.is-scene .tw-collection-source-icon {
    color: #728087;
}
.tw-collection-source-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}
.tw-collection-source-copy strong {
    overflow: hidden;
    color: #dce1e3;
    font-size: .73rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-collection-source-copy span {
    overflow: hidden;
    color: #707b82;
    font-size: .61rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-collection-source-row .tw-btn {
    min-width: 78px;
}
.tw-collection-source-row .tw-btn:disabled {
    opacity: .5;
    cursor: default;
}
.tw-collection-items {
    display: grid;
    gap: 8px;
    padding: 12px;
}
.tw-collection-item {
    display: grid;
    grid-template-columns: 24px 32px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 11px 11px 11px 8px;
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 11px;
    background: rgba(7, 10, 12, .28);
    transition: border-color .14s ease, background .14s ease, opacity .14s ease, transform .14s ease;
}
.tw-collection-item:hover {
    border-color: rgba(212, 175, 55, .2);
    background: rgba(212, 175, 55, .025);
}
.tw-collection-item.is-dragging {
    opacity: .46;
}
.tw-collection-item.is-drag-over {
    border-color: rgba(212, 175, 55, .65);
    background: rgba(212, 175, 55, .08);
    transform: translateY(2px);
}
.tw-collection-item.is-unavailable {
    border-color: rgba(203, 91, 91, .16);
    background: rgba(151, 48, 48, .04);
}
.tw-collection-item.is-project {
    border-color: rgba(212, 175, 55, .16);
    background: rgba(212, 175, 55, .018);
}
.tw-collection-item__drag {
    display: grid;
    min-height: 34px;
    place-items: center;
    color: #626e75;
    font-size: .8rem;
    cursor: grab;
    user-select: none;
}
.tw-collection-item__drag:active {
    cursor: grabbing;
}
.tw-collection-item__index {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid rgba(212, 175, 55, .16);
    border-radius: 8px;
    background: rgba(212, 175, 55, .05);
    color: #d4b84f;
    font-size: .68rem;
    font-weight: 800;
}
.tw-collection-item__copy {
    display: grid;
    min-width: 0;
    gap: 5px;
}
.tw-collection-item__title {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 8px;
}
.tw-collection-item__title > span {
    flex: 0 0 auto;
    color: #d4b84f;
    font-size: .58rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.tw-collection-item__title strong {
    overflow: hidden;
    color: #e5e9eb;
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-collection-item__meta {
    display: flex;
    min-width: 0;
    gap: 8px 12px;
    flex-wrap: wrap;
    color: #747f86;
    font-size: .61rem;
}
.tw-collection-item__meta span:first-child {
    overflow: hidden;
    max-width: 420px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tw-collection-item__meta .is-warning {
    color: #d49175;
}
.tw-collection-item__actions {
    display: flex;
    align-items: center;
    gap: 5px;
}
.tw-collection-order-button,
.tw-collection-remove {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 8px;
    background: rgba(255, 255, 255, .02);
    color: #879198;
    font: inherit;
    cursor: pointer;
}
.tw-collection-order-button:hover:not(:disabled) {
    border-color: rgba(212, 175, 55, .26);
    color: #dec75f;
}
.tw-collection-remove {
    border-color: rgba(203, 91, 91, .18);
    color: #b87878;
}
.tw-collection-remove:hover:not(:disabled) {
    border-color: rgba(203, 91, 91, .46);
    background: rgba(151, 48, 48, .12);
    color: #e19a9a;
}
.tw-collection-order-button:disabled,
.tw-collection-remove:disabled {
    opacity: .35;
    cursor: default;
}
.tw-collection-empty {
    display: flex;
    min-height: 130px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    padding: 22px 18px;
    color: #758087;
    text-align: center;
}
.tw-collection-empty.is-large {
    min-height: 280px;
    border: 1px dashed rgba(255, 255, 255, .07);
    border-radius: 11px;
}
.tw-collection-empty strong {
    color: #cbd1d4;
    font-size: .78rem;
}
.tw-collection-empty span {
    max-width: 420px;
    font-size: .66rem;
    line-height: 1.5;
}
@media (min-width: 721px) {
    .tw-app[data-workspace-mode='collection'] .tw-workspace {
        grid-template-columns: var(--tw-rail) minmax(0, 1fr) !important;
    }
    .tw-app[data-workspace-mode='collection'] .tw-navigator,
    .tw-app[data-workspace-mode='collection'] .tw-inspector {
        display: none !important;
    }
}
@media (max-width: 980px) {
    .tw-collection-layout {
        grid-template-columns: 1fr;
    }
    .tw-collection-source {
        position: static;
    }
    .tw-collection-source-list {
        max-height: 440px;
    }
}
@media (max-width: 720px) {
    .tw-collection-workspace {
        padding-bottom: 76px;
    }
    .tw-collection-workspace__head .tw-import-workspace__actions {
        align-items: stretch;
    }
    .tw-collection-workspace__head .tw-import-workspace__actions .tw-btn {
        width: 100%;
    }
    .tw-collection-note {
        align-items: flex-start;
        flex-direction: column;
    }
    .tw-collection-source-list {
        max-height: none;
    }
    .tw-collection-item {
        grid-template-columns: 20px 28px minmax(0, 1fr);
        align-items: start;
    }
    .tw-collection-item__actions {
        grid-column: 2 / -1;
        width: 100%;
        justify-content: flex-end;
    }
    .tw-collection-item__meta span:first-child {
        max-width: 100%;
        white-space: normal;
    }
    .tw-collection-source-primary {
        grid-template-columns: 30px minmax(0, 1fr);
    }
    .tw-collection-source-primary__action {
        grid-column: 2;
        justify-self: start;
    }
    .tw-collection-source-detail-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .tw-collection-source-detail-head > span {
        text-align: left;
    }
    .tw-collection-source-row {
        grid-template-columns: 20px minmax(0, 1fr);
    }
    .tw-collection-source-row .tw-btn {
        grid-column: 2;
        justify-self: start;
        min-width: 0;
    }
    .tw-modal--collection {
        width: calc(100vw - 20px);
    }
}

/* ========================================================================== */
/* Plotboard-Verknüpfungen & skalierbarer Weltenbaum-Fokus                    */
/* ========================================================================== */

.tw-plan-view-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    background: rgba(8,11,14,.42);
}

.tw-plan-view-switch__button {
    min-height: 31px;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #7f8a91;
    font: inherit;
    font-size: .65rem;
    font-weight: 700;
    cursor: pointer;
}

.tw-plan-view-switch__button:hover,
.tw-plan-view-switch__button.is-active,
.tw-plan-view-switch__button[aria-pressed='true'] {
    background: rgba(212,175,55,.12);
    color: #e5c75d;
}

.tw-plan-relation-toolbar {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-end;
    gap: 10px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--tw-line);
    background: rgba(15,19,22,.72);
}

.tw-plan-relation-toolbar[hidden] { display: none !important; }

.tw-plan-relation-toolbar__status {
    display: grid;
    min-width: 260px;
    margin-right: auto;
    gap: 2px;
}

.tw-plan-relation-toolbar__status strong {
    color: #d9dddf;
    font-size: .72rem;
    font-weight: 650;
}

.tw-plan-relation-toolbar__status small {
    color: #707b82;
    font-size: .61rem;
}

.tw-plan-relation-toolbar > label {
    display: grid;
    min-width: 140px;
    gap: 4px;
    color: #778188;
    font-size: .59rem;
}

.tw-plan-relation-toolbar select,
.tw-plan-relation-toolbar input {
    min-height: 33px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 8px;
    outline: 0;
    background: #171c20;
    color: #dce0e2;
    padding: 0 9px;
    font: inherit;
    font-size: .65rem;
}

.tw-plan-relation-toolbar select:focus,
.tw-plan-relation-toolbar input:focus {
    border-color: rgba(212,175,55,.55);
    box-shadow: 0 0 0 2px rgba(212,175,55,.08);
}

.tw-plan-relation-custom { min-width: 205px !important; }
.tw-plan-relation-custom[hidden] { display: none !important; }
.tw-plan-relation-toolbar__actions { display: flex; gap: 6px; }

.tw-plan-board.is-relations {
    display: block;
    padding: 0;
    scroll-snap-type: none;
    overflow: auto;
    background:
        linear-gradient(rgba(255,255,255,.014) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.014) 1px, transparent 1px),
        #1f252a;
    background-size: 28px 28px;
}

.tw-plan-relation-surface {
    position: relative;
    width: 100%;
    min-height: 100%;
    box-sizing: border-box;
}

.tw-plan-relation-surface.is-grid {
    padding: 0;
}

.tw-plan-relation-viewport {
    position: relative;
    width: 100%;
    height: clamp(520px, calc(100vh - 255px), 780px);
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.tw-plan-relation-sizer {
    position: relative;
    min-width: 100%;
    min-height: 100%;
}

.tw-plan-relation-stage {
    position: absolute;
    top: 0;
    left: 0;
    min-height: 520px;
    box-sizing: border-box;
    padding: 18px 198px 42px 18px;
    transform-origin: 0 0;
}

.tw-plan-relation-svg {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: visible;
    pointer-events: none;
}

.tw-plan-relation-edge {
    fill: none;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .72;
    vector-effect: non-scaling-stroke;
}

.tw-plan-relation-edge.is-mutual { stroke-dasharray: 7 5; }
.tw-plan-relation-edge.is-selected {
    stroke-width: 3.5;
    opacity: 1;
    filter: drop-shadow(0 0 5px rgba(255,255,255,.14));
}

.tw-plan-relation-edge-badge rect {
    fill: rgba(15,20,23,.97);
    stroke-width: 1;
}

.tw-plan-relation-edge-label {
    paint-order: stroke;
    stroke: #11171a;
    stroke-width: 4px;
    stroke-linejoin: round;
    font-size: 9.5px;
    font-weight: 760;
    letter-spacing: .01em;
}

.tw-plan-relation-graph {
    position: relative;
    z-index: 2;
    width: 100%;
    min-width: 0;
}

.tw-plan-relation-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 10px;
    width: fit-content;
    max-width: 100%;
    margin-bottom: 12px;
    padding: 7px 9px;
    border: 1px solid rgba(255,255,255,.055);
    border-radius: 9px;
    background: rgba(13,17,20,.62);
}

.tw-plan-relation-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #7d888e;
    font-size: .56rem;
}

.tw-plan-relation-legend span.is-empty { opacity: .7; }

.tw-plan-relation-legend i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--relation-color, #9ca8ae);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--relation-color, #9ca8ae) 13%, transparent);
}

.tw-plan-relation-chapters {
    position: relative;
    z-index: 2;
}

.tw-plan-relation-chapters.is-compact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(188px, 218px));
    align-items: start;
    justify-content: start;
    gap: 14px 16px;
    min-height: 0;
    padding: 0 0 16px;
}

.tw-plan-relation-chapter {
    position: relative;
    overflow: hidden;
    min-width: 0;
    border: 1px solid rgba(255,255,255,.075);
    border-radius: 11px;
    background: rgba(17,21,25,.96);
    box-shadow: 0 12px 24px rgba(0,0,0,.15);
}

.tw-plan-relation-chapter.is-compact {
    width: 100%;
}

.tw-plan-relation-chapter.is-link-source,
.tw-plan-relation-scene.is-link-source {
    border-color: rgba(212,175,55,.84);
    box-shadow: 0 0 0 2px rgba(212,175,55,.10);
}

.tw-plan-relation-chapter.is-link-target,
.tw-plan-relation-scene.is-link-target {
    border-color: rgba(98,180,142,.84);
    box-shadow: 0 0 0 2px rgba(98,180,142,.10);
}

.tw-plan-relation-chapter__head {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
    padding: 9px 10px 8px;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,.06);
    background: rgba(255,255,255,.018);
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.tw-plan-relation-chapter__head:hover { background: rgba(212,175,55,.045); }

.tw-plan-relation-chapter__head > span {
    color: #c6a83b;
    font-size: .49rem;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.tw-plan-relation-chapter__head strong {
    overflow: hidden;
    color: #e6e9ea;
    font-family: Georgia, serif;
    font-size: .76rem;
    font-weight: 500;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tw-plan-relation-chapter__head small {
    overflow: hidden;
    color: #69747b;
    font-size: .52rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tw-plan-relation-scenes {
    display: grid;
    gap: 5px;
    padding: 6px;
}

.tw-plan-relation-scenes:empty { display: none; }

.tw-plan-relation-scene {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    padding: 6px 7px;
    border: 1px solid rgba(255,255,255,.055);
    border-radius: 7px;
    background: #1a2024;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.tw-plan-relation-scene:hover {
    border-color: rgba(212,175,55,.36);
    background: #1c2327;
}

.tw-plan-relation-scene > span {
    overflow: hidden;
    color: #d6dade;
    font-size: .59rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tw-plan-relation-scene > small {
    overflow: hidden;
    color: #68737a;
    font-size: .50rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tw-plan-relation-zoom {
    position: sticky;
    z-index: 8;
    right: 12px;
    bottom: 12px;
    float: right;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin: -48px 12px 12px 0;
    padding: 3px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 9px;
    background: rgba(11,15,18,.92);
    box-shadow: 0 9px 24px rgba(0,0,0,.22);
    backdrop-filter: blur(10px);
}

.tw-plan-relation-zoom button {
    display: grid;
    min-width: 31px;
    height: 28px;
    place-items: center;
    padding: 0 7px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #a8b0b5;
    font: inherit;
    font-size: .72rem;
    cursor: pointer;
}

.tw-plan-relation-zoom button:hover {
    background: rgba(255,255,255,.05);
    color: #fff;
}

.tw-plan-relation-zoom button.is-fit {
    min-width: auto;
    padding-inline: 9px;
    color: #d9bd55;
    font-size: .56rem;
    font-weight: 760;
}

.tw-plan-relation-zoom span {
    min-width: 50px;
    color: #7d888e;
    font-size: .58rem;
    text-align: center;
}

.tw-plan-relation-inspector {
    display: grid;
    gap: 12px;
    padding: 14px 12px 18px;
}

.tw-plan-relation-inspector[hidden] { display: none !important; }

.tw-plan-relation-inspector__head {
    display: grid;
    gap: 5px;
}

.tw-plan-relation-inspector__head h3 {
    margin: 0;
    color: #e3e7e9;
    font-family: Georgia, serif;
    font-size: 1rem;
    font-weight: 500;
}

.tw-plan-relation-inspector__head p {
    margin: 0;
    color: #778188;
    font-size: .6rem;
    line-height: 1.45;
}

.tw-plan-relation-inspector__visibility-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 3px;
}

.tw-plan-relation-inspector__visibility-actions button {
    min-height: 26px;
    padding: 5px 8px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 7px;
    background: rgba(255,255,255,.025);
    color: #9ca6ab;
    font: inherit;
    font-size: .54rem;
    font-weight: 700;
    cursor: pointer;
}

.tw-plan-relation-inspector__visibility-actions button:hover:not(:disabled) {
    border-color: rgba(212,175,55,.28);
    background: rgba(212,175,55,.07);
    color: #dcc55e;
}

.tw-plan-relation-inspector__visibility-actions button:disabled {
    opacity: .38;
    cursor: default;
}

.tw-plan-relation-inspector__list {
    display: grid;
    gap: 6px;
}

.tw-plan-relation-inspector__row {
    --relation-color: #9ca8ae;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 9px;
    background: rgba(255,255,255,.018);
}

.tw-plan-relation-inspector__row:hover,
.tw-plan-relation-inspector__row.is-active {
    border-color: color-mix(in srgb, var(--relation-color) 48%, transparent);
    background: color-mix(in srgb, var(--relation-color) 7%, transparent);
}

.tw-plan-relation-inspector__select {
    display: grid;
    min-width: 0;
    grid-template-columns: 16px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.tw-plan-relation-inspector__select i {
    position: relative;
    width: 15px;
    height: 15px;
    border: 1px solid color-mix(in srgb, var(--relation-color) 72%, #ffffff 8%);
    border-radius: 4px;
    background: rgba(255,255,255,.018);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.16);
}

.tw-plan-relation-inspector__row.is-active .tw-plan-relation-inspector__select i {
    background: color-mix(in srgb, var(--relation-color) 23%, transparent);
}

.tw-plan-relation-inspector__row.is-active .tw-plan-relation-inspector__select i::after {
    content: '✓';
    position: absolute;
    inset: -1px 0 0;
    display: grid;
    place-items: center;
    color: var(--relation-color);
    font-size: .58rem;
    font-style: normal;
    font-weight: 900;
}

.tw-plan-relation-inspector__row:not(.is-active) .tw-plan-relation-inspector__select span {
    opacity: .58;
}

.tw-plan-relation-inspector__select span {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.tw-plan-relation-inspector__select strong {
    overflow: hidden;
    color: #d7dcde;
    font-size: .59rem;
    font-weight: 650;
    line-height: 1.35;
    text-overflow: ellipsis;
}

.tw-plan-relation-inspector__select strong b {
    color: var(--relation-color);
}

.tw-plan-relation-inspector__select small {
    color: var(--relation-color);
    font-size: .53rem;
    font-weight: 700;
}

.tw-plan-relation-inspector__delete {
    display: grid;
    width: 28px;
    border: 0;
    border-left: 1px solid rgba(255,255,255,.05);
    background: transparent;
    place-items: center;
    color: #a96d6d;
    font-size: .88rem;
    cursor: pointer;
}

.tw-plan-relation-inspector__delete:hover {
    background: rgba(174,85,85,.10);
    color: #e28d8d;
}

.tw-plan-relation-inspector__empty {
    display: grid;
    gap: 4px;
    padding: 12px 10px;
    border: 1px dashed rgba(255,255,255,.07);
    border-radius: 9px;
    color: #788289;
}

.tw-plan-relation-inspector__empty strong {
    color: #aeb5b9;
    font-size: .63rem;
}

.tw-plan-relation-inspector__empty span {
    font-size: .56rem;
}

@media (max-width: 1100px) {
    .tw-plan-relation-stage { padding-right: 174px; }
    .tw-plan-relation-chapters.is-compact-grid {
        grid-template-columns: repeat(auto-fill, minmax(178px, 208px));
        gap: 12px;
    }
}

@media (max-width: 920px) {
    .tw-plan-view-switch { order: 3; }
    .tw-plan-relation-toolbar { align-items: stretch; flex-wrap: wrap; }
    .tw-plan-relation-toolbar__status { width: 100%; min-width: 0; }
    .tw-plan-relation-toolbar > label { flex: 1 1 160px; }
    .tw-plan-relation-viewport { height: clamp(480px, calc(100vh - 280px), 680px); }
    .tw-plan-relation-stage { padding-right: 154px; }
}

@media (max-width: 720px) {
    .tw-plan-view-switch { width: 100%; }
    .tw-plan-view-switch__button { flex: 1; }
    .tw-plan-relation-toolbar { padding: 9px 12px; }
    .tw-plan-relation-toolbar > label { min-width: 0; flex-basis: 100%; }
    .tw-plan-relation-toolbar__actions { width: 100%; }
    .tw-plan-relation-toolbar__actions .tw-btn { flex: 1; }
    .tw-plan-relation-viewport { height: 520px; }
    .tw-plan-relation-stage { padding: 14px 136px 34px 12px; }
    .tw-plan-relation-chapters.is-compact-grid {
        grid-template-columns: repeat(auto-fill, minmax(164px, 190px));
        gap: 10px;
    }
}

.tw-worldtree-node.is-focus-cluster .tw-worldtree-node__circle {
    fill-opacity: .82;
    stroke: rgba(238,207,91,.72);
    stroke-width: 2.5;
    stroke-dasharray: 4 3;
}

.tw-worldtree-node.is-focus-cluster .tw-worldtree-node__halo {
    opacity: .42;
    stroke: rgba(238,207,91,.46);
}

.tw-worldtree-node.is-focus-cluster .tw-worldtree-node__label {
    fill: #e3c85c;
    font-weight: 800;
}

@media (max-width: 920px) {
    .tw-plan-view-switch { order: 3; }
    .tw-plan-relation-toolbar { align-items: stretch; flex-wrap: wrap; }
    .tw-plan-relation-toolbar__status { width: 100%; min-width: 0; }
    .tw-plan-relation-toolbar > label { flex: 1 1 160px; }
    .tw-plan-relation-list { width: min(720px, calc(100vw - 80px)); }
}

@media (max-width: 720px) {
    .tw-plan-view-switch { width: 100%; }
    .tw-plan-view-switch__button { flex: 1; }
    .tw-plan-relation-toolbar { padding: 9px 12px; }
    .tw-plan-relation-toolbar > label { min-width: 0; flex-basis: 100%; }
    .tw-plan-relation-toolbar__actions { width: 100%; }
    .tw-plan-relation-toolbar__actions .tw-btn { flex: 1; }
    .tw-plan-relation-surface { padding: 16px 14px 24px; }
    .tw-plan-relation-chapters { gap: 58px; }
    .tw-plan-relation-chapter { width: min(76vw, 250px); min-width: min(76vw, 250px); }
    .tw-plan-relation-list { width: min(690px, calc(100vw - 44px)); }
}
/* BEGIN TRUEWRITER 2SEC.4C.2F - Wörterbuch Eingabezeile + Zeichenzähler */
/*
 * Der Live-Zähler unter "Wort" darf die eigentliche Control-Zeile nicht
 * nach oben versetzen. Wort, Gültigkeit, optionales Ziel und Hinzufügen
 * beginnen auf Desktop wieder auf derselben Höhe.
 */
.tw-dictionary-add-fields {
    align-items: start;
}
.tw-dictionary-add-fields > .tw-field {
    margin-bottom: 0;
}
.tw-dictionary-add-fields > .tw-btn {
    align-self: start;
    margin-top: 24px;
}
@media (max-width: 560px) {
    .tw-dictionary-add-fields > .tw-btn {
        margin-top: 0;
    }
}
/* END TRUEWRITER 2SEC.4C.2F - Wörterbuch Eingabezeile + Zeichenzähler */
/* BEGIN TRUEWRITER 2SEC.6B.1 TIMELINE CARD DETAILS */
/*
 * Timeline-Cards: Kurzfassung und Timeline-Notizen getrennt darstellen.
 * Lange Inhalte bleiben zunächst kompakt und können explizit aufgeklappt werden.
 */
.tw-timeline-card__content {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.tw-timeline-card__content-block {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.tw-timeline-card__content-label {
    color: #d4af37;
    font-size: .57rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.tw-timeline-card__content p {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: #8f999f;
    font-size: .72rem;
    line-height: 1.48;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tw-timeline-card.is-expanded .tw-timeline-card__content p {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
}

.tw-timeline-card__expand {
    justify-self: start;
    padding: 0;
    border: 0;
    background: transparent;
    color: #d4af37;
    font: inherit;
    font-size: .64rem;
    font-weight: 700;
    cursor: pointer;
}

.tw-timeline-card__expand:hover,
.tw-timeline-card__expand:focus-visible {
    color: #ecd46f;
    text-decoration: underline;
}

.tw-timeline-card__expand:focus-visible {
    outline: 1px solid rgba(212,175,55,.48);
    outline-offset: 3px;
    border-radius: 2px;
}
/* END TRUEWRITER 2SEC.6B.1 TIMELINE CARD DETAILS */
/* ==========================================================================
   TrueWriter v1.3.0 – Desktop Zwischenbreiten-Hotfix 2026-10-14
   Wörterbuch + Analyse-Toolbar
   ========================================================================== */

/*
 * Wörterbuch:
 * Bei Desktop-Zwischenbreiten ist die eigentliche Workspace-Spalte wesentlich
 * schmaler als der Viewport, weil Navigator und Inspector gleichzeitig offen
 * sind. Die bisherige 4-Spalten-Struktur reserviert selbst bei verborgenem
 * Zielfeld zu viel Platz.
 */
@media (min-width: 1101px) and (max-width: 1550px) {
    .tw-dictionary-add-card {
        grid-template-columns: minmax(180px, .62fr) minmax(0, 1.38fr);
        gap: 18px;
    }

    .tw-dictionary-add-fields {
        min-width: 0;
    }

    /* Normalfall: Wort + Gültigkeit + Button */
    .tw-dictionary-add-fields:has(#twDictionaryManagerTargetField[hidden]) {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(150px, .85fr)
            max-content;
    }

    .tw-dictionary-add-fields:has(#twDictionaryManagerTargetField[hidden]) > .tw-btn {
        grid-column: auto;
        justify-self: end;
    }

    /* Falls Reihe/Welt ein zusätzliches konkretes Ziel benötigt */
    .tw-dictionary-add-fields:not(:has(#twDictionaryManagerTargetField[hidden])) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tw-dictionary-add-fields:not(:has(#twDictionaryManagerTargetField[hidden])) > .tw-btn {
        grid-column: 2;
        justify-self: end;
    }

    .tw-dictionary-add-fields > .tw-btn {
        width: auto;
        max-width: 100%;
        white-space: nowrap;
    }
}


/*
 * Analyse:
 * Bei ca. 1440 px stehen dem eigentlichen Editor wegen Navigator + Inspector
 * nur rund 800 px zur Verfügung. Aktionen und Filter dürfen deshalb nicht
 * unsichtbar horizontal abgeschnitten werden.
 */
@media (min-width: 921px) and (max-width: 1550px) {
    .tw-analysis-toolbar {
        width: min(1160px, calc(100% - 20px));
    }

    .tw-analysis-toolbar__top {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 7px;
    }

    .tw-analysis-toolbar__actions {
        flex-wrap: wrap;
        overflow: visible;
    }

    .tw-analysis-mode-switch {
        justify-self: end;
    }

    .tw-analysis-toolbar__bottom {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "filters dialogue"
            "state   state";
        row-gap: 6px;
        align-items: start;
    }

    .tw-analysis-toolbar__filters {
        grid-area: filters;
        flex-wrap: wrap;
        overflow: visible;
        row-gap: 4px;
    }

    .tw-analysis-dialogue-view {
        grid-area: dialogue;
        align-self: start;
    }

    .tw-analysis-service-state {
        grid-area: state;
        justify-self: end;
    }
}