:root {
    --bg-start: #121212;
    --bg-end: #121212;
    --surface: #1e1e1e;
    --surface-alt: #1a1a1a;
    --border: #3a3a3a;
    --border-strong: #ed2024;
    --text: #f3f4f6;
    --text-muted: #a1a1aa;
    --accent: #ed2024;
    --accent-strong: #f04b4f;
    --ok: #2ecc71;
    --warn: #f39c12;
    --danger: #ff6b7c;
    --shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.28);
    --shadow-strong: 0 18px 34px rgba(0, 0, 0, 0.36);
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    color: var(--text);
    font-family: "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-start);
}

/* Layout-Header soll normal mitscrollen und nicht sticky bleiben. */
.judge-header {
    position: static !important;
    top: auto !important;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

.boot-info {
    min-height: 100vh;
    display: grid;
    place-items: center;
    color: var(--text);
    background: #121212;
}

h1 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: clamp(1.35rem, 1vw + 1rem, 1.75rem);
    letter-spacing: 0.01em;
}

h3 {
    margin: 0;
    font-size: 1rem;
}

.page-shell {
    width: min(1360px, 100%);
    margin: 0 auto;
    display: grid;
    gap: 18px;
    align-items: start;
}

.page-shell-workspace,
.page-shell-entry {
    grid-template-columns: 1fr;
}

.page-shell-workspace > .panel,
.page-shell-entry > .panel {
    grid-column: 1 / -1;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px 18px 16px;
    box-shadow: var(--shadow-soft);
}

.panel-login {
    width: min(480px, 100%);
    margin: 34px auto 0;
}

.panel h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: #f3f4f6;
    letter-spacing: 0.01em;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.panel-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.panel-text {
    margin-top: 0;
    color: #d1d5db;
    line-height: 1.45;
}

.loading-block {
    display: grid;
    gap: 8px;
}

.loading-progress {
    position: relative;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid #3f3f46;
    background: #1b1d23;
}

.loading-progress-bar {
    position: absolute;
    left: 0;
    top: 0;
    width: 36%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #ed2024, #f37278);
    animation: panel-loading-indeterminate 1.2s ease-in-out infinite;
}

@keyframes panel-loading-indeterminate {
    0% {
        transform: translateX(-130%);
    }

    100% {
        transform: translateX(320%);
    }
}

.login-form {
    display: grid;
    gap: 10px;
}

.hub-selection-block {
    margin-bottom: 12px;
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid #3f3f46;
    border-radius: 12px;
    background: rgba(27, 27, 30, 0.92);
}

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

.input-block {
    display: grid;
    gap: 6px;
}

.text-input {
    width: 100%;
    border: 1px solid #3f3f46;
    border-radius: 12px;
    padding: 12px 14px;
    background: #171717;
    color: #f3f4f6;
    font-size: 1rem;
    line-height: 1.3;
    min-height: 48px;
    -webkit-appearance: none;
}

.text-input:focus {
    outline: 2px solid rgba(237, 32, 36, 0.32);
    outline-offset: 1px;
    border-color: var(--accent);
}

.button-row {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.primary-button,
.secondary-button {
    border-radius: 12px;
    border: 1px solid var(--accent-strong);
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.01em;
    min-height: 48px;
    transition: background-color 0.12s ease, border-color 0.12s ease;
}

.primary-button {
    background: linear-gradient(180deg, #f04d53, #d2212b);
    color: #fff5f6;
}

.secondary-button {
    background: #202124;
    color: #e4e4e7;
}

.primary-button:hover:not(:disabled) {
    background: linear-gradient(180deg, #f3686d, #dc2f37);
}

.secondary-button:hover:not(:disabled) {
    background: #29292e;
    border-color: #f06c70;
}

.primary-button:disabled,
.secondary-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

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

.status-tile {
    border: 1px solid #3f3f46;
    border-top: 4px solid var(--border-strong);
    border-radius: 12px;
    padding: 10px 12px;
    background: #1a1a1a;
    display: grid;
    gap: 4px;
}

.status-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.panel-top-strip {
    padding-top: 12px;
    padding-bottom: 10px;
}

.workspace-menu-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.menu-chip {
    border: 1px solid #444;
    background: #202124;
    color: #f3f4f6;
    border-radius: 999px;
    padding: 8px 13px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

.menu-chip:hover {
    background: #2a2a2e;
    border-color: #5b5b61;
}

.menu-chip-active {
    border-color: #f06d70;
    background: #34191c;
    color: #fff3f4;
}

.menu-chip-complete {
    border-color: #3dcf85;
    background: #173227;
    color: #d6fbe8;
}

.panel-meta-compact {
    margin-top: 10px;
    margin-bottom: 0;
}

.workspace-active-meta-row {
    margin-top: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.workspace-active-meta-item {
    margin: 0;
}

.workspace-step-panel {
    min-height: 430px;
}

.show-group-shell {
    display: grid;
    gap: 14px;
}

.show-group {
    border: 1px solid #3f3f46;
    border-radius: 14px;
    padding: 10px;
    background: rgba(27, 27, 30, 0.9);
}

.show-group-header {
    margin-bottom: 9px;
    padding: 6px 8px;
    border-radius: 10px;
}

.show-group-header-current {
    background: rgba(237, 32, 36, 0.11);
    border: 1px solid rgba(237, 32, 36, 0.28);
}

.show-group-toggle {
    width: 100%;
    border: 1px solid #444;
    background: #202124;
    color: #f3f4f6;
    border-radius: 10px;
    padding: 10px 13px;
    min-height: 44px;
    display: flex;
    align-items: center;
    text-align: left;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 10px;
}

.show-group-toggle:hover {
    background: #2a2a2e;
}

.signature-status {
    display: grid;
    gap: 6px;
}

.signature-canvas-shell {
    display: grid;
    gap: 6px;
    margin-top: 2px;
}

.signature-preview-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    height: min(46vh, 340px);
    border: 2px solid #c6d4e7;
    border-radius: 12px;
    background: #ffffff;
    padding: 14px;
}

.signature-preview-image {
    width: 100%;
    max-width: 540px;
    max-height: 100%;
    object-fit: contain;
}

.signature-canvas {
    width: 100%;
    height: min(46vh, 340px);
    min-height: 240px;
    border: 2px solid #c6d4e7;
    border-radius: 12px;
    background: #ffffff;
    touch-action: none;
}

.competition-day-shell {
    display: grid;
    gap: 12px;
}

.competition-day-group {
    border: 1px solid #3f3f46;
    border-radius: 12px;
    background: rgba(26, 26, 26, 0.96);
    overflow: hidden;
}

.competition-day-header {
    margin: 0;
    padding: 8px 10px;
    border-bottom: 1px solid #ed2024;
    background: linear-gradient(90deg, #2d2d2d, #1e1e1e);
    color: #f3f4f6;
    font-weight: 800;
    text-transform: capitalize;
    letter-spacing: 0.01em;
}

.competition-place-group {
    padding: 9px 10px 10px;
    border-top: 1px solid rgba(99, 99, 106, 0.5);
}

.competition-place-group:first-of-type {
    border-top: 0;
}

.competition-place-title {
    margin: 0 0 8px;
    font-size: 0.93rem;
    color: #d4d4d8;
}

.list-grid {
    display: grid;
    gap: 10px;
    max-height: 420px;
    overflow: auto;
    padding-right: 2px;
}

.list-grid-competition {
    max-height: 260px;
}

/* Im Workspace soll nur die Seite selbst scrollen, keine internen Listen-Container. */
.page-shell-workspace .list-grid {
    max-height: none;
    overflow: visible;
    padding-right: 0;
}

.page-shell-workspace .list-grid-competition {
    max-height: none;
}

.list-item {
    text-align: left;
    border: 1px solid #444;
    border-left: 5px solid transparent;
    border-radius: 12px;
    background: #202124;
    padding: 14px;
    min-height: 56px;
    cursor: pointer;
    display: grid;
    gap: 3px;
}

.list-item:hover {
    border-color: #61616b;
    background: #2a2a2e;
}

.list-item:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    background: #17171a;
}

.list-item:disabled:hover {
    background: #17171a;
}

.list-item-selected {
    border-color: #f06d70;
    border-left-color: #f06d70;
    background: #2f181b;
    box-shadow: 0 0 0 2px rgba(240, 109, 112, 0.14);
}

.list-title {
    font-weight: 700;
    color: #f3f4f6;
    line-height: 1.25;
}

.competition-list-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.competition-judges-mid {
    display: block;
    text-align: center;
    font-size: 0.81rem;
    font-weight: 700;
    color: #c5d4eb;
    line-height: 1.3;
}

.competition-status-chip {
    flex-shrink: 0;
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    border-width: 1px;
    border-style: solid;
    border-radius: 999px;
    padding: 4px 9px;
    text-transform: uppercase;
}

.competition-status-chip-default {
    background: color-mix(in srgb, #94a3b8 18%, transparent);
    border-color: color-mix(in srgb, #94a3b8 54%, transparent);
    color: #cbd5e1;
}

.competition-status-chip-upcoming {
    background: color-mix(in srgb, #94a3b8 16%, transparent);
    border-color: color-mix(in srgb, #94a3b8 50%, transparent);
    color: #94a3b8;
}

.competition-status-chip-finished {
    background: color-mix(in srgb, #22c55e 20%, transparent);
    border-color: color-mix(in srgb, #22c55e 58%, transparent);
    color: #4ade80;
}

.competition-status-chip-running {
    background: color-mix(in srgb, #f59e0b 20%, transparent);
    border-color: color-mix(in srgb, #f59e0b 58%, transparent);
    color: #fbbf24;
}

.judge-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: stretch;
}

.judge-card-main {
    width: 100%;
    font: inherit;
    color: #f3f4f6;
    -webkit-appearance: none;
    text-align: left;
    border: 1px solid #444;
    border-left: 6px solid transparent;
    border-radius: 12px;
    background: #202124;
    padding: 14px;
    min-height: 56px;
    cursor: pointer;
    display: grid;
    gap: 3px;
}

.judge-card-main:hover {
    border-color: #61616b;
    background: #2a2a2e;
}

.judge-card-selected .judge-card-main {
    border-color: #f06d70;
    border-left-color: #f06d70;
    background: #2f181b;
    box-shadow: 0 0 0 2px rgba(240, 109, 112, 0.14);
}

.judge-card-signed .judge-card-main {
    border-left-color: #22c55e;
}

.judge-card-missing .judge-card-main {
    border-left-color: #64748b;
}

.judge-card-config {
    font: inherit;
    -webkit-appearance: none;
    border: 1px solid #4a4d56;
    border-radius: 12px;
    background: #1f2228;
    color: #dbe0ea;
    padding: 10px 12px;
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
}

.judge-card-config:hover {
    border-color: #7b8698;
    background: #2b2f38;
}

.judge-card-config-icon {
    font-size: 1rem;
}

.judge-signature-mark {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 900;
    border: 1px solid transparent;
}

.judge-signature-mark-ok {
    color: #22c55e;
    border-color: color-mix(in srgb, #22c55e 70%, transparent);
    background: color-mix(in srgb, #22c55e 20%, transparent);
}

.judge-signature-mark-ok::before {
    content: "\2713";
}

.judge-signature-mark-missing {
    color: #ef4444;
    border-color: color-mix(in srgb, #ef4444 70%, transparent);
    background: color-mix(in srgb, #ef4444 20%, transparent);
}

.judge-signature-mark-missing::before {
    content: "\2715";
}

.starter-card {
    border-left-width: 6px;
}

.starter-card-open {
    border-left-color: #64748b;
}

.starter-card-final {
    border-left-color: #22c55e;
}

.starter-card-withdrawn {
    border-left-color: #6b7280;
    opacity: 0.82;
}

.starter-status-chip {
    flex-shrink: 0;
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    border-width: 1px;
    border-style: solid;
    border-radius: 999px;
    padding: 4px 9px;
    text-transform: uppercase;
}

.starter-status-chip-open {
    background: color-mix(in srgb, #94a3b8 18%, transparent);
    border-color: color-mix(in srgb, #94a3b8 54%, transparent);
    color: #cbd5e1;
}

.starter-status-chip-final {
    background: color-mix(in srgb, #22c55e 20%, transparent);
    border-color: color-mix(in srgb, #22c55e 58%, transparent);
    color: #4ade80;
}

.starter-status-chip-withdrawn {
    background: color-mix(in srgb, #6b7280 18%, transparent);
    border-color: color-mix(in srgb, #6b7280 54%, transparent);
    color: #d1d5db;
    text-decoration: line-through;
    text-decoration-thickness: 4px;
}

.starter-text-withdrawn {
    text-decoration: line-through;
    text-decoration-thickness: 4px;
    opacity: 0.62;
}

.list-subtitle {
    font-size: 0.86rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.result-text,
.error-text {
    margin-top: 12px;
    font-weight: 700;
    border-left: 4px solid transparent;
    padding-left: 10px;
}

.result-text {
    color: #7eecb9;
    border-left-color: var(--ok);
}

.error-text {
    color: #ffd0d0;
    border-left-color: var(--danger);
}

.scoring-sticky-panel {
    position: sticky;
    top: 0;
    z-index: 95;
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
}

.scoring-sticky-inner {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: stretch;
}

.scoring-sticky-content {
    padding: 8px 10px 7px;
}

.scoring-current-competition {
    margin: 0 0 2px;
    font-size: 0.95rem;
    line-height: 1.2;
    font-weight: 900;
    color: #19395f;
    letter-spacing: 0.01em;
}

.scoring-sticky-headline {
    margin-bottom: 5px;
    font-weight: 700;
    font-size: 0.84rem;
    color: #406285;
}

.starter-compact-block {
    display: grid;
    gap: 3px;
}

.starter-main-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
    border-left: 3px solid #4f77a5;
    padding-left: 7px;
    justify-content: space-between;
}

.starter-nation-flag {
    font-size: 1.04rem;
    line-height: 1;
    flex-shrink: 0;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.starter-nation-flag-image {
    width: 24px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.starter-main-left {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    flex: 1 1 auto;
}

.starter-main-right {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    min-width: 0;
    flex: 1 1 auto;
}

.starter-inline-status-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    flex: 0 1 auto;
    padding: 0 4px;
}

.starter-horse-block {
    display: grid;
    gap: 1px;
    min-width: 0;
    justify-items: end;
}

.starter-nation-code {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #355980;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid #9bb4d5;
    background: #edf4ff;
}

.starter-rider-name {
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.14;
    font-weight: 800;
    color: #132941;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.starter-horse-name {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.2;
    font-weight: 700;
    color: #294668;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.starter-horse-breeding {
    font-size: 0.72rem;
    line-height: 1.2;
    font-weight: 600;
    color: #57769b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(46vw, 520px);
    text-align: right;
}

.starter-meta-inline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    padding-left: 7px;
    font-size: 0.74rem;
    color: #47688d;
}

.starter-meta-item {
    font-weight: 700;
}

.starter-meta-sep {
    opacity: 0.55;
    font-weight: 700;
}

.judge-live-status-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    padding-left: 0;
}

.judge-live-status-strip-inline {
    flex-wrap: nowrap;
    gap: 5px;
}

.judge-live-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid #b8cbdf;
    background: #eef5ff;
    color: #274769;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
}

.judge-live-status-chip-current {
    border-color: #b8cbdf;
    box-shadow: none;
}

.judge-live-status-position {
    letter-spacing: 0.02em;
    min-width: 18px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid #b8cbdf;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.68rem;
    font-weight: 800;
    color: #274769;
}

.judge-live-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.judge-live-status-key {
    font-size: 0.6rem;
    font-weight: 700;
    color: #2c4463;
    line-height: 1;
    white-space: nowrap;
}

.judge-live-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(17, 24, 39, 0.18);
}

.judge-live-status-dot-online {
    background: #2cb56a;
}

.judge-live-status-dot-offline {
    background: #d64c4c;
}

.judge-live-status-dot-final {
    background: #2cb56a;
    box-shadow: 0 0 0 1px rgba(44, 181, 106, 0.22);
}

.judge-live-status-dot-open {
    background: #f4b63f;
    box-shadow: 0 0 0 1px rgba(244, 182, 63, 0.24);
}

.judge-live-status-position-current {
    border-color: #dc2626;
    color: #dc2626;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.24);
}

.judge-live-status-position-accent-0 {
    background: #eef6ff;
    border-color: #9dc1e8;
    color: #244869;
}

.judge-live-status-position-accent-1 {
    background: #eefaf3;
    border-color: #9fd4b5;
    color: #235538;
}

.judge-live-status-position-accent-2 {
    background: #fff5ea;
    border-color: #e5c094;
    color: #6b4321;
}

.judge-live-status-position-accent-3 {
    background: #fff0f0;
    border-color: #dfb0b0;
    color: #6a2f2f;
}

.judge-live-status-position-accent-4 {
    background: #ecfbfd;
    border-color: #98d0d8;
    color: #1f5760;
}

.judge-live-status-position-accent-5 {
    background: #f1f4fb;
    border-color: #bcc8da;
    color: #304860;
}

.starter-nav-arrow {
    border: 0;
    border-left: 1px solid rgba(123, 150, 185, 0.45);
    border-right: 1px solid rgba(123, 150, 185, 0.45);
    background: linear-gradient(180deg, #eff5ff, #deebff);
    color: #2f4f76;
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.starter-nav-arrow:hover:not(:disabled) {
    background: linear-gradient(180deg, #dce9ff, #c7dbfa);
    color: #193b66;
}

.starter-nav-arrow:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.starter-nav-arrow-left {
    border-left: 0;
}

.starter-nav-arrow-right {
    border-right: 0;
}

.judge-score-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.judge-score-table th,
.judge-score-table td {
    border: 1px solid #d0dbeb;
    padding: 8px 9px;
    vertical-align: middle;
    font-size: 0.93rem;
    line-height: 1.32;
}

.judge-score-table th {
    background: #eaf2ff;
    color: #12263f;
    text-align: left;
    font-weight: 800;
}

.judge-score-table .col-nr {
    width: 52px;
    text-align: center;
}

.judge-score-table th.col-coeff {
    width: 50px;
    text-align: left;
    font-size: 0.84rem;
    font-weight: 600;
    padding-left: 7px;
}

.judge-score-table td.col-coeff {
    width: 50px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 500;
    color: #5a6f8a;
}

.judge-score-table tbody tr.lesson-section-break td {
    border-top: 4px solid #ed2024 !important;
}

.judge-score-table .col-note {
    width: 86px;
}

.judge-score-table .col-comment {
    width: 40%;
}

.judge-score-table .col-lesson {
    color: #1f3553;
    font-weight: 700;
}

.judge-lesson-line {
    font-size: 0.87rem;
    line-height: 1.28;
}

.judge-lesson-line + .judge-lesson-line {
    margin-top: 2px;
}

.judge-lesson-line-trend {
    display: flex;
    gap: 8px;
}

.judge-lesson-trend-marker {
    min-width: 50px;
    text-align: right;
    font-weight: 700;
    color: #17385f;
}

.judge-lesson-trend-text {
    min-width: 0;
}

.judge-nav-input {
    min-height: 42px;
    padding: 8px 11px;
    border-radius: 10px;
    font-size: 0.98rem;
}

.judge-input-readonly:disabled {
    background:
        repeating-linear-gradient(
            -45deg,
            rgba(188, 202, 223, 0.28) 0,
            rgba(188, 202, 223, 0.28) 8px,
            rgba(255, 255, 255, 0.88) 8px,
            rgba(255, 255, 255, 0.88) 16px
        ),
        #eef4fd !important;
    border-color: #b3c7e2 !important;
    color: #334155 !important;
}

.final-comment-row td {
    background: #f7fbff;
}

.final-comment-fullrow {
    padding: 6px;
}

.final-comment-layout {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.final-comment-label {
    width: clamp(160px, 20%, 240px);
    font-size: 0.9rem;
    font-weight: 800;
    color: #1f3553;
    display: inline-flex;
    align-items: center;
}

.final-comment-inline-input {
    flex: 1 1 auto;
    min-height: 84px;
    resize: vertical;
}

.finalize-footer {
    margin-top: 14px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    width: 100%;
}

.finalize-footer .judge-result-badge {
    grid-column: 1;
    justify-self: start;
}

.finalize-check-slot {
    grid-column: 2;
    display: grid;
    justify-items: center;
    gap: 6px;
    justify-self: center;
}

.finalize-check-icon-button {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 2px solid #d39d14;
    background: linear-gradient(180deg, #ffd34f, #f2b915);
    color: #573600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 14px rgba(138, 98, 8, 0.24);
}

.finalize-check-icon-button:hover:not(:disabled) {
    background: linear-gradient(180deg, #ffdc70, #f6c12b);
}

.finalize-check-icon-button:disabled {
    opacity: 0.62;
    cursor: not-allowed;
}

.finalize-check-icon-button-done {
    border-color: #2cb56a;
    background: linear-gradient(180deg, #37cf7a, #239654);
    color: #ffffff;
    box-shadow: 0 8px 14px rgba(24, 102, 59, 0.26);
}

.finalize-check-icon-symbol {
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1;
}

.finalize-signature-image {
    width: min(30vw, 140px);
    max-height: 42px;
    object-fit: contain;
    display: block;
}

.judge-result-badge {
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid #8fb0d8;
    background: #eef5ff;
    color: #163354;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.judge-error-badge {
    margin-top: 10px;
    max-width: 100%;
    min-height: 34px;
    width: fit-content;
    border-radius: 10px;
    border: 1px solid #dc2626;
    background: #fef2f2;
    color: #991b1b;
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.floating-menu-shell {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 70;
    display: grid;
    justify-items: end;
    gap: 10px;
}

.floating-menu-toggle {
    width: 58px;
    height: 58px;
    border-radius: 999px;
    border: 1px solid #86a8d4;
    background: linear-gradient(180deg, #3f6ea6, #24466f);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(24, 53, 86, 0.34);
}

.floating-menu-toggle:hover {
    background: linear-gradient(180deg, #4b7ab4, #2b527f);
}

.floating-menu-toggle-icon {
    font-size: 1.45rem;
    line-height: 1;
}

.floating-menu-panel {
    min-width: 320px;
    max-width: min(92vw, 360px);
    border-radius: 14px;
    border: 1px solid #a8bedc;
    background: #f8fbff;
    padding: 12px;
    display: grid;
    gap: 12px;
    box-shadow: 0 14px 28px rgba(20, 43, 68, 0.24);
}

.floating-menu-section {
    display: grid;
    gap: 8px;
}

.floating-menu-divider {
    height: 1px;
    background: #c8d8ec;
    margin: 0 -2px;
}

.floating-menu-section + .floating-menu-section {
    padding-top: 10px;
    border-top: 1px solid #d6e2f2;
}

.floating-menu-section-navigation {
    gap: 10px;
}

.floating-menu-title {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #365a85;
}

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

.floating-menu-switch-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1f3553;
}

.floating-menu-switch-state {
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #365a85;
}

.floating-menu-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 50px;
    height: 28px;
    cursor: pointer;
}

.floating-menu-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.floating-menu-switch-slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    border: 1px solid #aec4e0;
    background: #dbe7f6;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.floating-menu-switch-slider::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(22, 51, 84, 0.25);
    transition: transform 0.16s ease;
}

.floating-menu-switch input:checked + .floating-menu-switch-slider {
    background: linear-gradient(180deg, #4b7ab4, #2f5f94);
    border-color: #2f5f94;
}

.floating-menu-switch input:checked + .floating-menu-switch-slider::before {
    transform: translateX(21px);
}

.floating-menu-switch input:focus-visible + .floating-menu-switch-slider {
    outline: 2px solid rgba(63, 110, 166, 0.35);
    outline-offset: 1px;
}

.floating-menu-counters {
    display: grid;
    gap: 8px;
}

.floating-menu-counter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.floating-menu-counter-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1f3553;
    line-height: 1.2;
}

.floating-menu-counter-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.floating-menu-counter-button {
    width: 30px;
    height: 30px;
    border: 1px solid #aec4e0;
    border-radius: 8px;
    background: #ffffff;
    color: #1f3553;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1;
    padding: 0;
}

.floating-menu-counter-button:hover:not(:disabled) {
    background: #edf4ff;
    border-color: #8fb0d8;
}

.floating-menu-counter-button:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.floating-menu-counter-value {
    min-width: 28px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 900;
    color: #163354;
}

.floating-menu-select-label {
    font-size: 0.8rem;
    font-weight: 800;
    color: #365a85;
}

.floating-menu-select {
    width: 100%;
    min-height: 38px;
    border-radius: 10px;
    border: 1px solid #aec4e0;
    background: #ffffff;
    color: #163354;
    font-weight: 700;
    padding: 8px 10px;
}

.floating-menu-select:focus {
    outline: 2px solid rgba(54, 90, 133, 0.24);
    outline-offset: 0;
}

.floating-menu-select:disabled {
    opacity: 0.62;
    cursor: not-allowed;
}

.field-missing {
    border-color: #dc2626 !important;
    background: #fef2f2;
}

.field-comment-required {
    border-color: rgba(220, 38, 38, 0.45) !important;
    background: #fff8f8;
}

/* Der Scoring-Bereich bleibt explizit hell, auch wenn die Menüs dunkel sind. */
.page-shell-entry.scoring-light > .panel {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.95)),
        #ffffff;
    border-color: #d7e1ef;
    box-shadow: 0 12px 24px rgba(31, 52, 84, 0.14);
    color: #1e293b;
}

.page-shell-entry.scoring-light {
    touch-action: pan-y;
}

.page-shell-entry.scoring-light > .scoring-sticky-panel {
    background:
        linear-gradient(120deg, rgba(244, 250, 255, 0.98), rgba(234, 244, 255, 0.96) 62%, rgba(255, 243, 245, 0.96)),
        #f8fbff;
    border-color: #b8cce7;
    box-shadow: 0 12px 22px rgba(35, 62, 92, 0.16);
}

.page-shell-entry.scoring-light .starter-nav-arrow {
    background: linear-gradient(180deg, #ecf3ff, #dce9ff);
    color: #2b4f7b;
}

.page-shell-entry.scoring-light .starter-nav-arrow:hover:not(:disabled) {
    background: linear-gradient(180deg, #dbe9ff, #cadefb);
}

.page-shell-entry.scoring-light .judge-nav-input {
    border-color: #a8c0de;
    background: #ffffff;
    color: #10233d;
}

.page-shell-entry.scoring-light .judge-input-readonly:disabled {
    background:
        repeating-linear-gradient(
            -45deg,
            rgba(166, 188, 216, 0.26) 0,
            rgba(166, 188, 216, 0.26) 8px,
            rgba(255, 255, 255, 0.9) 8px,
            rgba(255, 255, 255, 0.9) 16px
        ),
        #eef4fd !important;
}

.page-shell-entry.scoring-light .starter-rider-name {
    color: #152f4a;
}

.page-shell-entry.scoring-light .starter-horse-name {
    color: #2f4b6b;
}

.page-shell-entry.scoring-light .starter-horse-breeding {
    color: #4c6b8e;
}

.page-shell-entry.scoring-light .starter-nation-code {
    background: #eef5ff;
}

.page-shell-entry.scoring-light .final-comment-row td {
    background: #f7fbff;
}

.page-shell-entry.scoring-light .panel h2 {
    color: #1e293b;
}

.page-shell-entry.scoring-light .panel-text {
    color: #3e4f68;
}

.page-shell-entry.scoring-light .loading-progress {
    border-color: #c0d1e8;
    background: #e6eef8;
}

.page-shell-entry.scoring-light .loading-progress-bar {
    background: linear-gradient(90deg, #6d99d2, #9abbe2);
}

.page-shell-entry.scoring-light .panel-meta {
    color: #64748b;
}

.page-shell-entry.scoring-light .text-input {
    border-color: #bfcee3;
    background: #ffffff;
    color: #1f2937;
    font-size: 1rem;
    font-weight: 700;
}

.page-shell-entry.scoring-light .text-input:disabled {
    color: #334155;
    -webkit-text-fill-color: #334155;
    background: #eef4fd;
    border-color: #b5c9e4;
    opacity: 1;
}

.page-shell-entry.scoring-light .secondary-button {
    background: #eef4fd;
    color: #264161;
    border-color: #8fb3e4;
}

.page-shell-entry.scoring-light .secondary-button:hover:not(:disabled) {
    background: #e0ecfb;
    border-color: #79a6df;
}

.page-shell-entry.scoring-light .status-tile {
    border-color: #b8cae3;
    background: #f5f9ff;
}

.page-shell-entry.scoring-light .status-label {
    color: #526581;
}

.page-shell-entry.scoring-light .list-item {
    border-color: #c6d4e7;
    background: #ffffff;
}

.page-shell-entry.scoring-light .list-item:hover {
    border-color: #8eb1df;
    background: #f3f8ff;
}

.page-shell-entry.scoring-light .list-item-selected {
    border-color: #6d99d2;
    border-left-color: #6d99d2;
    background: #e8f1ff;
    box-shadow: 0 0 0 2px rgba(109, 153, 210, 0.2);
}

.page-shell-entry.scoring-light .list-title {
    color: #1e293b;
}

.page-shell-entry.scoring-light .list-subtitle {
    color: #5c6d86;
}

.page-shell-entry.scoring-light .result-text {
    color: #1f6f3f;
}

.page-shell-entry.scoring-light .error-text {
    color: #b4232d;
}

.page-shell-entry.scoring-light .judge-score-table th {
    color: #0f172a;
    background: #eef4fd;
    border-color: #b8cae3;
    font-size: 0.95rem;
}

.page-shell-entry.scoring-light .judge-score-table td {
    color: #1f2937;
    background: #ffffff;
    border-color: #c8d5e8;
    font-size: 0.95rem;
}

.page-shell-entry.scoring-light .judge-score-table tbody tr:nth-child(even) td {
    background: #f8fbff;
}

.page-shell-entry.scoring-light .judge-score-table .col-lesson {
    color: #1f3553;
    font-weight: 700;
    line-height: 1.38;
}

.page-shell-entry.scoring-light .judge-score-table td.col-coeff {
    color: #526a87;
}

@media (pointer: coarse) {
    .page-shell {
        gap: 22px;
    }

    .panel {
        border-radius: 20px;
        padding: 20px 20px 18px;
    }

    .button-row {
        gap: 12px;
    }

    .text-input {
        min-height: 52px;
        font-size: 1.02rem;
    }

    .primary-button,
    .secondary-button {
        min-height: 52px;
        padding: 13px 18px;
    }

    .list-item {
        min-height: 62px;
        padding: 16px;
    }

    .judge-card-main {
        min-height: 62px;
        padding: 16px;
    }

    .judge-card-config {
        min-height: 62px;
    }

    .status-grid {
        gap: 14px;
    }

    .scoring-sticky-panel {
        padding: 0;
    }

    .starter-nav-arrow {
        min-height: 56px;
        font-size: 1.65rem;
    }

    .judge-nav-input {
        min-height: 46px;
    }

    .final-comment-inline-input {
        min-height: 92px;
    }

    .floating-menu-toggle {
        width: 64px;
        height: 64px;
    }
}

@media (max-width: 900px) {
    .form-grid,
    .status-grid {
        grid-template-columns: 1fr;
    }

    .panel {
        padding: 14px;
    }

    .workspace-step-panel {
        min-height: 0;
    }

    .list-grid {
        max-height: 320px;
    }

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

    .judge-card-config {
        min-height: 48px;
        justify-content: center;
    }

    .signature-preview-shell {
        min-height: 220px;
        height: min(42vh, 300px);
        padding: 10px;
    }

    .scoring-sticky-panel {
        padding: 0;
    }

    .scoring-sticky-inner {
        grid-template-columns: 34px minmax(0, 1fr) 34px;
    }

    .scoring-sticky-content {
        padding: 7px 8px 6px;
    }

    .scoring-current-competition {
        font-size: 0.84rem;
    }

    .starter-nav-arrow {
        font-size: 1.15rem;
    }

    .starter-main-inline,
    .starter-meta-inline {
        padding-left: 5px;
    }

    .starter-main-inline {
        gap: 6px;
        flex-wrap: wrap;
    }

    .starter-main-left,
    .starter-main-right {
        min-width: 0;
    }

    .starter-inline-status-slot {
        flex: 1 1 100%;
        justify-content: flex-start;
        padding-left: 5px;
        padding-right: 0;
        order: 3;
    }

    .starter-rider-name {
        font-size: 0.84rem;
    }

    .starter-horse-name {
        font-size: 0.76rem;
    }

    .starter-horse-breeding {
        font-size: 0.66rem;
        max-width: min(52vw, 300px);
    }

    .starter-meta-inline {
        font-size: 0.68rem;
    }

    .judge-live-status-strip {
        gap: 5px;
        justify-content: center;
        padding-left: 0;
    }

    .judge-live-status-strip-inline {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 4px;
    }

    .judge-live-status-chip {
        min-height: 22px;
        padding: 2px 7px;
        font-size: 0.66rem;
    }

    .judge-live-status-position {
        width: 16px;
        height: 16px;
        min-width: 16px;
        font-size: 0.62rem;
    }

    .judge-live-status-dot {
        width: 8px;
        height: 8px;
    }

    .judge-live-status-key {
        font-size: 0.54rem;
    }

    .starter-nation-code {
        font-size: 0.66rem;
        padding: 1px 5px;
    }

    .starter-nation-flag {
        font-size: 0.94rem;
    }

    .starter-nation-flag-image {
        width: 22px;
        height: 15px;
        object-fit: contain;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .workspace-active-meta-row {
        gap: 10px;
    }

    .judge-score-table th,
    .judge-score-table td {
        padding: 7px 6px;
        font-size: 0.86rem;
    }

    .judge-score-table .col-nr {
        width: 40px;
    }

    .judge-score-table th.col-coeff {
        width: 42px;
        font-size: 0.78rem;
        padding-left: 5px;
    }

    .judge-score-table td.col-coeff {
        width: 42px;
        text-align: center;
        font-size: 0.7rem;
    }

    .judge-score-table .col-note {
        width: 72px;
    }

    .judge-score-table .col-comment {
        width: 42%;
    }

    .judge-nav-input {
        min-height: 38px;
        padding: 6px 8px;
        font-size: 0.92rem;
    }

    .judge-lesson-line {
        font-size: 0.8rem;
    }

    .judge-lesson-line-trend {
        gap: 6px;
    }

    .judge-lesson-trend-marker {
        min-width: 44px;
    }

    .final-comment-inline-input {
        min-height: 86px;
    }

    .final-comment-layout {
        gap: 8px;
    }

    .final-comment-label {
        width: clamp(140px, 24%, 200px);
        font-size: 0.86rem;
    }

    .finalize-footer {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    }

    .finalize-signature-image {
        width: min(40vw, 120px);
        max-height: 36px;
    }

    .judge-result-badge {
        min-height: 40px;
        font-size: 0.9rem;
    }

    .floating-menu-shell {
        right: 12px;
        bottom: 12px;
    }

    .floating-menu-panel {
        min-width: min(86vw, 320px);
    }

    .floating-menu-toggle {
        width: 54px;
        height: 54px;
    }
}
