        * { box-sizing: border-box; }
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: #e0e0e0; margin: 0; padding: 20px; color: #222;
        }
        .layout {
            display: grid; grid-template-columns: 380px minmax(0, 1fr);
            gap: 20px; max-width: 1440px; margin: 0 auto; align-items: start;
        }
        @media (max-width: 900px) {
            .layout { grid-template-columns: 1fr; }
            .log-panel { position: static !important; max-height: 420px !important; }
        }
        .log-panel {
            background: #1a1a1a; color: #e0e0e0; border: 2px solid #000;
            box-shadow: 0 4px 10px rgba(0,0,0,0.2);
            display: flex; flex-direction: column;
            position: sticky; top: 20px;
            max-height: calc(100vh - 40px);
            font-family: monospace; font-size: 12px;
        }
        .log-header {
            display: flex; align-items: center; justify-content: space-between;
            background: #000; color: #fff; padding: 8px 10px;
            font-weight: bold; font-size: 13px; letter-spacing: 1px; text-transform: uppercase;
        }
        .conn-status { font-size: 11px; padding: 2px 8px; border-radius: 10px; text-transform: uppercase; }
        .conn-status.online  { background: #2e7d32; color: #fff; }
        .conn-status.offline { background: #555;    color: #ddd; }
        .conn-status.error   { background: #b00020; color: #fff; }
        .conn-bar { display: flex; gap: 4px; padding: 6px; background: #2a2a2a; border-bottom: 1px solid #333; }
        .conn-bar input {
            flex: 1; min-width: 0; padding: 4px 6px; font-family: monospace;
            font-size: 12px; border: 1px solid #555; background: #111; color: #eee;
        }
        .conn-bar button {
            padding: 4px 8px; font-family: monospace; font-size: 11px;
            border: 1px solid #555; background: #333; color: #eee; cursor: pointer;
        }
        .conn-bar button:hover { background: #444; }
        #log { flex: 1; overflow-y: auto; padding: 8px; }
        .log-entry {
            padding: 4px 8px; margin: 3px 0; border-left: 3px solid #444;
            white-space: pre-wrap; line-height: 1.35; word-wrap: break-word;
        }
        .log-ok   { border-left-color: #4CAF50; color: #b8f0bd; }
        .log-err  { border-left-color: #e53935; color: #ffb4ab; }
        .log-info { border-left-color: #666;    color: #aaa; }
        .log-out  { border-left-color: #3f7fbf; color: #9ec7ef; }
        .log-time { color: #666; }

        .sheet-container { background-color: #fff; box-shadow: 0 4px 10px rgba(0,0,0,0.2); border: 2px solid #000; }
        .tabs { display: flex; border-bottom: 2px solid #000; background: #f0f0f0; }
        .tab {
            flex: 1; padding: 12px 16px; background: #f0f0f0; border: none;
            border-right: 1px solid #ccc; font-size: 14px; font-weight: bold;
            text-transform: uppercase; letter-spacing: 1px; cursor: pointer;
            color: #555; position: relative;
        }
        .tab:last-child { border-right: none; }
        .tab:hover { background: #e0e0e0; }
        .tab.active { background: #fff; color: #000; border-bottom: 3px solid #fff; margin-bottom: -2px; }
        .tab .badge {
            display: inline-block; background: #b00020; color: #fff;
            font-size: 10px; padding: 1px 6px; border-radius: 8px;
            margin-left: 6px; vertical-align: middle;
        }
        .tab-content { display: none; padding: 20px; }
        .tab-content.active { display: block; }

        .header {
            display: flex; gap: 20px; margin-bottom: 20px;
            border-bottom: 2px solid #000; padding-bottom: 10px;
        }
        .portrait {
            width: 150px; height: 150px; background-color: #ccc; border: 2px solid #000;
            display: flex; align-items: center; justify-content: center;
            font-weight: bold; color: #555; text-align: center; flex-shrink: 0;
        }
        .portrait img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
        .portrait.hat-foto { padding: 0; background: #fff; }
        .header-info { flex-grow: 1; }
        .header-info h1 { margin: 0 0 10px 0; font-size: 32px; text-transform: uppercase; }
        #char-subtitle { margin-bottom: 10px; color: #555; font-size: 14px; }
        .status-bar { display: flex; gap: 20px; background: #000; color: #fff; padding: 10px; }
        .status-item { display: flex; align-items: center; gap: 10px; font-weight: bold; }
        .box-btn { background-color: #fff; color: #000; border: 2px solid #fff; padding: 2px 8px; font-weight: bold; }
        .status-actions { margin-top: 8px; display: flex; justify-content: flex-end; }
        .status-actions button {
            padding: 4px 12px; font-size: 12px; background: #fff;
            border: 1px solid #000; cursor: pointer; font-weight: bold;
        }
        .status-actions button:hover { background: #000; color: #fff; }

        .main-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
        .section { border: 2px solid #000; margin-bottom: 15px; }
        .section-title {
            background-color: #000; color: #fff; padding: 5px 10px;
            font-weight: bold; text-transform: uppercase; text-align: center; letter-spacing: 1px;
        }
        .section-content { padding: 10px; }
        .stat-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; border-bottom: 1px dotted #999; }
        .stat-row.clickable { cursor: pointer; transition: background 0.1s; }
        .stat-row.clickable:hover { background-color: #f0f8ff; }
        .stat-row.unskilled { opacity: 0.6; }
        .stat-row.locked { opacity: 0.4; cursor: not-allowed; font-style: italic; }
        .stat-row.locked .stat-dice { background: #888; }
        .stat-name { font-weight: bold; font-size: 15px; }
        .stat-dice {
            background-color: #000; color: #fff; padding: 2px 8px;
            font-weight: bold; border-radius: 3px; font-family: monospace; white-space: nowrap;
        }
        .stat-dice.arkan { background: #5c2d91; }
        .derived-grid {
            display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px;
            padding: 10px; background: #f9f9f9;
        }
        .derived-item { text-align: center; }
        .derived-item .label { font-size: 12px; font-weight: bold; text-transform: uppercase; }
        .derived-item .value { font-size: 24px; font-weight: bold; }
        table { width: 100%; border-collapse: collapse; }
        th { text-align: left; border-bottom: 2px solid #000; padding: 5px; }
        td { padding: 5px; border-bottom: 1px dotted #999; }
        .weapon-row { cursor: pointer; transition: background 0.1s; }
        .weapon-row:hover { background-color: #ffe4e1; }
        .power-box {
            display: flex; justify-content: space-between; padding: 8px;
            background: #eee; border-left: 4px solid #000; margin-bottom: 5px;
        }

        /* KAMPF */
        .combat-empty { text-align: center; padding: 60px 20px; color: #888; font-size: 16px; }
        .gm-btn {
            padding: 8px 16px; background: #000; color: #fff;
            border: 2px solid #000; font-weight: bold; text-transform: uppercase;
            letter-spacing: 1px; cursor: pointer; margin-left: 8px;
        }
        .gm-btn:hover { background: #2e7d32; border-color: #2e7d32; }
        .gm-btn.danger:hover { background: #b00020; border-color: #b00020; }
        .combat-header {
            display: flex; align-items: center; justify-content: space-between;
            margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid #000;
        }
        .combat-round { font-size: 22px; font-weight: bold; text-transform: uppercase; letter-spacing: 2px; }
        .combat-table { font-size: 15px; }
        .combat-table th {
            background: #000; color: #fff; padding: 8px;
            text-transform: uppercase; font-size: 12px; letter-spacing: 1px;
        }
        .combat-table td { padding: 10px 8px; border-bottom: 1px solid #ddd; }
        .combat-table tr.current { background: #fff3b0; font-weight: bold; box-shadow: inset 4px 0 0 #000; }
        .combat-table tr.current td:first-child { padding-left: 12px; }
        .combat-table tr.acted td { opacity: 0.45; }
        .combat-table td.card {
            font-family: monospace; font-weight: bold; font-size: 16px;
            text-align: center; width: 90px;
        }
        .combat-table td.card.joker { background: #000; color: #ffd700; text-shadow: 0 0 4px #ffd700; }
        .combat-table td.typ { text-transform: uppercase; font-size: 11px; color: #666; letter-spacing: 1px; text-align: center; }
        .combat-table td.cond { font-size: 13px; color: #444; }
        .current-marker {
            display: inline-block; width: 10px; height: 10px;
            background: #000; border-radius: 50%; margin-right: 6px;
        }
        .combat-table tr.current .current-marker { background: #b00020; }

        /* AKTIONSPANEL */
        .action-panel {
            margin-top: 24px; border: 2px solid #000; background: #f9f9f9;
        }
        .action-panel-header {
            background: #000; color: #fff; padding: 8px 12px;
            font-weight: bold; text-transform: uppercase; letter-spacing: 1px; font-size: 13px;
        }
        .action-panel-body { padding: 16px; }
        .action-panel-row {
            display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px;
        }
        .action-panel-row:last-child { margin-bottom: 0; }
        .ap-field { display: flex; flex-direction: column; gap: 4px; }
        .ap-field label {
            font-size: 11px; font-weight: bold; text-transform: uppercase;
            letter-spacing: 0.5px; color: #555;
        }
        .ap-field select, .ap-field input {
            padding: 6px 8px; font-size: 14px;
            border: 1px solid #000; background: #fff; font-family: inherit;
        }
        .ap-field.wide select { min-width: 220px; }
        .ap-field.small input { width: 70px; font-family: monospace; }
        .ap-btn {
            padding: 8px 18px; font-size: 14px; font-weight: bold;
            background: #000; color: #fff; border: 2px solid #000;
            cursor: pointer; text-transform: uppercase; letter-spacing: 1px;
        }
        .ap-btn:hover { background: #2e7d32; border-color: #2e7d32; }
        .ap-hint { font-size: 12px; color: #666; font-style: italic; margin-top: 4px; }
        .joker-banner {
            background: #000; color: #ffd700; padding: 6px 12px;
            font-weight: bold; text-align: center; letter-spacing: 1px;
            border-bottom: 2px solid #ffd700;
        }
        .info-panel {
            margin-top: 24px; border: 2px solid #b8860b; background: #fff8e6;
        }
        .info-panel.downed { border-color: #b00020; background: #fff0f0; }
        .info-panel-header {
            color: #fff; padding: 8px 12px;
            font-weight: bold; text-transform: uppercase; letter-spacing: 1px; font-size: 13px;
        }
        .info-panel.shaken .info-panel-header { background: #b8860b; }
        .info-panel.downed .info-panel-header { background: #b00020; }
        .info-panel-body { padding: 16px; }
        .info-panel-body p { margin: 0 0 12px 0; font-size: 14px; }
        .info-panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }
        .info-panel-actions button {
            padding: 8px 18px; font-size: 14px; font-weight: bold;
            border: 2px solid #000; cursor: pointer;
        }
        .info-panel-actions .primary { background: #000; color: #fff; }
        .info-panel-actions .primary:hover { background: #2e7d32; border-color: #2e7d32; }
        .info-panel-actions .secondary { background: #fff; color: #000; }
        .info-panel-actions .secondary:hover { background: #ddd; }

        /* PENDING DAMAGE */
        .pending-section {
            margin-top: 24px;
            border: 2px solid #b00020;
        }
        .pending-section-header {
            background: #b00020; color: #fff; padding: 8px 12px;
            font-weight: bold; text-transform: uppercase; letter-spacing: 1px; font-size: 13px;
        }
        .damage-card {
            padding: 14px;
            border-bottom: 1px solid #eee;
            background: #fff8f8;
        }
        .damage-card:last-child { border-bottom: none; }
        .damage-info { font-size: 14px; line-height: 1.5; margin-bottom: 10px; }
        .damage-info strong { color: #b00020; }
        .damage-detail { font-size: 12px; color: #666; font-style: italic; margin-top: 4px; }
        .damage-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
        .damage-actions button {
            padding: 6px 14px; font-size: 13px; font-weight: bold;
            border: 2px solid #000; cursor: pointer; background: #fff; color: #000;
        }
        .soak-btn { background: #ffd700; border-color: #b8860b; }
        .soak-btn:hover { background: #ffed4e; }
        .apply-btn { background: #b00020; color: #fff; }
        .apply-btn:hover { background: #d10026; }
        .cancel-btn { background: #fff; color: #000; border-color: #666; }
        .cancel-btn:hover { background: #ddd; }

                /* GM NSC PANEL */
        .gm-nsc-panel {
            margin-top: 24px; border: 2px solid #000; background: #fff;
        }
        .gm-nsc-panel-header {
            background: #333; color: #fff; padding: 8px 12px;
            font-weight: bold; text-transform: uppercase; letter-spacing: 1px; font-size: 13px;
        }
        .gm-nsc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
        .gm-nsc-table th { background: #eee; padding: 6px; text-align: left; border-bottom: 2px solid #000; }
        .gm-nsc-table td { padding: 6px; border-bottom: 1px solid #ddd; }
        .gm-nsc-actions { display: flex; gap: 4px; }
        .gm-nsc-actions button { padding: 4px 8px; font-size: 11px; font-weight: bold; cursor: pointer; border: 1px solid #000; }
        .gm-nsc-actions .add { background: #2e7d32; color: #fff; }
        .gm-nsc-actions .remove { background: #b00020; color: #fff; }
        .gm-nsc-actions .delete { background: #fff; color: #b00020; }
                .gm-nsc-actions .preselect { background: #fff; color: #1a5fbf; border-color: #1a5fbf; }
        .gm-nsc-actions .preselect.active { background: #1a5fbf; color: #fff; }
        .gm-create-form { padding: 12px; background: #f9f9f9; display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; border-top: 1px solid #ccc; }
        .gm-create-form .ap-field { margin-bottom: 0; }
        .gm-create-form label { font-size: 11px; font-weight: bold; text-transform: uppercase; color: #555; }
        .gm-create-form input[type="text"], .gm-create-form input[type="number"] { padding: 4px 6px; font-size: 13px; border: 1px solid #000; }

        /* MONSTERJAGD */
        .mj-container { padding: 20px; }
        .mj-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #000; padding-bottom: 12px; margin-bottom: 20px; }
        .mj-title { font-size: 24px; font-weight: bold; text-transform: uppercase; letter-spacing: 2px; }
        .mj-status-box { display: flex; gap: 20px; background: #000; color: #fff; padding: 12px; margin-bottom: 20px; }
        .mj-status-item { display: flex; flex-direction: column; align-items: center; }
        .mj-status-label { font-size: 11px; text-transform: uppercase; color: #aaa; }
        .mj-status-value { font-size: 20px; font-weight: bold; font-family: monospace; }
        .mj-roll-area { text-align: center; margin: 30px 0; }
        .mj-roll-btn { padding: 12px 32px; font-size: 18px; background: #5c2d91; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; text-transform: uppercase; }
        .mj-roll-btn:hover { background: #7b3dbf; }
        .mj-result-box { background: #f9f9f9; border: 2px solid #000; padding: 16px; margin-top: 20px; white-space: pre-wrap; font-family: monospace; font-size: 14px; }
        .mj-gm-controls { background: #eee; padding: 16px; border: 2px solid #333; margin-bottom: 20px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
        .mj-gm-controls button { padding: 6px 12px; font-weight: bold; cursor: pointer; border: 1px solid #000; }
        /* MODAL */
        .modal-overlay {
            position: fixed; inset: 0; background: rgba(0,0,0,0.55);
            display: none; align-items: center; justify-content: center; z-index: 1000;
        }
        .modal-overlay.active { display: flex; }
        .modal-box {
            background: #fff; border: 2px solid #000;
            box-shadow: 0 8px 24px rgba(0,0,0,0.4);
            min-width: 360px; max-width: 480px;
        }
        .modal-title {
            background: #000; color: #fff; padding: 10px 14px;
            font-weight: bold; font-size: 14px; text-transform: uppercase; letter-spacing: 1px;
        }
        .modal-fields { padding: 16px; }
        .modal-field { display: flex; flex-direction: column; margin-bottom: 12px; }
        .modal-field label { font-size: 12px; font-weight: bold; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
        .modal-field input { padding: 8px; font-size: 16px; border: 1px solid #000; font-family: monospace; }
        .modal-field input:focus { outline: 2px solid #000; outline-offset: 0; }
        .modal-hint { font-size: 11px; color: #888; margin-top: 2px; font-style: italic; }
        .modal-buttons { display: flex; gap: 8px; justify-content: flex-end; padding: 0 16px 16px 16px; }
        .modal-buttons button {
            padding: 8px 20px; font-size: 13px; font-weight: bold;
            border: 2px solid #000; cursor: pointer; background: #fff; color: #000;
        }
        .modal-buttons button#modal-ok { background: #000; color: #fff; }
        .modal-buttons button:hover { background: #333; color: #fff; }
        .modal-buttons button#modal-ok:hover { background: #2e7d32; border-color: #2e7d32; }
        /* Beschwoerungs-Dialog: lange Kreatur-Listen scrollen, Titel und Buttons
           bleiben immer sichtbar. Bewusst nur #power-modal, damit
           #modifier-modal und #konfig-modal unveraendert bleiben. */
        #power-modal .modal-box,
        #talent-modal .modal-box {
            max-height: 90vh;
            display: flex;
            flex-direction: column;
        }
        #power-modal .modal-fields,
        #talent-modal .modal-fields {
            flex: 1 1 auto;
            min-height: 0;      /* Pflicht: ohne das greift overflow-y in Flex-Kindern nicht */
            overflow-y: auto;
        }
        #power-modal .modal-title,
        #power-modal .modal-buttons,
        #talent-modal .modal-title,
        #talent-modal .modal-buttons { flex: 0 0 auto; }
        /* Attribut-/Fertigkeits-Eingabe: Wuerfel-Buttons + Bonusfeld.
           Ersetzt die Textfelder, die bei jedem Tastendruck den Fokus
           verloren haben (Feinschliff 5). */
        /* .editor-field steht weiter unten im Stylesheet und setzt
           flex-direction: column — daher hier höhere Spezifität. */
        .editor-field.die-row {
            display: flex; flex-direction: row; align-items: center;
            gap: 6px; flex-wrap: wrap;
        }
        .die-btn {
            min-width: 40px; padding: 5px 6px; font-family: monospace; font-size: 13px;
            font-weight: bold; border: 2px solid #000; background: #fff; color: #000; cursor: pointer;
        }
        .die-btn:hover { background: #eee; }
        .die-btn.active { background: #000; color: #fff; }
        .editor-field .die-bonus {
            width: 58px; padding: 5px 6px; font-family: monospace; font-size: 13px;
            border: 2px solid #000; text-align: center;
        }
        .die-derived { font-size: 11px; color: #5c2d91; font-style: italic; }
        .die-derived.none { color: #aaa; }
        /* v3.6: fester Bonus neben Fertigkeit/Attribut (Vorbild: Savaged.us-Bogen) */
        .stat-bonus {
            font-family: monospace; font-size: 12px; font-weight: bold; color: #5c2d91;
            margin-left: auto; margin-right: 6px;
        }
        /* SC-B: Talent, dessen Voraussetzungen nicht erfuellt sind */
        .picker-item.unerfuellt { opacity: 0.42; }
        .picker-item.unerfuellt .picker-item-name { text-decoration: line-through; }
                /* NSC-EDITOR */
        .editor-container { padding: 20px; }
        .editor-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #000; padding-bottom: 12px; margin-bottom: 20px; }
        .editor-title { font-size: 22px; font-weight: bold; text-transform: uppercase; letter-spacing: 2px; }
        .editor-steps { display: flex; gap: 4px; margin-bottom: 20px; flex-wrap: wrap; }
        .editor-step-dot { padding: 4px 10px; font-size: 11px; font-weight: bold; background: #eee; border: 1px solid #999; border-radius: 3px; color: #666; cursor: pointer; user-select: none; }
        .editor-step-dot:hover { background: #ddd; }
        .editor-step-dot.active { background: #000; color: #fff; border-color: #000; }
        .editor-step-dot.active:hover { background: #333; }
        .editor-step-dot.done { background: #2e7d32; color: #fff; border-color: #2e7d32; }
        .editor-step-dot.done:hover { background: #1b5e20; }
        .editor-section { border: 2px solid #000; margin-bottom: 16px; }
        .editor-section-title { background: #000; color: #fff; padding: 6px 12px; font-weight: bold; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
        .editor-section-body { padding: 14px; }
        .editor-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
        .editor-field { display: flex; flex-direction: column; gap: 4px; }
        .editor-field label { font-size: 11px; font-weight: bold; text-transform: uppercase; color: #555; letter-spacing: 0.5px; }
        .editor-field input, .editor-field select { padding: 6px 8px; font-size: 14px; border: 1px solid #000; background: #fff; font-family: inherit; }
        .editor-field input[type="number"] { width: 70px; font-family: monospace; }
        .editor-field input.dice-input { width: 80px; font-family: monospace; }
        .editor-field .hint { font-size: 11px; color: #888; font-style: italic; }
        .editor-btn { padding: 8px 16px; font-size: 13px; font-weight: bold; background: #000; color: #fff; border: 2px solid #000; cursor: pointer; text-transform: uppercase; letter-spacing: 1px; }
        .editor-btn:hover { background: #2e7d32; border-color: #2e7d32; }
        .editor-btn.secondary { background: #fff; color: #000; }
        .editor-btn.secondary:hover { background: #ddd; }
        .editor-btn.danger { background: #b00020; border-color: #b00020; color: #fff; }
        .editor-btn.danger:hover { background: #d10026; }
        .editor-nav { display: flex; justify-content: space-between; margin-top: 20px; padding-top: 16px; border-top: 2px solid #000; }
        .editor-list { display: flex; flex-direction: column; gap: 6px; }
        .editor-list-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: #f9f9f9; border: 1px solid #ccc; }
        .editor-list-item.selected { border-color: #2e7d32; background: #e8f5e9; }
        .editor-list-item .name { font-weight: bold; }
        .editor-list-item .meta { font-size: 12px; color: #666; }
        .editor-list-item .actions { display: flex; gap: 4px; }
        .editor-list-item .actions button { padding: 3px 8px; font-size: 11px; font-weight: bold; cursor: pointer; border: 1px solid #000; background: #fff; }
        .editor-list-item .actions button:hover { background: #333; color: #fff; }
        .editor-rasse-bonus { color: #1a5fbf; font-weight: bold; }
        .editor-warn { padding: 8px 12px; background: #fff8e6; border: 1px solid #b8860b; font-size: 13px; margin-bottom: 12px; }
        .editor-checkbox-grid { display: flex; flex-wrap: wrap; gap: 6px; }
        .editor-chip { padding: 5px 12px; font-size: 13px; border: 1px solid #000; background: #fff; cursor: pointer; border-radius: 4px; }
        .editor-chip.selected { background: #2e7d32; color: #fff; border-color: #2e7d32; }
        .editor-chip:hover { background: #eee; }
        .editor-chip.selected:hover { background: #1b5e20; }
                /* PICKER */
        .picker-search { width: 100%; padding: 8px 10px; font-size: 14px; border: 1px solid #000; margin-bottom: 12px; font-family: inherit; }
        .picker-selected { background: #e8f5e9; border: 1px solid #2e7d32; padding: 8px 12px; margin-bottom: 12px; border-radius: 4px; }
        .picker-selected-label { font-size: 12px; font-weight: bold; color: #1b5e20; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
        .picker-selected-list { display: flex; flex-wrap: wrap; gap: 6px; }
        .picker-selected-chip { display: inline-flex; align-items: center; gap: 6px; background: #2e7d32; color: #fff; padding: 4px 8px; border-radius: 3px; font-size: 13px; }
        .picker-selected-chip button { background: transparent; color: #fff; border: none; cursor: pointer; font-weight: bold; padding: 0 2px; font-size: 14px; }
        .picker-selected-chip button:hover { color: #ffcccc; }
        .picker-group { margin-bottom: 12px; }
        .picker-group-title { background: #333; color: #fff; padding: 4px 10px; font-size: 12px; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
        .picker-group-body { display: flex; flex-direction: column; gap: 2px; }
        .picker-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid #ccc; background: #fff; cursor: pointer; font-size: 13px; }
        .picker-item:hover { background: #f0f8ff; }
        .picker-item.selected { background: #e8f5e9; border-color: #2e7d32; }
        .picker-item input[type="checkbox"] { margin: 0; flex-shrink: 0; }
        .picker-item-name { font-weight: bold; flex-shrink: 0; }
        .picker-item-zusatz { color: #1a5fbf; font-size: 12px; flex-shrink: 0; }
        .picker-item-kurztext { color: #666; font-size: 12px; font-style: italic; margin-left: auto; text-align: right; }
                /* TALENTE & HANDICAPS IM BOGEN */
        .talent-group { margin-bottom: 8px; }
        .talent-group-title {
            font-size: 11px; font-weight: bold; text-transform: uppercase;
            color: #555; border-bottom: 1px solid #ccc; padding-bottom: 2px; margin-bottom: 4px;
            letter-spacing: 0.5px;
        }
        .talent-box {
            padding: 4px 8px; margin-bottom: 3px;
            background: #f9f9f9; border-left: 3px solid #5c2d91;
        }
        .talent-box .talent-head { display: flex; justify-content: space-between; align-items: baseline; }
        .talent-box .talent-meta { font-size: 11px; color: #666; font-style: italic; }
        .talent-box .talent-text { font-size: 12px; color: #555; margin-top: 2px; line-height: 1.3; }
        .handicap-box {
            padding: 4px 8px; margin-bottom: 3px;
            background: #fff8f8; border-left: 3px solid #b00020;
        }
        .handicap-box .handicap-head { display: flex; justify-content: space-between; align-items: baseline; }
        .handicap-box .handicap-text { font-size: 12px; color: #555; margin-top: 2px; line-height: 1.3; }
        .handicap-badge {
            display: inline-block; padding: 1px 6px; border-radius: 8px;
            font-size: 10px; font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px;
        }
        .handicap-badge.leicht { background: #ffd700; color: #000; }
        .handicap-badge.schwer { background: #b00020; color: #fff; }

        /* ============================================================
           GM-BEREICH (Phase 1) — Session-Tab
           ============================================================ */
        .gm-session-head {
            display: flex; align-items: flex-start; justify-content: space-between;
            gap: 16px; padding-bottom: 12px; margin-bottom: 16px;
            border-bottom: 2px solid #000;
        }
        .gm-session-head h2 { margin: 0; font-size: 20px; text-transform: uppercase; letter-spacing: 1px; }
        .gm-session-hint { font-size: 12px; color: #666; font-style: italic; margin-top: 2px; }
        .session-empty { text-align: center; padding: 60px 20px; color: #888; }
        .gm-player-list { display: flex; flex-direction: column; gap: 12px; }
        .gm-player-row {
            display: grid; grid-template-columns: 220px minmax(0, 1fr);
            gap: 12px 18px; padding: 12px;
            border: 2px solid #000; background: #fafafa;
        }
        .gm-player-ident { display: flex; align-items: center; gap: 10px; }
        .gm-portrait {
            width: 56px; height: 56px; flex: 0 0 56px;
            border: 2px solid #000; background: #ddd;
            display: flex; align-items: center; justify-content: center;
            font-size: 22px; font-weight: bold; color: #555; overflow: hidden;
        }
        .gm-portrait img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
        /* v5.1: Profilfoto im SC-Editor (gleiche Groesse wie im Bogen). */
        .sc-portrait-editor { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
        .sc-portrait-preview {
            width: 150px; height: 150px; flex: 0 0 150px;
            border: 2px solid #000; background: #f2f2f2;
            display: flex; align-items: center; justify-content: center;
            color: #888; font-size: 12px; overflow: hidden;
        }
        .sc-portrait-preview img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
        .sc-portrait-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
        .gm-player-name { display: flex; flex-direction: column; }
        .gm-player-name strong { font-size: 16px; }
        .gm-player-sub { font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: 0.5px; }
        .gm-player-stats { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
        .gm-stat { display: flex; flex-direction: column; gap: 2px; }
        .gm-stat-label { font-size: 10px; font-weight: bold; text-transform: uppercase; color: #555; letter-spacing: 0.5px; }
        .gm-stat-controls { display: flex; align-items: stretch; border: 2px solid #000; background: #fff; }
        .gm-stat-value { min-width: 34px; text-align: center; font-size: 16px; font-weight: bold; padding: 2px 4px; }
        .gm-step {
            width: 28px; border: none; background: #eee; font-size: 16px; font-weight: bold;
            cursor: pointer; color: #000; line-height: 1;
        }
        .gm-step:first-child { border-right: 1px solid #000; }
        .gm-step:last-child { border-left: 1px solid #000; }
        .gm-step:hover { background: #000; color: #fff; }
        .gm-player-zustaende {
            grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 5px;
            padding-top: 6px; border-top: 1px dashed #bbb;
        }
        .gm-chip {
            padding: 3px 9px; font-size: 11px; font-weight: bold; cursor: pointer;
            border: 1px solid #999; background: #fff; color: #777; border-radius: 12px;
            text-transform: uppercase; letter-spacing: 0.3px;
        }
        .gm-chip:hover { border-color: #000; color: #000; }
        .gm-chip.aktiv { background: #b00020; border-color: #b00020; color: #fff; }

        /* GM-Tab (Gerüst Phase 2) */
        .gm-tab-head { padding-bottom: 12px; margin-bottom: 16px; border-bottom: 2px solid #000; }
        .gm-tab-head h2 { margin: 0; font-size: 20px; text-transform: uppercase; letter-spacing: 1px; }
        .gm-skeleton { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
        .gm-skeleton-card { border: 2px dashed #999; padding: 12px; background: #f4f4f4; }
        .gm-skeleton-card h3 { margin: 0 0 6px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; }
        .gm-skeleton-card p { margin: 0; font-size: 12px; color: #555; line-height: 1.4; }
        .gm-skeleton-card code { background: #e0e0e0; padding: 0 3px; }

        @media (max-width: 700px) {
            .gm-player-row { grid-template-columns: 1fr; }
        }

        /* ============================================================
           GM-BEREICH Phase 2 — Session-NSC, Ziel, Notizen
           ============================================================ */
        .ziel-badge {
            margin: 10px 20px 0 20px; padding: 4px 10px; align-items: center; gap: 4px;
            background: #fff3cd; border: 2px solid #b8860b; color: #5a4300;
            font-size: 13px; font-weight: bold;
            display: inline-flex; flex-wrap: wrap;
        }
        .ziel-typ, .gm-chip-typ {
            font-size: 10px; font-weight: bold; text-transform: uppercase;
            letter-spacing: 0.5px; padding: 1px 5px; border-radius: 8px;
            background: #000; color: #fff;
        }

        .session-section {
            margin-top: 24px; padding-top: 12px; border-top: 2px solid #000;
        }
        .session-section-title {
            font-size: 14px; font-weight: bold; text-transform: uppercase;
            letter-spacing: 1px; margin-bottom: 8px;
            display: flex; align-items: baseline; gap: 8px;
        }
        .session-count { font-size: 11px; color: #666; text-transform: none; letter-spacing: 0; }
        .session-pool {
            display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 4px 12px;
        }
        .session-pool-row {
            display: flex; align-items: center; gap: 6px;
            padding: 3px 6px; font-size: 13px; cursor: pointer;
            border: 1px solid transparent;
        }
        .session-pool-row:hover { background: #f2f2f2; border-color: #ccc; }
        .session-pool-row.drin { background: #eef7ee; border-color: #2e7d32; }
        .session-pool-typ { font-size: 10px; color: #666; text-transform: uppercase; }
        .session-notes {
            width: 100%; padding: 8px; font-size: 13px; font-family: inherit;
            border: 2px solid #000; resize: vertical;
        }
        .session-notes-actions { margin-top: 6px; text-align: right; }
        .session-empty-small { font-size: 12px; color: #777; font-style: italic; }

        .gm-target-box {
            display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
            padding: 12px; margin-bottom: 20px;
            border: 2px solid #b8860b; background: #fff8e6;
        }
        .gm-target-label {
            font-size: 11px; font-weight: bold; text-transform: uppercase;
            letter-spacing: 0.5px; color: #7a5c00;
        }
        .gm-target-value { font-size: 18px; }
        .gm-target-leer { font-size: 13px; color: #777; font-style: italic; }
        .gm-section { margin-bottom: 20px; padding-top: 12px; border-top: 2px solid #000; }
        .gm-section-title {
            font-size: 14px; font-weight: bold; text-transform: uppercase;
            letter-spacing: 1px; margin-bottom: 8px;
        }
        .gm-ziel-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
        .gm-ziel-chip { font-size: 13px; padding: 5px 12px; display: inline-flex; align-items: center; gap: 6px; }
        .modal-field select {
            padding: 8px; font-size: 15px; border: 1px solid #000;
            font-family: inherit; background: #fff;
        }
        .modal-field select:focus { outline: 2px solid #000; outline-offset: 0; }

        /* ============================================================
           GM-BEREICH Phase 2b — NSC-Aktionen im Kampf
           ============================================================ */
        .nsc-action-form {
            display: flex; flex-wrap: wrap; gap: 8px 14px;
            padding: 10px 12px; align-items: flex-end;
            border-top: 1px solid #ccc;
        }
        .nsc-action-form select, .nsc-action-form input[type="number"] {
            padding: 4px 6px; font-size: 13px; border: 1px solid #000;
            font-family: inherit; background: #fff;
        }
        .nsc-action-form .ap-field label {
            display: block; font-size: 10px; font-weight: bold;
            text-transform: uppercase; color: #555; margin-bottom: 2px;
        }
        .nsc-checks { display: flex; flex-direction: row; gap: 12px; align-items: center; padding-bottom: 4px; }
        .nsc-checks label {
            display: flex; align-items: center; gap: 4px;
            text-transform: none; font-size: 12px; color: #222;
        }
        .nsc-action-group {
            display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
            padding: 8px 12px; border-top: 1px dashed #bbb;
        }
        .nsc-action-label {
            font-size: 10px; font-weight: bold; text-transform: uppercase;
            color: #555; letter-spacing: 0.5px; margin-right: 4px;
        }
        .nsc-action-leer { font-size: 12px; color: #888; font-style: italic; }
        .nsc-action-status { padding: 4px 12px 8px; font-size: 12px; color: #b00020; font-weight: bold; }
        .nsc-power-btn { padding: 3px 9px; font-size: 12px; margin-left: 0; }

        /* Monsterjagd im GM-Tab */
        .gm-mj-box { border: 2px solid #000; padding: 10px 12px; background: #fafafa; }
        .gm-mj-status { font-size: 14px; margin-bottom: 8px; }
        .gm-mj-actions { display: flex; gap: 6px; flex-wrap: wrap; }
        .gm-mj-actions .gm-btn { margin-left: 0; padding: 5px 10px; font-size: 12px; }

        /* Etappe 18/19: DA + Schlacht im GM-Tab */
        .gm-da-teilnehmer { font-size: 12px; color: #555; margin-bottom: 8px; }
        .gm-da-komp { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-top: 8px; }
        .gm-schlacht-partei {
            display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
            padding: 6px 0; border-bottom: 1px dashed #ccc; font-size: 13px;
        }

        /* Action-Tab (laufende Aktionen) */
        .action-block {
            border: 2px solid #000; background: #fff;
            padding: 14px 16px; margin-bottom: 16px;
        }
        .action-title {
            font-size: 16px; font-weight: bold; text-transform: uppercase;
            letter-spacing: 1px; margin-bottom: 6px;
        }
        .action-sub { font-size: 12px; color: #555; margin-bottom: 8px; }
        .action-progress {
            position: relative; height: 24px; border: 2px solid #000;
            background: #eee; margin: 8px 0 10px;
        }
        .action-progress-bar { height: 100%; background: #2e7d32; }
        .action-progress-text {
            position: absolute; inset: 0; display: flex; align-items: center;
            justify-content: center; font-size: 12px; font-weight: bold;
        }
        .action-log { margin-top: 8px; border-top: 1px dashed #ccc; padding-top: 6px; }
        .action-log-row { font-size: 12px; color: #444; padding: 2px 0; }
        .action-battle-row {
            display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
            padding: 6px 0; border-bottom: 1px dashed #ccc; font-size: 13px;
        }
        .ab-name { min-width: 160px; font-weight: bold; }
        .ab-tag {
            font-size: 10px; background: #000; color: #fff; padding: 1px 6px;
            border-radius: 8px; text-transform: uppercase;
        }
        .ab-stat { font-size: 12px; color: #444; }
        .action-choice {
            margin-top: 8px; padding: 8px; border: 2px dashed #b8860b;
            background: #fff8e6; font-size: 13px;
        }
        .gm-inline-field {
            display: inline-flex; align-items: center; gap: 4px;
            font-size: 11px; font-weight: bold; text-transform: uppercase; color: #555;
        }
        .gm-inline-field input { padding: 4px 6px; font-size: 13px; border: 1px solid #000; }
