body{
    font-family: Arial;
    background:#f4f4f4;
    padding:30px;
}

.container{
    max-width:900px;
    margin:auto;
    background:white;
    padding:30px;
    border-radius:10px;
}

input,
textarea{
    width:100%;
    padding:12px;
    margin-top:10px;
    margin-bottom:15px;
}

button{
    background:#007bc0;
    color:white;
    border:none;
    padding:12px 20px;
    cursor:pointer;
}

.chat-box{
    background:#fafafa;
    padding:15px;
    margin-bottom:10px;
}

.answer{
    color:green;
}

table{
    width:100%;
    border-collapse:collapse;
}

th,td{
    border:1px solid #ccc;
    padding:10px;
}

*{
    box-sizing:border-box;
}

button:disabled{
    opacity:0.65;
    cursor:not-allowed;
}

.processing-status{
    margin-top:14px;
    padding:12px 14px;
    background:#eef4ff;
    border-radius:6px;
    font-size:14px;
}

.spinner{
    display:inline-block;
    width:14px;
    height:14px;
    margin-right:8px;
    border:2px solid #bbb;
    border-top-color:#333;
    border-radius:50%;
    vertical-align:-2px;
    animation:spin 0.8s linear infinite;
}

@keyframes spin{
    to{ transform:rotate(360deg); }
}

.form-error{
    background:#ffe5e5;
    color:#a00000;
    padding:12px;
    margin-bottom:15px;
    border-radius:6px;
}

.log-meta{
    color:#666;
    font-size:12px;
}

@media (max-width:700px){
    body{
        padding:12px;
    }

    .container{
        padding:18px;
    }

    button{
        width:100%;
    }
}

/* =========================================================
   Participant UI - Question Round
   ========================================================= */

:root{
    --surface:#ffffff;
    --surface-soft:#f7f9fb;
    --surface-blue:#eef6fb;
    --border:#d9e1e8;
    --border-strong:#b8c5d0;
    --text:#1f2933;
    --muted:#66737f;
    --bosch-blue:#007bc0;
    --bosch-blue-dark:#005a8c;
    --success:#18864b;
    --success-soft:#eaf7ef;
    --warning:#a86300;
    --warning-soft:#fff4df;
    --danger:#b42318;
    --shadow:0 8px 26px rgba(25, 47, 68, 0.08);
}

body.participant-page{
    margin:0;
    padding:32px 18px 48px;
    background:#f2f5f7;
    color:var(--text);
}

.participant-shell{
    width:min(1040px, 100%);
    margin:0 auto;
}

.game-header{
    display:flex;
    justify-content:space-between;
    gap:28px;
    align-items:flex-start;
    margin-bottom:18px;
}

.game-header h1{
    margin:4px 0 6px;
    font-size:clamp(30px, 4vw, 46px);
    line-height:1.05;
}

.eyebrow,
.section-kicker{
    font-size:12px;
    font-weight:700;
    letter-spacing:.08em;
    text-transform:uppercase;
    color:var(--bosch-blue-dark);
}

.page-subtitle{
    max-width:680px;
    margin:0;
    color:var(--muted);
    font-size:16px;
    line-height:1.55;
}

.question-counter-card{
    flex:0 0 132px;
    padding:16px;
    text-align:center;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:14px;
    box-shadow:var(--shadow);
}

.question-counter-number{
    font-size:34px;
    font-weight:800;
    line-height:1;
    color:var(--bosch-blue);
}

.question-counter-label{
    margin-top:5px;
    font-size:13px;
    font-weight:700;
}

.question-counter-total{
    margin-top:2px;
    color:var(--muted);
    font-size:12px;
}

.progress-track{
    height:8px;
    overflow:hidden;
    background:#dce5eb;
    border-radius:999px;
    margin-bottom:22px;
}

.progress-fill{
    height:100%;
    min-width:0;
    background:var(--bosch-blue);
    border-radius:inherit;
    transition:width .25s ease;
}

.scenario-card,
.rules-card,
.investigation-panel,
.history-section,
.game-footer{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:14px;
    box-shadow:var(--shadow);
}

.scenario-card{
    display:flex;
    gap:14px;
    padding:18px 20px;
    margin-bottom:14px;
    border-left:4px solid var(--bosch-blue);
}

.scenario-icon{
    font-size:22px;
    line-height:1.2;
}

.scenario-card p{
    margin:5px 0 0;
    line-height:1.55;
}

.rules-card{
    margin-bottom:18px;
    overflow:hidden;
}

.rules-card summary{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    padding:15px 18px;
    cursor:pointer;
    font-weight:700;
}

.rules-card summary:hover{
    background:var(--surface-soft);
}

.rules-hint{
    color:var(--muted);
    font-size:12px;
    font-weight:500;
}

.rules-list{
    margin:0;
    padding:0 28px 18px 42px;
}

.rules-list li{
    margin:8px 0;
    line-height:1.45;
}

.investigation-panel,
.history-section{
    padding:22px;
    margin-bottom:18px;
}

.panel-heading{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:20px;
    margin-bottom:16px;
}

.panel-heading h2,
.game-footer h2{
    margin:4px 0 0;
    font-size:22px;
}

.question-composer{
    margin:0;
}

.composer-row{
    display:grid;
    grid-template-columns:minmax(0, 1fr) auto;
    align-items:stretch;
    gap:10px;
}

.question-composer input[type="text"]{
    width:100%;
    margin:0;
    min-height:48px;
    border:1px solid var(--border-strong);
    border-radius:9px;
    padding:12px 14px;
    font-size:16px;
    background:#fff;
}

.question-composer input[type="text"]:focus{
    outline:3px solid rgba(0,123,192,.14);
    border-color:var(--bosch-blue);
}

.primary-action,
.secondary-action{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:48px;
    border-radius:9px;
    font-weight:700;
    text-decoration:none;
    transition:transform .1s ease, box-shadow .1s ease, background .1s ease;
}

.primary-action{
    min-width:110px;
    margin:0;
    background:var(--bosch-blue);
}

.primary-action:hover:not(:disabled){
    background:var(--bosch-blue-dark);
}

.secondary-action{
    padding:0 18px;
    color:#fff;
    background:var(--bosch-blue);
}

.secondary-action:hover{
    background:var(--bosch-blue-dark);
    color:#fff;
}

.primary-action:active:not(:disabled),
.secondary-action:active{
    transform:translateY(1px);
}

.composer-help{
    display:flex;
    justify-content:space-between;
    gap:20px;
    margin-top:9px;
    color:var(--muted);
    font-size:12px;
}

.status-chip{
    display:inline-flex;
    align-items:center;
    min-height:24px;
    padding:3px 9px;
    border-radius:999px;
    font-size:11px;
    font-weight:700;
    white-space:nowrap;
}

.status-chip-open,
.status-chip-valid{
    background:var(--success-soft);
    color:var(--success);
}

.status-chip-warning{
    background:var(--warning-soft);
    color:var(--warning);
}

.status-chip-neutral{
    background:#eef1f4;
    color:#5c6670;
}

.status-chip-analysis{
    background:#e9f2ff;
    color:#245b9b;
}

.processing-status{
    display:flex;
    align-items:center;
    gap:10px;
    margin-top:13px;
    padding:12px 14px;
    background:var(--surface-blue);
    border:1px solid #d1e6f3;
    border-radius:9px;
}

.processing-status[hidden]{
    display:none;
}

.processing-status div{
    display:flex;
    flex-direction:column;
    gap:2px;
}

.processing-status span:not(.spinner){
    color:var(--muted);
    font-size:12px;
}

.history-heading{
    align-items:center;
}

.history-count{
    color:var(--muted);
    font-size:13px;
}

.timeline{
    display:flex;
    flex-direction:column;
    gap:14px;
}

.evidence-card{
    padding:17px;
    border:1px solid var(--border);
    border-radius:12px;
    background:#fff;
}

.evidence-counted{
    border-left:4px solid var(--bosch-blue);
}

.evidence-not-counted{
    border-left:4px solid #9aa5ad;
    background:#fafbfc;
}

.evidence-topline{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    margin-bottom:14px;
}

.question-label{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
}

.question-number{
    font-weight:800;
    color:var(--bosch-blue-dark);
}

.question-number-muted{
    color:var(--muted);
}

.evidence-time{
    color:var(--muted);
    font-size:11px;
    white-space:nowrap;
}

.user-question,
.ai-answer{
    padding:12px 14px;
    border-radius:10px;
}

.user-question{
    margin-bottom:9px;
    background:#f0f3f5;
}

.ai-answer{
    background:#eef8f2;
    border:1px solid #d7eddf;
}

.bubble-label{
    margin-bottom:4px;
    color:var(--muted);
    font-size:11px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.04em;
}

.user-question p,
.ai-answer p{
    margin:0;
    line-height:1.5;
    overflow-wrap:anywhere;
}

/* Antworten kommen als strukturierter Text (ein Fakt pro Zeile).
   pre-line rendert die Zeilenumbrueche, ohne HTML zuzulassen. */
.ai-answer p,
.detail-question-answer p{
    white-space:pre-line;
}

.evidence-footer{
    display:flex;
    justify-content:space-between;
    gap:12px;
    flex-wrap:wrap;
    margin-top:10px;
    color:var(--muted);
    font-size:11px;
}

.empty-state{
    padding:34px 20px;
    text-align:center;
    background:var(--surface-soft);
    border:1px dashed var(--border-strong);
    border-radius:12px;
}

.empty-state-icon{
    font-size:30px;
}

.empty-state h3{
    margin:8px 0 4px;
}

.empty-state p{
    max-width:560px;
    margin:0 auto;
    color:var(--muted);
    line-height:1.5;
}

.game-footer{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:24px;
    padding:22px;
}

.game-footer p{
    margin:6px 0 0;
    color:var(--muted);
}

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

@media (max-width:760px){
    body.participant-page{
        padding:18px 10px 30px;
    }

    .game-header{
        align-items:stretch;
        gap:12px;
    }

    .question-counter-card{
        flex-basis:104px;
        padding:13px 10px;
    }

    .question-counter-number{
        font-size:28px;
    }

    .scenario-card,
    .investigation-panel,
    .history-section,
    .game-footer{
        border-radius:11px;
    }

    .investigation-panel,
    .history-section{
        padding:16px;
    }

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

    .primary-action{
        width:100%;
    }

    .composer-help{
        flex-direction:column;
        gap:4px;
    }

    .evidence-topline{
        align-items:flex-start;
    }

    .game-footer{
        flex-direction:column;
        align-items:stretch;
    }

    .secondary-action{
        width:100%;
    }
}

@media (max-width:520px){
    .game-header{
        flex-direction:column;
    }

    .question-counter-card{
        display:grid;
        grid-template-columns:auto 1fr auto;
        align-items:center;
        gap:8px;
        text-align:left;
    }

    .question-counter-label,
    .question-counter-total{
        margin:0;
    }

    .panel-heading{
        flex-direction:column;
        gap:8px;
    }

    .evidence-topline{
        flex-direction:column;
        gap:7px;
    }

    .evidence-time{
        white-space:normal;
    }
}

/* =========================================================
   Participant UI - Final Submission
   ========================================================= */

.final-shell{
    max-width:960px;
}

.final-header{
    margin-bottom:22px;
}

.final-step-card{
    flex:0 0 132px;
    padding:16px;
    text-align:center;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:14px;
    box-shadow:var(--shadow);
}

.final-step-number{
    color:var(--bosch-blue);
    font-size:28px;
    font-weight:800;
    line-height:1.05;
}

.final-step-label{
    margin-top:4px;
    color:var(--muted);
    font-size:12px;
    font-weight:700;
}

.final-guidance-card{
    display:flex;
    gap:15px;
    padding:20px;
    margin-bottom:18px;
    background:#eef6fb;
    border:1px solid #d5e8f3;
    border-radius:14px;
}

.final-guidance-icon{
    flex:0 0 auto;
    font-size:25px;
}

.final-guidance-card h2{
    margin:4px 0 7px;
    font-size:20px;
}

.final-guidance-card p{
    margin:0;
    color:var(--muted);
    line-height:1.55;
}

.final-form{
    display:flex;
    flex-direction:column;
    gap:16px;
}

.final-answer-card{
    padding:22px;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:14px;
    box-shadow:var(--shadow);
}

.final-answer-heading{
    display:flex;
    align-items:flex-start;
    gap:13px;
}

.answer-step{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 34px;
    width:34px;
    height:34px;
    color:#fff;
    background:var(--bosch-blue);
    border-radius:50%;
    font-size:15px;
    font-weight:800;
}

.final-answer-heading h2{
    margin:4px 0 0;
    font-size:21px;
    line-height:1.25;
}

.field-help{
    margin:12px 0 10px 47px;
    color:var(--muted);
    font-size:13px;
    line-height:1.5;
}

.final-answer-card textarea{
    width:100%;
    margin:0;
    min-height:150px;
    padding:14px;
    resize:vertical;
    border:1px solid var(--border-strong);
    border-radius:9px;
    background:#fff;
    font-family:Arial, sans-serif;
    font-size:15px;
    line-height:1.55;
}

.final-answer-card textarea:focus{
    outline:3px solid rgba(0,123,192,.14);
    border-color:var(--bosch-blue);
}

.final-answer-card textarea[readonly]{
    background:#f6f8fa;
}

.submit-panel{
    padding:20px;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:14px;
    box-shadow:var(--shadow);
}

.submit-warning{
    display:flex;
    gap:12px;
    padding:14px;
    margin-bottom:18px;
    background:var(--warning-soft);
    border:1px solid #f1d7aa;
    border-radius:10px;
}

.submit-warning-icon{
    flex:0 0 auto;
    color:var(--warning);
    font-size:20px;
}

.submit-warning p{
    margin:4px 0 0;
    color:#6d5a3c;
    font-size:13px;
    line-height:1.45;
}

.submit-actions{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:14px;
}

.text-action{
    color:var(--bosch-blue-dark);
    font-size:14px;
    font-weight:700;
    text-decoration:none;
}

.text-action:hover{
    text-decoration:underline;
}

.final-submit-button{
    min-width:220px;
    padding:0 20px;
}

@media (max-width:760px){
    .final-guidance-card,
    .final-answer-card,
    .submit-panel{
        border-radius:11px;
    }

    .final-answer-card{
        padding:17px;
    }

    .field-help{
        margin-left:0;
    }

    .submit-actions{
        flex-direction:column-reverse;
        align-items:stretch;
    }

    .final-submit-button{
        width:100%;
    }

    .text-action{
        text-align:center;
        padding:10px 0;
    }
}

@media (max-width:520px){
    .final-header{
        flex-direction:column;
    }

    .final-step-card{
        width:100%;
        flex-basis:auto;
        display:flex;
        justify-content:center;
        gap:8px;
        align-items:center;
    }

    .final-step-label{
        margin:0;
    }

    .final-guidance-card{
        padding:16px;
    }

    .final-answer-heading h2{
        font-size:18px;
    }
}

/* =========================================================
   Participant UI - Completed / Result
   ========================================================= */

.result-shell{
    max-width:960px;
}

.result-header{
    display:flex;
    align-items:center;
    gap:16px;
    margin-bottom:22px;
}

.result-header h1{
    margin:4px 0 6px;
    font-size:clamp(30px, 4vw, 44px);
    line-height:1.05;
}

.result-check{
    display:flex;
    align-items:center;
    justify-content:center;
    flex:0 0 52px;
    width:52px;
    height:52px;
    border-radius:50%;
    background:var(--success);
    color:#fff;
    font-size:28px;
    font-weight:800;
    box-shadow:var(--shadow);
}

.result-state-card,
.score-hero,
.final-result-card,
.result-actions-card,
.result-note-card{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:14px;
    box-shadow:var(--shadow);
}

.result-state-card{
    display:flex;
    gap:16px;
    align-items:flex-start;
    padding:24px;
}

.result-state-card h2,
.final-result-card h2,
.result-actions-card h2,
.result-note-card h2{
    margin:4px 0 6px;
    font-size:22px;
}

.result-state-card p,
.final-result-card p,
.result-actions-card p,
.result-note-card p{
    margin:0;
    color:var(--muted);
    line-height:1.55;
}

.result-state-icon{
    display:flex;
    align-items:center;
    justify-content:center;
    flex:0 0 44px;
    width:44px;
    height:44px;
    border-radius:50%;
    font-size:20px;
    font-weight:800;
}

.result-state-warning{
    border-left:4px solid var(--warning);
}

.result-state-warning .result-state-icon{
    background:var(--warning-soft);
    color:var(--warning);
}

.result-state-danger{
    border-left:4px solid var(--danger);
}

.result-state-danger .result-state-icon{
    background:#fdeceb;
    color:var(--danger);
}

.score-hero{
    display:grid;
    grid-template-columns:minmax(0, 1.45fr) minmax(230px, .75fr);
    gap:18px;
    padding:24px;
    margin-bottom:18px;
}

.score-hero-main{
    min-width:0;
}

.score-number{
    margin-top:8px;
    font-size:clamp(48px, 8vw, 72px);
    line-height:1;
    font-weight:800;
    color:var(--text);
}

.score-number span{
    font-size:.32em;
    color:var(--muted);
    font-weight:700;
}

.grade-badge,
.final-grade-badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    margin-top:12px;
    min-height:34px;
    padding:6px 14px;
    border-radius:999px;
    background:#e9f2ff;
    color:#245b9b;
    font-size:15px;
    font-weight:800;
}

.score-hero-main p{
    max-width:620px;
    margin:14px 0 0;
    color:var(--muted);
    line-height:1.55;
}

.standing-card{
    display:flex;
    flex-direction:column;
    justify-content:center;
    min-height:190px;
    padding:20px;
    border-radius:12px;
    background:#f5f8fa;
    border:1px solid var(--border);
    text-align:center;
}

.standing-label{
    color:var(--muted);
    font-size:12px;
    font-weight:800;
    letter-spacing:.06em;
    text-transform:uppercase;
}

.standing-value{
    margin-top:10px;
    font-size:38px;
    font-weight:800;
    color:var(--success);
}

.standing-value-text{
    font-size:24px;
    line-height:1.25;
}

.standing-text{
    margin-top:4px;
    color:var(--muted);
    font-size:13px;
}

.final-result-card{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:24px;
    padding:22px;
    margin-bottom:18px;
    border-left:4px solid var(--success);
}

.final-result-score{
    text-align:right;
}

.final-score-number{
    font-size:38px;
    font-weight:800;
    white-space:nowrap;
}

.final-score-number span{
    font-size:.4em;
    color:var(--muted);
}

.final-grade-badge{
    margin-top:8px;
    background:var(--success-soft);
    color:var(--success);
}

.result-actions-card{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    padding:22px;
}

.result-note-card{
    display:flex;
    gap:14px;
    padding:20px;
    border-left:4px solid var(--bosch-blue);
}

.result-note-icon{
    flex:0 0 auto;
    font-size:22px;
}

@media (max-width:760px){
    .score-hero{
        grid-template-columns:1fr;
        padding:18px;
    }

    .standing-card{
        min-height:unset;
    }

    .final-result-card,
    .result-actions-card{
        flex-direction:column;
        align-items:stretch;
    }

    .final-result-score{
        text-align:left;
    }

    .result-actions-card .secondary-action{
        width:100%;
    }
}

@media (max-width:520px){
    .result-header{
        align-items:flex-start;
    }

    .result-check{
        width:44px;
        height:44px;
        flex-basis:44px;
        font-size:23px;
    }

    .result-state-card,
    .result-note-card{
        padding:17px;
    }

    .score-number{
        font-size:50px;
    }
}

/* =========================================================
   Participant UI - Entry / Login
   ========================================================= */

.entry-shell{
    max-width:1080px;
}

.entry-hero{
    display:grid;
    grid-template-columns:minmax(0, 1.15fr) minmax(340px, .85fr);
    gap:28px;
    align-items:center;
    min-height:560px;
}

.entry-copy h1{
    margin:6px 0 14px;
    font-size:clamp(42px, 7vw, 72px);
    line-height:.98;
    letter-spacing:-.03em;
}

.entry-lead{
    max-width:680px;
    margin:0;
    color:var(--muted);
    font-size:18px;
    line-height:1.6;
}

.entry-feature-grid{
    display:grid;
    grid-template-columns:repeat(3, 1fr);
    gap:12px;
    margin-top:28px;
}

.entry-feature{
    display:flex;
    gap:10px;
    padding:14px;
    background:rgba(255,255,255,.7);
    border:1px solid var(--border);
    border-radius:12px;
}

.entry-feature-icon{
    font-size:22px;
}

.entry-feature b{
    display:block;
    margin-bottom:3px;
    font-size:14px;
}

.entry-feature span{
    display:block;
    color:var(--muted);
    font-size:12px;
    line-height:1.4;
}

.entry-login-card{
    padding:26px;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:16px;
    box-shadow:0 16px 42px rgba(25,47,68,.12);
}

.entry-login-card h2{
    margin:5px 0 8px;
    font-size:25px;
    line-height:1.2;
}

.entry-login-help{
    margin:0 0 18px;
    color:var(--muted);
    line-height:1.5;
    font-size:13px;
}

.entry-status{
    display:flex;
    align-items:center;
    gap:9px;
    margin-bottom:16px;
    padding:10px 12px;
    border-radius:9px;
    font-size:13px;
}

.entry-status-open{
    width:max-content;
    color:var(--success);
    background:var(--success-soft);
    font-weight:800;
}

.entry-status-warning{
    background:var(--warning-soft);
    color:#705526;
}

.entry-status-warning span{
    display:block;
    margin-top:2px;
    font-size:12px;
}

.entry-status-icon{
    font-size:20px;
}

.entry-status-dot{
    width:8px;
    height:8px;
    border-radius:50%;
    background:var(--success);
}

.entry-form{
    display:flex;
    flex-direction:column;
}

.entry-form label{
    margin:0 0 6px;
    font-size:13px;
    font-weight:700;
}

.entry-form input{
    width:100%;
    margin:0 0 15px;
    min-height:48px;
    padding:12px 14px;
    border:1px solid var(--border-strong);
    border-radius:9px;
    font-size:16px;
    background:#fff;
}

.entry-form input:focus{
    outline:3px solid rgba(0,123,192,.14);
    border-color:var(--bosch-blue);
}

.entry-submit{
    width:100%;
    margin-top:2px;
}

.entry-privacy-note{
    margin:13px 0 0;
    color:var(--muted);
    font-size:11px;
    line-height:1.45;
    text-align:center;
}

.entry-rules-card{
    padding:24px;
    margin-top:8px;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:14px;
    box-shadow:var(--shadow);
}

.entry-rules-heading{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:18px;
    margin-bottom:20px;
}

.entry-rules-heading h2{
    margin:4px 0 0;
    font-size:23px;
}

.entry-steps{
    display:grid;
    grid-template-columns:repeat(3, 1fr);
    gap:14px;
}

.entry-step{
    display:flex;
    gap:12px;
    padding:16px;
    background:var(--surface-soft);
    border:1px solid var(--border);
    border-radius:11px;
}

.entry-step-number{
    display:flex;
    align-items:center;
    justify-content:center;
    flex:0 0 30px;
    width:30px;
    height:30px;
    border-radius:50%;
    color:#fff;
    background:var(--bosch-blue);
    font-weight:800;
    font-size:13px;
}

.entry-step b{
    font-size:14px;
}

.entry-step p{
    margin:5px 0 0;
    color:var(--muted);
    font-size:12px;
    line-height:1.5;
}

@media (max-width:900px){
    .entry-hero{
        grid-template-columns:1fr;
        min-height:unset;
    }

    .entry-login-card{
        max-width:620px;
    }
}

@media (max-width:700px){
    .entry-feature-grid,
    .entry-steps{
        grid-template-columns:1fr;
    }

    .entry-copy h1{
        font-size:46px;
    }

    .entry-rules-heading{
        flex-direction:column;
        gap:10px;
    }
}

@media (max-width:520px){
    .entry-login-card{
        padding:19px;
        border-radius:12px;
    }

    .entry-rules-card{
        padding:17px;
    }

    .entry-copy h1{
        font-size:40px;
    }

    .entry-lead{
        font-size:16px;
    }
}

/* =========================================================
   Admin UI - Dashboard
   ========================================================= */

body.admin-page{
    margin:0;
    padding:28px 18px 48px;
    background:#f2f5f7;
    color:var(--text);
}

.admin-shell{
    width:min(1500px, 100%);
    margin:0 auto;
}

.admin-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:24px;
    margin-bottom:20px;
}

.admin-header h1{
    margin:4px 0 6px;
    font-size:clamp(30px, 4vw, 44px);
    line-height:1.05;
}

.admin-subtitle{
    margin:0;
    color:var(--muted);
    font-size:15px;
}

.admin-logout{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:40px;
    padding:0 14px;
    color:var(--bosch-blue-dark);
    background:#fff;
    border:1px solid var(--border);
    border-radius:9px;
    text-decoration:none;
    font-weight:700;
    font-size:13px;
}

.admin-logout:hover{
    background:#f7f9fb;
}

.admin-toolbar{
    display:grid;
    grid-template-columns:repeat(6, minmax(0, 1fr));
    gap:10px;
    margin-bottom:18px;
}

.admin-tool{
    display:flex;
    align-items:center;
    gap:9px;
    min-height:52px;
    padding:10px 12px;
    color:var(--text);
    background:#fff;
    border:1px solid var(--border);
    border-radius:11px;
    text-decoration:none;
    font-size:13px;
    font-weight:700;
    box-shadow:0 3px 12px rgba(25,47,68,.04);
}

.admin-tool:hover{
    border-color:#b8c5d0;
    background:#fbfcfd;
}

.admin-tool-icon{
    font-size:18px;
}

.admin-stats{
    display:grid;
    grid-template-columns:repeat(5, minmax(0, 1fr));
    gap:12px;
    margin-bottom:18px;
}

.admin-stat-card{
    display:flex;
    flex-direction:column;
    min-height:112px;
    padding:16px;
    background:#fff;
    border:1px solid var(--border);
    border-radius:12px;
    box-shadow:var(--shadow);
}

.admin-stat-label{
    color:var(--muted);
    font-size:12px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.04em;
}

.admin-stat-card strong{
    margin-top:8px;
    font-size:32px;
    line-height:1;
}

.admin-stat-note{
    margin-top:auto;
    color:var(--muted);
    font-size:11px;
}

.admin-rules-card,
.admin-table-card{
    background:#fff;
    border:1px solid var(--border);
    border-radius:14px;
    box-shadow:var(--shadow);
}

.admin-rules-card{
    margin-bottom:18px;
    overflow:hidden;
}

.admin-rules-card summary{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:14px 17px;
    cursor:pointer;
    font-weight:800;
}

.admin-rules-card summary:hover{
    background:#f8fafb;
}

.admin-summary-hint{
    color:var(--muted);
    font-size:11px;
    font-weight:500;
}

.admin-rules-content{
    display:grid;
    grid-template-columns:repeat(3, 1fr);
    gap:14px;
    padding:0 17px 17px;
}

.admin-rules-content>div{
    padding:13px;
    background:#f7f9fb;
    border-radius:9px;
}

.admin-rules-content b{
    font-size:13px;
}

.admin-rules-content p{
    margin:5px 0 0;
    color:var(--muted);
    font-size:12px;
    line-height:1.45;
}

.admin-table-card{
    padding:18px;
    overflow:hidden;
}

.admin-section-heading{
    display:flex;
    justify-content:space-between;
    align-items:flex-end;
    gap:20px;
    margin-bottom:14px;
}

.admin-section-heading h2{
    margin:4px 0 0;
    font-size:23px;
}

.admin-table-count{
    color:var(--muted);
    font-size:12px;
}

.admin-table-scroll{
    width:100%;
    overflow-x:auto;
    border:1px solid var(--border);
    border-radius:10px;
}

.admin-data-table{
    width:100%;
    min-width:1280px;
    border-collapse:collapse;
    background:#fff;
    font-size:12px;
}

.admin-data-table th,
.admin-data-table td{
    padding:11px 10px;
    border-bottom:1px solid #e7ecef;
    vertical-align:middle;
    white-space:nowrap;
}

.admin-data-table th{
    position:sticky;
    top:0;
    z-index:1;
    background:#f6f8fa;
    color:#586570;
    font-size:10px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.04em;
    text-align:left;
}

.admin-data-table tbody tr:hover{
    background:#f9fbfc;
}

.admin-data-table tbody tr:last-child td{
    border-bottom:0;
}

.number-cell{
    text-align:right !important;
}

.admin-rank-cell{
    text-align:center;
}

.rank-badge{
    display:inline-flex;
    min-width:32px;
    justify-content:center;
    padding:4px 7px;
    border-radius:999px;
    background:#eef4ff;
    color:#245b9b;
    font-weight:800;
}

.participant-cell{
    display:flex;
    flex-direction:column;
    gap:2px;
    min-width:150px;
    white-space:normal;
}

.participant-cell b{
    font-size:13px;
}

.participant-cell span{
    color:var(--muted);
    font-size:10px;
}

.admin-status{
    display:inline-flex;
    align-items:center;
    min-height:24px;
    padding:3px 8px;
    border-radius:999px;
    font-size:10px;
    font-weight:800;
}

.admin-status-success{
    background:var(--success-soft);
    color:var(--success);
}

.admin-status-warning{
    background:var(--warning-soft);
    color:var(--warning);
}

.admin-status-danger{
    background:#fdeceb;
    color:var(--danger);
}

.admin-status-neutral{
    background:#eef1f4;
    color:#5b6670;
}

.final-score-cell{
    font-weight:800;
    color:var(--text);
}

.grade-pill{
    display:inline-flex;
    align-items:center;
    min-height:24px;
    padding:3px 8px;
    border-radius:999px;
    background:#e9f2ff;
    color:#245b9b;
    font-size:10px;
    font-weight:800;
}

.muted-value{
    color:#9aa5ad;
}

.submitted-cell{
    color:var(--muted);
    font-size:10px;
}

.table-action{
    display:inline-flex;
    align-items:center;
    min-height:30px;
    padding:0 9px;
    border-radius:7px;
    color:var(--bosch-blue-dark);
    background:#eef6fb;
    text-decoration:none;
    font-weight:800;
    font-size:11px;
}

.table-action:hover{
    background:#dfeff8;
}

.admin-empty-state{
    padding:38px 20px;
    text-align:center;
    background:#f8fafb;
    border:1px dashed var(--border-strong);
    border-radius:10px;
}

.admin-empty-state>div{
    font-size:30px;
}

.admin-empty-state h3{
    margin:7px 0 4px;
}

.admin-empty-state p{
    margin:0;
    color:var(--muted);
}

@media (max-width:1100px){
    .admin-toolbar{
        grid-template-columns:repeat(3, 1fr);
    }

    .admin-stats{
        grid-template-columns:repeat(3, 1fr);
    }
}

@media (max-width:760px){
    body.admin-page{
        padding:18px 10px 32px;
    }

    .admin-header{
        align-items:center;
    }

    .admin-toolbar{
        grid-template-columns:repeat(2, 1fr);
    }

    .admin-stats{
        grid-template-columns:repeat(2, 1fr);
    }

    .admin-rules-content{
        grid-template-columns:1fr;
    }

    .admin-table-card{
        padding:13px;
    }
}

@media (max-width:520px){
    .admin-header{
        flex-direction:column;
        align-items:stretch;
    }

    .admin-logout{
        width:100%;
    }

    .admin-toolbar{
        grid-template-columns:1fr;
    }

    .admin-stats{
        grid-template-columns:1fr 1fr;
    }

    .admin-stat-card{
        min-height:98px;
    }
}

/* =========================================================
   Admin UI - Participant Detail
   ========================================================= */

.detail-shell{
    max-width:1320px;
}

.detail-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:24px;
    margin-bottom:18px;
}

.detail-back-link{
    display:inline-block;
    margin-bottom:14px;
    color:var(--bosch-blue-dark);
    text-decoration:none;
    font-size:13px;
    font-weight:700;
}

.detail-back-link:hover{
    text-decoration:underline;
}

.detail-header h1{
    margin:4px 0 7px;
    font-size:clamp(30px, 4vw, 42px);
    line-height:1.05;
}

.detail-identity-row{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
    color:var(--muted);
    font-size:13px;
}

.detail-score-summary{
    min-width:155px;
    padding:17px;
    background:#fff;
    border:1px solid var(--border);
    border-radius:13px;
    box-shadow:var(--shadow);
    text-align:center;
}

.detail-score-label{
    color:var(--muted);
    font-size:11px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.05em;
}

.detail-score-value{
    margin-top:6px;
    font-size:38px;
    font-weight:800;
    line-height:1;
}

.detail-score-grade{
    margin-top:7px;
    color:#245b9b;
    font-size:13px;
    font-weight:800;
}

.detail-overview-grid{
    display:grid;
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap:12px;
    margin-bottom:18px;
}

.detail-stat-card{
    display:flex;
    flex-direction:column;
    gap:8px;
    min-height:92px;
    padding:15px;
    background:#fff;
    border:1px solid var(--border);
    border-radius:11px;
    box-shadow:var(--shadow);
}

.detail-stat-card span{
    color:var(--muted);
    font-size:11px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.04em;
}

.detail-stat-card strong{
    margin-top:auto;
    font-size:24px;
}

.detail-card{
    padding:20px;
    margin-bottom:18px;
    background:#fff;
    border:1px solid var(--border);
    border-radius:14px;
    box-shadow:var(--shadow);
}

.detail-section-heading{
    display:flex;
    justify-content:space-between;
    align-items:flex-end;
    gap:18px;
    margin-bottom:16px;
}

.detail-section-heading h2{
    margin:4px 0 0;
    font-size:23px;
}

.detail-info-grid{
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:12px;
}

.compact-detail-info{
    grid-template-columns:repeat(2, minmax(0, 220px));
}

.detail-info-item{
    display:flex;
    flex-direction:column;
    gap:5px;
    padding:13px;
    background:#f7f9fb;
    border:1px solid #e8edf0;
    border-radius:9px;
    min-width:0;
}

.detail-info-item span{
    color:var(--muted);
    font-size:10px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.04em;
}

.detail-info-item b{
    overflow-wrap:anywhere;
    font-size:13px;
}

.detail-actions{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}

.detail-actions form{
    margin:0;
}

.detail-action-button{
    width:auto;
    min-height:38px;
    margin:0;
    padding:0 13px;
    border:1px solid transparent;
    border-radius:8px;
    font-weight:800;
    font-size:12px;
}

.detail-action-primary{
    background:var(--bosch-blue);
    color:#fff;
}

.detail-action-primary:hover{
    background:var(--bosch-blue-dark);
}

.detail-action-warning{
    color:#7a5200;
    background:var(--warning-soft);
    border-color:#efd6a8;
}

.detail-action-success{
    color:var(--success);
    background:var(--success-soft);
    border-color:#cce8d6;
}

.detail-action-danger{
    color:var(--danger);
    background:#fdeceb;
    border-color:#f3c9c6;
}

.detail-question-list{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.detail-question-card{
    padding:15px;
    border:1px solid var(--border);
    border-radius:11px;
}

.detail-question-counted{
    border-left:4px solid var(--bosch-blue);
}

.detail-question-not-counted{
    border-left:4px solid #9aa5ad;
    background:#fafbfc;
}

.detail-question-topline{
    display:flex;
    justify-content:space-between;
    gap:12px;
    align-items:center;
    margin-bottom:12px;
}

.detail-question-time{
    color:var(--muted);
    font-size:10px;
}

.detail-question-user,
.detail-question-answer{
    padding:11px 12px;
    border-radius:9px;
}

.detail-question-user{
    margin-bottom:8px;
    background:#f0f3f5;
}

.detail-question-answer{
    background:#eef8f2;
    border:1px solid #d7eddf;
}

.detail-question-user span,
.detail-question-answer span,
.detail-answer-label,
.detail-feedback-box span{
    display:block;
    margin-bottom:4px;
    color:var(--muted);
    font-size:10px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.04em;
}

.detail-question-user p,
.detail-question-answer p,
.detail-answer-block p,
.detail-feedback-box p{
    margin:0;
    line-height:1.5;
    overflow-wrap:anywhere;
}

.detail-question-meta{
    display:flex;
    justify-content:space-between;
    gap:10px;
    flex-wrap:wrap;
    margin-top:9px;
    color:var(--muted);
    font-size:10px;
}

.detail-submission-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:12px;
}

.detail-answer-block{
    padding:15px;
    background:#f7f9fb;
    border:1px solid #e6ecef;
    border-radius:10px;
}

.detail-answer-wide{
    grid-column:1 / -1;
}

.detail-evaluation-pending{
    padding:14px;
    margin-bottom:14px;
    background:var(--warning-soft);
    border:1px solid #efd6a8;
    border-radius:9px;
}

.detail-evaluation-pending p{
    margin:5px 0 0;
    color:#6d5a3c;
    font-size:12px;
    line-height:1.45;
}

.detail-score-table-wrap{
    width:100%;
    overflow-x:auto;
    border:1px solid var(--border);
    border-radius:10px;
}

.detail-score-table{
    width:100%;
    min-width:760px;
    border-collapse:collapse;
    font-size:12px;
}

.detail-score-table th,
.detail-score-table td{
    padding:11px 12px;
    border-bottom:1px solid #e7ecef;
    text-align:left;
    vertical-align:top;
}

.detail-score-table th{
    background:#f6f8fa;
    color:#586570;
    font-size:10px;
    text-transform:uppercase;
    letter-spacing:.04em;
}

.detail-score-table tr:last-child td{
    border-bottom:0;
}

.detail-feedback-box{
    margin-top:13px;
    padding:14px;
    background:#f7f9fb;
    border:1px solid #e8edf0;
    border-radius:9px;
}

.judge-review-form{
    display:grid;
    grid-template-columns:180px minmax(0, 1fr) auto;
    gap:14px;
    align-items:end;
}

.judge-review-form label{
    display:block;
    margin-bottom:6px;
    font-size:12px;
    font-weight:800;
}

.judge-review-form input,
.judge-review-form textarea{
    width:100%;
    margin:0;
    border:1px solid var(--border-strong);
    border-radius:8px;
    background:#fff;
    font-size:13px;
}

.judge-review-form input{
    min-height:42px;
    padding:9px 10px;
}

.judge-review-form textarea{
    min-height:90px;
    padding:10px;
    resize:vertical;
}

.judge-save-button{
    min-width:150px;
    min-height:42px;
}

.final-result-summary{
    border-left:4px solid var(--bosch-blue);
}

.final-result-grid{
    display:grid;
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap:12px;
}

.final-result-grid>div{
    display:flex;
    flex-direction:column;
    gap:5px;
    padding:14px;
    background:#f7f9fb;
    border:1px solid #e8edf0;
    border-radius:9px;
}

.final-result-grid span{
    color:var(--muted);
    font-size:10px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.04em;
}

.final-result-grid strong{
    font-size:24px;
}

.final-result-highlight{
    background:#eef6fb !important;
    border-color:#d1e6f3 !important;
}

.final-result-highlight strong{
    color:var(--bosch-blue-dark);
}

@media (max-width:1000px){
    .detail-overview-grid,
    .final-result-grid{
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }

    .detail-info-grid{
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }

    .judge-review-form{
        grid-template-columns:160px minmax(0, 1fr);
    }

    .judge-save-button{
        grid-column:1 / -1;
        width:100%;
    }
}

@media (max-width:760px){
    .detail-header{
        flex-direction:column;
    }

    .detail-score-summary{
        width:100%;
        display:grid;
        grid-template-columns:1fr auto auto;
        align-items:center;
        gap:10px;
        text-align:left;
    }

    .detail-score-value,
    .detail-score-grade{
        margin:0;
    }

    .detail-overview-grid,
    .detail-info-grid,
    .detail-submission-grid,
    .final-result-grid{
        grid-template-columns:1fr;
    }

    .detail-answer-wide{
        grid-column:auto;
    }

    .detail-card{
        padding:15px;
    }

    .judge-review-form{
        grid-template-columns:1fr;
    }

    .judge-save-button{
        grid-column:auto;
    }
}

@media (max-width:520px){
    .detail-actions{
        flex-direction:column;
    }

    .detail-actions form,
    .detail-action-button{
        width:100%;
    }

    .detail-question-topline{
        flex-direction:column;
        align-items:flex-start;
    }
}

/* =========================================================
   Admin UI - Shared Tool Pages
   ========================================================= */

.admin-tool-shell{
    max-width:1280px;
}

.admin-form-shell{
    max-width:1100px;
}

.tool-page-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:24px;
    margin-bottom:20px;
}

.tool-page-header h1{
    margin:4px 0 6px;
    font-size:clamp(30px, 4vw, 42px);
    line-height:1.05;
}

.tool-page-links{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
}

.tool-page-links a{
    display:inline-flex;
    align-items:center;
    min-height:36px;
    padding:0 11px;
    color:var(--bosch-blue-dark);
    background:#fff;
    border:1px solid var(--border);
    border-radius:8px;
    text-decoration:none;
    font-size:12px;
    font-weight:700;
}

.tool-page-links a:hover{
    background:#f7f9fb;
}

.admin-alert{
    display:flex;
    align-items:flex-start;
    gap:10px;
    padding:13px 15px;
    margin-bottom:16px;
    border-radius:10px;
    font-size:13px;
}

.admin-alert b{
    white-space:nowrap;
}

.admin-alert-success{
    color:#176b35;
    background:var(--success-soft);
    border:1px solid #cce8d6;
}

.admin-alert-danger{
    color:var(--danger);
    background:#fdeceb;
    border:1px solid #f3c9c6;
}

.tool-card{
    padding:20px;
    margin-bottom:18px;
    background:#fff;
    border:1px solid var(--border);
    border-radius:14px;
    box-shadow:var(--shadow);
}

.tool-card-heading{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:18px;
    margin-bottom:15px;
}

.tool-card-heading h2{
    margin:4px 0 0;
    font-size:22px;
}

.tool-help-text{
    margin:0 0 16px;
    color:var(--muted);
    font-size:13px;
    line-height:1.55;
}

.tool-actions-row{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
}

.tool-actions-row form{
    margin:0;
}

.admin-secondary-button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:38px;
    padding:0 13px;
    color:var(--bosch-blue-dark);
    background:#eef6fb;
    border:1px solid #d1e6f3;
    border-radius:8px;
    text-decoration:none;
    font-size:12px;
    font-weight:800;
}

.admin-secondary-button:hover{
    background:#dfeff8;
}

.template-source-card{
    border-left:4px solid var(--bosch-blue);
}

.template-meta-grid{
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:10px;
    margin-bottom:14px;
}

.template-meta-grid>div{
    display:flex;
    flex-direction:column;
    gap:4px;
    padding:12px;
    background:#f7f9fb;
    border:1px solid #e8edf0;
    border-radius:9px;
}

.template-meta-grid span{
    color:var(--muted);
    font-size:10px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.04em;
}

.template-meta-grid b{
    font-size:13px;
    overflow-wrap:anywhere;
}

.cases-table{
    min-width:1000px;
}

.case-actions{
    display:flex;
    align-items:center;
    gap:6px;
    flex-wrap:wrap;
}

.case-actions form{
    margin:0;
}

.compact-action-button{
    width:auto;
    min-height:30px;
    margin:0;
    padding:0 9px;
    color:#43515c;
    background:#f5f7f8;
    border:1px solid var(--border);
    border-radius:7px;
    font-size:10px;
    font-weight:800;
}

.compact-action-primary{
    color:#fff;
    background:var(--bosch-blue);
    border-color:var(--bosch-blue);
}

.compact-action-danger{
    color:var(--danger);
    background:#fdeceb;
    border-color:#f3c9c6;
}

.case-protection-note{
    color:var(--muted);
    font-size:10px;
}

.workflow-note{
    margin-top:14px;
    padding:12px 14px;
    color:#52606b;
    background:#f7f9fb;
    border-radius:8px;
    font-size:12px;
    line-height:1.5;
}

/* Case editor */

.editor-guidance{
    display:flex;
    gap:12px;
    padding:13px 14px;
    margin-bottom:18px;
    background:#eef6fb;
    border:1px solid #d1e6f3;
    border-radius:9px;
}

.editor-guidance-icon{
    flex:0 0 auto;
    font-size:20px;
}

.editor-guidance p{
    margin:4px 0 0;
    color:var(--muted);
    font-size:12px;
    line-height:1.5;
}

.case-editor-form,
.stacked-admin-form{
    display:flex;
    flex-direction:column;
}

.form-field{
    display:flex;
    flex-direction:column;
    margin-bottom:17px;
}

.case-editor-form label,
.stacked-admin-form label{
    margin-bottom:6px;
    font-size:12px;
    font-weight:800;
}

.field-description{
    display:block;
    margin:-2px 0 7px;
    color:var(--muted);
    font-size:11px;
    line-height:1.45;
}

.case-editor-form input,
.case-editor-form textarea,
.stacked-admin-form input,
.stacked-admin-form select{
    width:100%;
    margin:0;
    border:1px solid var(--border-strong);
    border-radius:8px;
    background:#fff;
    font-size:13px;
}

.case-editor-form input,
.stacked-admin-form input,
.stacked-admin-form select{
    min-height:42px;
    padding:9px 10px;
}

.case-editor-form textarea{
    padding:10px 11px;
    resize:vertical;
    line-height:1.5;
}

.case-editor-form input:focus,
.case-editor-form textarea:focus,
.stacked-admin-form input:focus,
.stacked-admin-form select:focus{
    outline:3px solid rgba(0,123,192,.12);
    border-color:var(--bosch-blue);
}

.json-editor-label-row{
    display:flex;
    justify-content:space-between;
    gap:14px;
    align-items:flex-start;
}

.json-editor{
    min-height:560px;
    font-family:Consolas, "Courier New", monospace !important;
    font-size:12px !important;
    tab-size:2;
}

.editor-footer{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}

.case-save-button{
    min-width:150px;
}

/* Health */

.health-banner{
    display:flex;
    align-items:center;
    gap:13px;
    padding:15px;
    margin-bottom:18px;
    border-radius:11px;
}

.health-banner-icon{
    display:flex;
    align-items:center;
    justify-content:center;
    flex:0 0 34px;
    width:34px;
    height:34px;
    border-radius:50%;
    font-weight:800;
}

.health-banner b{
    display:block;
    margin-bottom:2px;
}

.health-banner span{
    color:inherit;
    opacity:.82;
    font-size:12px;
}

.health-banner-success{
    color:#176b35;
    background:var(--success-soft);
    border:1px solid #cce8d6;
}

.health-banner-success .health-banner-icon{
    color:#fff;
    background:var(--success);
}

.health-banner-warning{
    color:#795600;
    background:var(--warning-soft);
    border:1px solid #efd6a8;
}

.health-banner-warning .health-banner-icon{
    color:#fff;
    background:var(--warning);
}

.health-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:14px;
}

.health-card{
    padding:18px;
    background:#fff;
    border:1px solid var(--border);
    border-radius:13px;
    box-shadow:var(--shadow);
}

.health-card-ai{
    grid-column:1 / -1;
}

.health-card-top{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:12px;
    margin-bottom:14px;
}

.health-card-top h2{
    margin:4px 0 0;
    font-size:21px;
}

.health-detail-list{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.health-detail-two-col{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
}

.health-detail-list>div{
    display:flex;
    flex-direction:column;
    gap:4px;
    padding:11px;
    background:#f7f9fb;
    border:1px solid #e8edf0;
    border-radius:8px;
}

.health-detail-list span{
    color:var(--muted);
    font-size:10px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.04em;
}

.health-detail-list b{
    font-size:12px;
    overflow-wrap:anywhere;
}

.health-message{
    margin-top:12px;
    padding:11px 12px;
    color:#52606b;
    background:#eef6fb;
    border-radius:8px;
    font-size:12px;
    line-height:1.5;
}

.health-check-form{
    margin-top:13px;
}

.security-note{
    margin:14px 0 0;
    color:var(--muted);
    font-size:11px;
    line-height:1.45;
}

/* Event Data */

.event-data-stats{
    display:grid;
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap:12px;
    margin-bottom:18px;
}

.event-data-actions-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:16px;
}

.dangerous-tool-card{
    border-left:4px solid var(--danger);
}

.stacked-admin-form{
    gap:0;
}

.stacked-admin-form label{
    margin-top:12px;
}

.stacked-admin-form button{
    align-self:flex-start;
    margin-top:15px;
}

.reset-effect-list{
    margin:0 0 4px;
    padding-left:20px;
    color:#5c6670;
    font-size:12px;
    line-height:1.55;
}

.reset-effect-list li{
    margin:4px 0;
}

.reset-button{
    background:var(--danger);
    color:#fff;
}

.archive-table{
    min-width:980px;
}

/* Settings */

.event-status-card{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:18px;
    padding:18px 20px;
    margin-bottom:18px;
    background:#fff;
    border:1px solid var(--border);
    border-left:4px solid var(--bosch-blue);
    border-radius:12px;
    box-shadow:var(--shadow);
}

.event-status-card h2{
    margin:4px 0 0;
    font-size:24px;
    text-transform:capitalize;
}

.settings-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:16px;
}

.settings-form .detail-action-button{
    margin-top:18px;
    align-self:flex-start;
}

.publication-state{
    display:flex;
    gap:12px;
    padding:14px;
    margin-bottom:15px;
    background:#f7f9fb;
    border:1px solid #e8edf0;
    border-radius:9px;
}

.publication-state-live{
    background:var(--success-soft);
    border-color:#cce8d6;
}

.publication-icon{
    flex:0 0 auto;
    font-size:22px;
}

.publication-state b{
    display:block;
    margin-bottom:3px;
}

.publication-state p{
    margin:0;
    color:var(--muted);
    font-size:12px;
    line-height:1.45;
}

.publish-button{
    margin-top:4px;
}

/* Admin login */

.admin-login-page{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
}

.admin-login-shell{
    width:min(430px, 100%);
}

.admin-login-card{
    padding:28px;
    background:#fff;
    border:1px solid var(--border);
    border-radius:16px;
    box-shadow:0 16px 42px rgba(25,47,68,.12);
}

.admin-login-mark{
    display:flex;
    align-items:center;
    justify-content:center;
    width:48px;
    height:48px;
    margin-bottom:14px;
    border-radius:12px;
    background:#eef6fb;
    font-size:23px;
}

.admin-login-card h1{
    margin:4px 0 7px;
    font-size:30px;
}

.admin-login-card>p{
    margin:0 0 18px;
    color:var(--muted);
    font-size:13px;
    line-height:1.5;
}

.admin-login-button{
    width:100%;
    margin-top:16px !important;
}

@media (max-width:900px){
    .template-meta-grid,
    .event-data-stats{
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }

    .event-data-actions-grid,
    .settings-grid{
        grid-template-columns:1fr;
    }
}

@media (max-width:760px){
    .tool-page-header{
        flex-direction:column;
    }

    .health-grid{
        grid-template-columns:1fr;
    }

    .health-card-ai{
        grid-column:auto;
    }

    .tool-page-links{
        width:100%;
    }

    .tool-page-links a{
        flex:1 1 auto;
        justify-content:center;
    }
}

@media (max-width:520px){
    .template-meta-grid,
    .event-data-stats,
    .health-detail-two-col{
        grid-template-columns:1fr;
    }

    .tool-card{
        padding:15px;
    }

    .tool-actions-row{
        flex-direction:column;
        align-items:stretch;
    }

    .tool-actions-row form,
    .tool-actions-row button,
    .admin-secondary-button{
        width:100%;
    }

    .editor-footer{
        flex-direction:column-reverse;
        align-items:stretch;
    }

    .case-save-button{
        width:100%;
    }

    .json-editor{
        min-height:480px;
    }

    .admin-login-card{
        padding:20px;
    }
}

/* =========================================================
   Leaderboard / Public Results
   ========================================================= */

.leaderboard-shell{
    max-width:1320px;
}

.leaderboard-header-mark{
    display:flex;
    align-items:center;
    justify-content:center;
    width:72px;
    height:72px;
    flex:0 0 72px;
    border-radius:18px;
    background:#fff7df;
    border:1px solid #f0dfab;
    box-shadow:var(--shadow);
    font-size:36px;
}

.leaderboard-empty-card{
    padding:46px 24px;
    text-align:center;
    background:#fff;
    border:1px solid var(--border);
    border-radius:14px;
    box-shadow:var(--shadow);
}

.leaderboard-empty-icon{
    font-size:38px;
}

.leaderboard-empty-card h2{
    margin:10px 0 6px;
}

.leaderboard-empty-card p{
    margin:0;
    color:var(--muted);
}

.podium-grid{
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:14px;
    align-items:end;
    margin-bottom:18px;
}

.podium-card{
    position:relative;
    padding:22px;
    text-align:center;
    background:#fff;
    border:1px solid var(--border);
    border-radius:14px;
    box-shadow:var(--shadow);
}

.podium-first{
    min-height:300px;
    padding-top:30px;
    border-top:5px solid #d7a900;
}

.podium-second{
    min-height:270px;
    border-top:5px solid #aab3bd;
}

.podium-third{
    min-height:250px;
    border-top:5px solid #b87333;
}

.podium-medal{
    font-size:38px;
}

.podium-rank{
    margin-top:4px;
    color:var(--muted);
    font-size:11px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.05em;
}

.podium-card h2{
    margin:9px 0 12px;
    font-size:22px;
    overflow-wrap:anywhere;
}

.podium-score{
    font-size:48px;
    line-height:1;
    font-weight:800;
}

.podium-score-label{
    margin:4px 0 10px;
    color:var(--muted);
    font-size:11px;
}

.podium-meta{
    display:flex;
    justify-content:center;
    gap:12px;
    margin-top:14px;
    color:var(--muted);
    font-size:11px;
}

.leaderboard-table{
    min-width:860px;
}

.leaderboard-score-cell{
    font-size:16px;
    font-weight:800;
}

.leaderboard-rank-medal{
    font-size:20px;
}

.top-three-row{
    background:#fffdf7;
}

.public-results-page{
    min-height:100vh;
}

.public-results-shell{
    max-width:980px;
}

.public-results-header{
    margin-bottom:24px;
    text-align:center;
}

.public-results-header h1{
    margin:5px 0 7px;
    font-size:clamp(36px, 6vw, 58px);
    line-height:1;
}

.public-results-header .page-subtitle{
    margin:0 auto;
}

.public-results-state{
    display:flex;
    gap:16px;
    align-items:flex-start;
    padding:26px;
    background:#fff;
    border:1px solid var(--border);
    border-left:4px solid var(--bosch-blue);
    border-radius:14px;
    box-shadow:var(--shadow);
}

.public-results-state-icon{
    flex:0 0 auto;
    font-size:30px;
}

.public-results-state h2{
    margin:4px 0 7px;
    font-size:23px;
}

.public-results-state p{
    margin:0;
    color:var(--muted);
    line-height:1.55;
}

.winner-hero{
    display:grid;
    grid-template-columns:150px minmax(0, 1fr);
    gap:24px;
    align-items:center;
    padding:30px;
    margin-bottom:18px;
    background:linear-gradient(135deg, #fff9e8 0%, #ffffff 72%);
    border:1px solid #eddca6;
    border-radius:16px;
    box-shadow:var(--shadow);
}

.winner-trophy{
    display:flex;
    align-items:center;
    justify-content:center;
    width:130px;
    height:130px;
    border-radius:50%;
    background:#fff3c8;
    font-size:66px;
}

.winner-copy h2{
    margin:5px 0 8px;
    font-size:clamp(30px, 5vw, 48px);
    line-height:1.05;
}

.winner-score{
    margin-top:8px;
    font-size:52px;
    line-height:1;
    font-weight:800;
}

.winner-score span{
    font-size:.3em;
    color:var(--muted);
}

.winner-grade{
    display:inline-flex;
    margin-top:10px;
    padding:6px 13px;
    border-radius:999px;
    background:#fff0b8;
    color:#765800;
    font-weight:800;
}

.winner-copy p{
    margin:14px 0 0;
    color:var(--muted);
    line-height:1.5;
}

.public-podium{
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:12px;
    margin-bottom:18px;
}

.public-podium-card{
    padding:18px;
    text-align:center;
    background:#fff;
    border:1px solid var(--border);
    border-radius:13px;
    box-shadow:var(--shadow);
}

.public-podium-first{
    border-top:4px solid #d7a900;
}

.public-podium-second{
    border-top:4px solid #aab3bd;
}

.public-podium-third{
    border-top:4px solid #b87333;
}

.public-podium-medal{
    font-size:30px;
}

.public-podium-rank{
    margin:3px 0 6px;
    color:var(--muted);
    font-size:10px;
    font-weight:800;
    text-transform:uppercase;
}

.public-podium-card h3{
    margin:0 0 8px;
    font-size:17px;
    overflow-wrap:anywhere;
}

.public-podium-card strong{
    display:block;
    font-size:28px;
}

.public-podium-card span{
    color:var(--muted);
    font-size:12px;
}

.public-ranking-card{
    padding:22px;
    background:#fff;
    border:1px solid var(--border);
    border-radius:14px;
    box-shadow:var(--shadow);
}

.public-ranking-heading{
    display:flex;
    justify-content:space-between;
    align-items:flex-end;
    gap:18px;
    margin-bottom:14px;
}

.public-ranking-heading h2{
    margin:4px 0 0;
    font-size:23px;
}

.public-ranking-heading>span{
    color:var(--muted);
    font-size:12px;
}

.public-ranking-list{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.public-ranking-row{
    display:grid;
    grid-template-columns:70px minmax(0, 1fr) auto;
    gap:12px;
    align-items:center;
    min-height:64px;
    padding:10px 13px;
    background:#f7f9fb;
    border:1px solid #e8edf0;
    border-radius:10px;
}

.public-ranking-top{
    background:#fffdf7;
    border-color:#efe2b7;
}

.public-ranking-position{
    text-align:center;
    font-size:20px;
    font-weight:800;
}

.public-ranking-name{
    display:flex;
    flex-direction:column;
    gap:2px;
    min-width:0;
}

.public-ranking-name b{
    overflow-wrap:anywhere;
}

.public-ranking-name span{
    color:var(--muted);
    font-size:11px;
}

.public-ranking-score{
    font-size:22px;
    font-weight:800;
    white-space:nowrap;
}

.public-ranking-score span{
    font-size:.5em;
    color:var(--muted);
}

@media (max-width:760px){
    .podium-grid{
        grid-template-columns:1fr;
        align-items:stretch;
    }

    .podium-first,
    .podium-second,
    .podium-third{
        min-height:unset;
    }

    .podium-first{
        order:-1;
    }

    .winner-hero{
        grid-template-columns:1fr;
        text-align:center;
    }

    .winner-trophy{
        margin:0 auto;
    }

    .public-podium{
        grid-template-columns:1fr;
    }
}

@media (max-width:520px){
    .leaderboard-header-mark{
        display:none;
    }

    .winner-hero{
        padding:22px 18px;
    }

    .winner-trophy{
        width:100px;
        height:100px;
        font-size:50px;
    }

    .winner-score{
        font-size:44px;
    }

    .public-ranking-card{
        padding:15px;
    }

    .public-ranking-row{
        grid-template-columns:52px minmax(0, 1fr) auto;
        padding:9px;
    }

    .public-ranking-position{
        font-size:17px;
    }

    .public-ranking-score{
        font-size:18px;
    }
}


/* --- Aktion im Eingabefeld: [ASK] / [INSPECT] / [TEARDOWN] --- */
.composer-field{
    display:flex;
    align-items:stretch;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:10px;
    overflow:hidden;
}

.composer-field:focus-within{
    border-color:var(--bosch-blue);
    box-shadow:0 0 0 3px rgba(0,123,192,.15);
}

.mode-select{
    appearance:none;
    -webkit-appearance:none;
    border:none;
    background:var(--surface-blue);
    color:var(--bosch-blue-dark);
    font-weight:700;
    font-size:16px;
    letter-spacing:.03em;
    padding:0 18px;
    cursor:pointer;
    border-right:1px solid var(--border);
    /* fuellt die Feldhoehe und zentriert das Verb in beiden Achsen */
    align-self:stretch;
    min-width:150px;
    text-align:center;
    text-align-last:center;
}

.mode-select:focus-visible{
    outline:2px solid var(--bosch-blue-dark);
    outline-offset:-2px;
}

.composer-field input[type="text"]{
    border:none !important;
    box-shadow:none !important;
    flex:1 1 auto;
    min-width:0;
}

.composer-field input[type="text"]:focus{
    outline:none;
}

.mode-hint{
    margin:0 0 10px;
    font-size:12px;
    color:var(--muted);
}

@media (max-width:760px){
    .composer-row{ grid-template-columns:minmax(0, 1fr) auto; }
}

.mode-hint-required{
    color:var(--warning);
    font-weight:600;
}



.mode-hint{
    margin:8px 0 0;
}
