/* =====================================================================
   AISMaps 7 – Stylesheet
   Ersetzt Main_4_0_0.css, leaflet.css, MarkerCluster*.css, Bootstrap und
   jQuery-UI. Farben als Variablen, helles und dunkles Schema.
   ===================================================================== */

:root {
    --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;

    --surface: #ffffff;
    --surface-muted: #f3f5f8;
    --surface-glass: rgba(255, 255, 255, 0.92);
    --text: #14202e;
    --text-muted: #5b6b7d;
    --border: #d5dce5;
    --accent: #0b5cad;
    --accent-soft: #e3effc;
    --danger: #c92a2a;
    --warning: #e8a400;
    --shadow: 0 2px 10px rgba(16, 32, 52, 0.18);
    --radius: 10px;

    --sea: #aad3df;

    /* Schiffsfarben (Farbgruppen der alten Karte, ergaenzt) */
    --k0: #8a929c;   /* Sonstige */
    --k1: #f2c200;   /* Lotse, Schlepper */
    --k2: #13b8cc;   /* Spezialfahrzeuge */
    --k3: #2f6fe4;   /* Passagier */
    --k4: #2f9e44;   /* Fracht */
    --k5: #e03131;   /* Tanker */
    --k6: #e8590c;   /* Fischerei */
    --k7: #c2255c;   /* Sport, Segeln */
    --k8: #7950f2;   /* Hochgeschwindigkeit */
    --k20: #343a40;  /* Basisstation */
    --k21: #d6336c;  /* Navigationshilfe */
    --k22: #fd7e14;  /* Tonne */
    --k23: #fcc419;  /* Leuchtturm */

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --surface: #17212d;
        --surface-muted: #202c3a;
        --surface-glass: rgba(23, 33, 45, 0.92);
        --text: #e6edf5;
        --text-muted: #9aabbd;
        --border: #2f3e50;
        --accent: #5aa2ff;
        --accent-soft: #1d3350;
        --shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
        color-scheme: dark;
    }
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: var(--surface-muted);
    overflow: hidden;
}

button {
    font: inherit;
    color: inherit;
}

.icon {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}

.mono {
    font-family: var(--font-mono);
    font-size: 13px;
}

/* ---------------------------------------------------------------------
   Laden, Fehler
   --------------------------------------------------------------------- */

.app-loading {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: var(--sea);
    color: #10233d;
    font-size: 15px;
}

.app-loading button {
    padding: 8px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 4px solid rgba(16, 35, 61, 0.2);
    border-top-color: #0b5cad;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#blazor-error-ui {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5000;
    padding: 10px 16px;
    background: #fff3bf;
    color: #5c3c00;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.2);
}

#blazor-error-ui .reload {
    margin-left: 12px;
}

#blazor-error-ui .dismiss {
    float: right;
    cursor: pointer;
}

/* ---------------------------------------------------------------------
   Kartenengine (MapView)
   --------------------------------------------------------------------- */

.map-app {
    position: fixed;
    inset: 0;
}

.tz-map {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: var(--sea);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    outline: none;
    cursor: grab;
}

.tz-map.is-dragging {
    cursor: grabbing !important;
}

.tz-map-zoom {
    position: absolute;
    inset: 0;
}

@keyframes tz-zoom-a {
    from { scale: var(--tz-zoom-from); }
    to { scale: 1; }
}

@keyframes tz-zoom-b {
    from { scale: var(--tz-zoom-from); }
    to { scale: 1; }
}

.tz-map-pane {
    position: absolute;
    left: 0;
    top: 0;
    will-change: transform;
}

.tz-map-ghost {
    transform-origin: 0 0;
}

.tz-tile-layer {
    position: absolute;
    left: 0;
    top: 0;
}

.tz-tile {
    position: absolute;
    width: 256px;
    height: 256px;
    max-width: none;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    animation: tz-tile-in 0.25s ease-out;
}

.tz-map-ghost .tz-tile {
    animation: none;
}

@keyframes tz-tile-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tz-vector {
    position: absolute;
    left: 0;
    top: 0;
    overflow: visible;
    pointer-events: none;
}

.tz-map-controls {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.tz-map-controls > * {
    pointer-events: auto;
}

.tz-zoom-control {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.tz-zoom-control button {
    width: 38px;
    height: 38px;
    border: 0;
    background: var(--surface);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.tz-zoom-control button + button {
    border-top: 1px solid var(--border);
}

.tz-zoom-control button:hover:not(:disabled) {
    background: var(--accent-soft);
}

.tz-zoom-control button:disabled {
    color: var(--text-muted);
    cursor: default;
}

.tz-map-bottom-left {
    position: absolute;
    left: 12px;
    bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    pointer-events: none;
}

.tz-mouse-position {
    display: flex;
    flex-direction: column;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--surface-glass);
    font-family: var(--font-mono);
    font-size: 12px;
    white-space: pre;
}

.tz-mouse-position .decimal {
    color: var(--text-muted);
    font-size: 11px;
}

.tz-scale {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tz-scale-bar {
    padding: 0 4px;
    border: 2px solid #1f2d3d;
    border-top: 0;
    background: rgba(255, 255, 255, 0.75);
    color: #1f2d3d;
    font-size: 11px;
    line-height: 15px;
    white-space: nowrap;
}

.tz-scale-bar.nautical {
    border-top: 2px solid #1f2d3d;
    border-bottom: 0;
}

.tz-map-attribution {
    position: absolute;
    right: 0;
    bottom: 0;
    max-width: 70%;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.78);
    color: #33475b;
    font-size: 11px;
    border-top-left-radius: 6px;
}

/* ---------------------------------------------------------------------
   Schiffe
   --------------------------------------------------------------------- */

.ship .ship-shape {
    fill: var(--k0);
    stroke: rgba(10, 20, 30, 0.75);
    stroke-width: 1;
    stroke-linejoin: round;
}

.ship.k1 .ship-shape { fill: var(--k1); }
.ship.k2 .ship-shape { fill: var(--k2); }
.ship.k3 .ship-shape { fill: var(--k3); }
.ship.k4 .ship-shape { fill: var(--k4); }
.ship.k5 .ship-shape { fill: var(--k5); }
.ship.k6 .ship-shape { fill: var(--k6); }
.ship.k7 .ship-shape { fill: var(--k7); }
.ship.k8 .ship-shape { fill: var(--k8); }
.ship.k20 .ship-shape { fill: var(--k20); stroke: #fff; }
.ship.k21 .ship-shape { fill: var(--k21); stroke: #fff; }
.ship.k22 .ship-shape { fill: var(--k22); }
.ship.k23 .ship-shape { fill: var(--k23); }

.ship.selected .ship-shape {
    stroke: #ffd43b;
    stroke-width: 2.5;
}

.ship-selection {
    fill: rgba(255, 212, 59, 0.18);
    stroke: #f59f00;
    stroke-width: 2;
    animation: pulse 1.2s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { opacity: 1; }
    to { opacity: 0.25; }
}

.ship-vector {
    stroke: rgba(10, 20, 30, 0.8);
    stroke-width: 1.5;
    stroke-dasharray: 4 3;
}

.ship-label {
    font-family: var(--font);
    font-size: 11px;
    font-weight: 600;
    fill: #10233d;
    stroke: rgba(255, 255, 255, 0.92);
    stroke-width: 3px;
    stroke-linejoin: round;
    paint-order: stroke;
}

.ship.selected .ship-label {
    font-size: 12px;
    fill: #000;
}

.cluster .cluster-halo {
    fill: rgba(47, 111, 228, 0.25);
}

.cluster .cluster-core {
    fill: rgba(47, 111, 228, 0.9);
    stroke: #fff;
    stroke-width: 1.5;
}

.cluster.medium .cluster-halo { fill: rgba(240, 160, 0, 0.28); }
.cluster.medium .cluster-core { fill: rgba(230, 150, 0, 0.92); }
.cluster.large .cluster-halo { fill: rgba(232, 89, 12, 0.3); }
.cluster.large .cluster-core { fill: rgba(232, 89, 12, 0.92); }
.cluster.huge .cluster-halo { fill: rgba(201, 42, 42, 0.3); }
.cluster.huge .cluster-core { fill: rgba(201, 42, 42, 0.92); }

.cluster-count {
    fill: #fff;
    font-size: 12px;
    font-weight: 700;
    text-anchor: middle;
}

/* ---------------------------------------------------------------------
   Track, Gebiete, Sensoren
   --------------------------------------------------------------------- */

.track-history {
    fill: none;
    stroke: #2b8a3e;
    stroke-width: 3;
    stroke-linejoin: round;
    stroke-linecap: round;
    opacity: 0.85;
}

.track-arrow {
    fill: #2b8a3e;
    stroke: #fff;
    stroke-width: 1;
}

.track-forecast {
    fill: none;
    stroke: #e03131;
    stroke-width: 2.5;
    stroke-dasharray: 7 5;
    stroke-linecap: round;
}

.track-forecast-point circle {
    fill: #fff;
    stroke: #e03131;
    stroke-width: 2;
}

.track-forecast-point text {
    font-size: 11px;
    font-weight: 600;
    fill: #a51111;
    stroke: #fff;
    stroke-width: 3px;
    paint-order: stroke;
}

.track-highlight {
    fill: none;
    stroke: #10233d;
    stroke-width: 2;
}

.area .area-shape {
    fill: var(--area-color);
    fill-opacity: 0.08;
    stroke: var(--area-color);
    stroke-width: 1.5;
}

.area .area-line {
    fill: none;
    stroke: var(--area-color);
    stroke-width: 3;
}

.area .area-direction {
    fill: none;
    stroke: #1c7ed6;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 6 4;
    animation: march 0.8s linear infinite;
}

@keyframes march {
    to { stroke-dashoffset: -10; }
}

.area-label {
    font-size: 11px;
    font-weight: 600;
    fill: #10233d;
    stroke: #fff;
    stroke-width: 3px;
    paint-order: stroke;
}

.sensor .gauge {
    fill: #e03131;
    stroke: #fff;
    stroke-width: 1.5;
}

.sensor .wind path {
    fill: currentColor;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.sensor .wind circle {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
}

.sensor .wind .wind-station {
    fill: currentColor;
}

.sensor .wind-label {
    fill: currentColor;
    font-size: 10px;
    font-weight: 700;
    text-anchor: middle;
    stroke: #fff;
    stroke-width: 3px;
    paint-order: stroke;
}

.wind.bft-low { color: #2b8a3e; }
.wind.bft-moderate { color: #e67700; }
.wind.bft-strong { color: #d9480f; }
.wind.bft-gale { color: #c92a2a; }

.sensor.selected .gauge,
.sensor.selected .wind {
    filter: drop-shadow(0 0 3px #ffd43b);
}

/* ---------------------------------------------------------------------
   Werkzeugleiste und Menues
   --------------------------------------------------------------------- */

.toolbar {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.toolbar-logo {
    display: flex;
    align-items: center;
    padding: 0 6px;
}

.toolbar-logo img {
    height: 22px;
}

.toolbar-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

.toolbar-button:hover {
    background: var(--surface-muted);
}

a.toolbar-button {
    color: inherit;
    text-decoration: none;
}

.toolbar-button.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.toolbar-user {
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0 0 0 6px;
    padding-left: 8px;
    border-left: 1px solid var(--border);
}

.toolbar-user-name {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 160px;
    overflow: hidden;
    color: var(--text-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toolbar-title {
    padding: 0 10px;
    font-weight: 600;
}

.panel-host {
    position: absolute;
    top: 64px;
    left: 12px;
    z-index: 1001;
    width: 320px;
    max-height: calc(100% - 130px);
    overflow: auto;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    animation: drop-in 0.12s ease-out;
}

@keyframes drop-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

.panel {
    padding: 8px 14px 14px;
}

.panel h2 {
    margin: 12px 0 6px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.panel-list {
    display: flex;
    flex-direction: column;
}

.panel-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 4px;
    border-radius: 6px;
    cursor: pointer;
}

.panel-option:hover {
    background: var(--surface-muted);
}

.panel-option input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--accent);
}

.panel-count {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 12px;
}

.panel-slider {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 4px;
}

.panel-slider input {
    width: 100%;
    accent-color: var(--accent);
}

.panel-note {
    margin: 10px 4px 0;
    color: var(--text-muted);
}

.panel-note.error {
    color: var(--danger);
}

.swatch {
    flex: none;
    width: 14px;
    height: 14px;
    border: 1px solid rgba(0, 0, 0, 0.35);
    border-radius: 3px;
    background: var(--k0);
}

.swatch.g0, .swatch.k3 { background: var(--k3); }
.swatch.g1, .swatch.k4 { background: var(--k4); }
.swatch.g2, .swatch.k5 { background: var(--k5); }
.swatch.g3, .swatch.k1 { background: var(--k1); }
.swatch.k2 { background: var(--k2); }
.swatch.k6 { background: var(--k6); }
.swatch.k7 { background: var(--k7); }
.swatch.k8 { background: var(--k8); }
.swatch.k21 { background: var(--k21); }

.search-panel {
    padding-top: 14px;
}

.search-field {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
    color: var(--text-muted);
}

.search-field:focus-within {
    border-color: var(--accent);
}

.search-field input {
    flex: 1;
    min-width: 0;
    height: 38px;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    font: inherit;
}

.search-results {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.search-results button {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
        "swatch name match"
        "swatch meta match";
    align-items: center;
    column-gap: 10px;
    width: 100%;
    padding: 8px 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.search-results button:hover,
.search-results button:focus-visible {
    background: var(--accent-soft);
}

.search-results .swatch { grid-area: swatch; }
.search-name { grid-area: name; font-weight: 600; }
.search-meta { grid-area: meta; color: var(--text-muted); font-size: 12px; }
.search-match { grid-area: match; color: var(--text-muted); font-size: 11px; }

/* ---------------------------------------------------------------------
   Detailkarte
   --------------------------------------------------------------------- */

.ship-card {
    position: absolute;
    left: 12px;
    top: 64px;
    z-index: 999;
    width: 340px;
    max-height: calc(100% - 130px);
    overflow: auto;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.ship-card.dragging {
    opacity: 0.92;
}

.ship-card-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px 10px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    cursor: move;
    touch-action: none;
}

.ship-flag {
    flex: none;
    border: 1px solid var(--border);
    border-radius: 2px;
    object-fit: cover;
}

.ship-card-titles {
    flex: 1;
    min-width: 0;
}

.ship-card-titles h2 {
    margin: 0;
    overflow: hidden;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ship-card-titles p {
    margin: 2px 0 0;
    color: var(--text-muted);
    font-size: 12px;
}

.icon-button {
    display: inline-flex;
    padding: 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
}

.icon-button:hover {
    background: var(--surface-muted);
}

.ship-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px 4px;
}

.ship-card-actions button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
}

.ship-card-actions button:hover {
    border-color: var(--accent);
}

.ship-card-actions button.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.ship-card-note {
    margin: 8px 12px;
    color: var(--text-muted);
    font-size: 12px;
}

.card-section {
    border-top: 1px solid var(--border);
}

.card-section:first-of-type {
    margin-top: 8px;
}

.card-section-header {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    background: transparent;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.card-section-header:hover {
    background: var(--surface-muted);
}

.card-section-body {
    padding: 0 12px 10px;
}

.facts {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 5px 10px;
    margin: 0;
}

.sensor-card .facts {
    padding: 10px 12px;
}

.facts dt {
    color: var(--text-muted);
}

.facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.drag-surface {
    position: fixed;
    inset: 0;
    z-index: 4000;
    cursor: move;
    touch-action: none;
}

/* ---------------------------------------------------------------------
   Hinweise
   --------------------------------------------------------------------- */

.map-tooltip {
    position: absolute;
    z-index: 1500;
    max-width: 320px;
    padding: 5px 9px;
    border-radius: 6px;
    background: rgba(16, 28, 42, 0.92);
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    transform: translate(14px, -50%);
}

.status-bar {
    position: absolute;
    left: 50%;
    bottom: 26px;
    z-index: 900;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--surface-glass);
    box-shadow: var(--shadow);
    color: var(--text-muted);
    font-size: 12px;
    transform: translateX(-50%);
    pointer-events: none;
}

.status-bar:empty {
    display: none;
}

.connection-banner {
    position: absolute;
    top: 12px;
    left: 50%;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: calc(100% - 24px);
    padding: 8px 14px;
    border-radius: var(--radius);
    background: #fff3bf;
    color: #5c3c00;
    box-shadow: var(--shadow);
    transform: translateX(-50%);
}

.connection-banner.error {
    background: #ffe3e3;
    color: #8a1c1c;
}

.connection-banner button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid currentColor;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
}

.toast {
    position: absolute;
    left: 50%;
    bottom: 64px;
    z-index: 2000;
    padding: 10px 16px;
    border-radius: var(--radius);
    background: rgba(16, 28, 42, 0.92);
    color: #fff;
    transform: translateX(-50%);
    animation: drop-in 0.15s ease-out;
}

/* ---------------------------------------------------------------------
   Anmeldung und Meldungsseiten
   --------------------------------------------------------------------- */

.login-page,
.message-page {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(160deg, #0b3d6e 0%, #1d6fa3 55%, #aad3df 100%);
    overflow: auto;
}

.login-card {
    width: min(380px, 100%);
    padding: 28px 28px 24px;
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.login-logo {
    display: block;
    width: 200px;
    max-width: 100%;
    margin: 0 auto 12px;
}

.login-card h1 {
    margin: 8px 0 4px;
    font-size: 22px;
}

.login-hint {
    margin: 0 0 18px;
    color: var(--text-muted);
}

.login-error {
    margin: 0 0 14px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #ffe3e3;
    color: #8a1c1c;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    font-weight: 600;
}

.login-field input {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
    color: var(--text);
    font: inherit;
    font-weight: 400;
}

.login-field input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 0;
}

.login-validation {
    margin: -6px 0 10px;
    color: var(--danger);
    font-size: 12px;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 18px;
}

.login-submit {
    width: 100%;
    height: 42px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.login-submit:hover {
    filter: brightness(1.08);
}

.login-footer {
    margin-top: 18px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
}

.message-page {
    color: #fff;
    text-align: center;
}

.message-page a {
    color: #fff;
}

/* ---------------------------------------------------------------------
   Schmale Bildschirme
   --------------------------------------------------------------------- */

@media (max-width: 640px) {
    .toolbar-label,
    .toolbar-user-name,
    .toolbar-logo {
        display: none;
    }

    .panel-host {
        left: 8px;
        right: 8px;
        width: auto;
    }

    /* Detailkarte als Leiste am unteren Rand */
    .ship-card {
        left: 0 !important;
        right: 0;
        top: auto !important;
        bottom: 0;
        width: auto;
        max-height: 55%;
        border-radius: 14px 14px 0 0;
    }

    .ship-card-header {
        cursor: default;
    }

    .status-bar,
    .tz-mouse-position {
        display: none;
    }

    .tz-map-attribution {
        max-width: 100%;
    }
}

/* ---------------------------------------------------------------------
   Phase 2: Fotos, Schleusen, OpCIS, Wiedergabe
   --------------------------------------------------------------------- */

.icon.flip {
    transform: scaleX(-1);
}

.ship-photo {
    position: relative;
    display: block;
    width: 100%;
    max-height: 190px;
    padding: 0;
    border: 0;
    background: #0b1a2a;
    cursor: zoom-in;
    overflow: hidden;
}

.ship-photo img {
    display: block;
    width: 100%;
    max-height: 190px;
    object-fit: cover;
}

.ship-photo-count {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 12px;
}

.photo-viewer {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(5, 12, 20, 0.85);
    outline: none;
}

.photo-viewer-frame {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(1100px, 100%);
    max-height: 100%;
    padding: 12px;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.photo-viewer-frame header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.photo-viewer-count {
    margin-left: auto;
    color: var(--text-muted);
    font-weight: 400;
}

.photo-viewer-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: #0b1a2a;
    border-radius: 6px;
}

.photo-viewer-stage img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.photo-viewer-stage img.thumbnail-only {
    min-width: 320px;
    image-rendering: auto;
}

.photo-nav {
    position: absolute;
    top: 50%;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    color: #10233d;
    cursor: pointer;
    transform: translateY(-50%);
}

.photo-nav.prev { left: 10px; }
.photo-nav.next { right: 10px; }

.photo-viewer-note {
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
}

.photo-strip {
    display: flex;
    gap: 6px;
    overflow-x: auto;
}

.photo-strip button {
    flex: none;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    background: none;
    cursor: pointer;
}

.photo-strip button.active {
    border-color: var(--accent);
}

.photo-strip img {
    display: block;
    width: 72px;
    height: 48px;
    object-fit: cover;
}

.lock-site .lock-badge {
    fill: rgba(255, 255, 255, 0.95);
    stroke: #10233d;
    stroke-width: 1;
}

.lock-site.selected .lock-badge {
    stroke: #f59f00;
    stroke-width: 2;
}

.lock-chamber { stroke: #10233d; stroke-width: 0.8; }
.lock-chamber.free { fill: #2f9e44; }
.lock-chamber.closed { fill: #e03131; }
.lock-chamber.restricted { fill: #f59f00; }
.lock-chamber.unknown { fill: #adb5bd; }

.lock-anchor {
    fill: #10233d;
}

.lock-wait {
    fill: #10233d;
    font-size: 11px;
    font-weight: 600;
}

.lock-state {
    font-weight: 600;
}

.lock-state.free { color: #2b8a3e; }
.lock-state.closed { color: #c92a2a; }
.lock-state.restricted { color: #e67700; }

.lock-until {
    color: var(--text-muted);
    font-size: 12px;
}

.opcis-legend {
    position: absolute;
    top: 104px;
    right: 12px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 260px;
    padding: 8px 10px;
    border-radius: var(--radius);
    background: var(--surface-glass);
    box-shadow: var(--shadow);
    font-size: 12px;
}

.opcis-legend div {
    display: flex;
    flex-direction: column;
}

.replay-panel {
    position: absolute;
    left: 50%;
    bottom: 34px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(760px, calc(100% - 24px));
    padding: 10px 14px;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    transform: translateX(-50%);
}

.replay-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.replay-row label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.replay-row input,
.replay-row select {
    height: 34px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-muted);
    color: var(--text);
    font: inherit;
}

.replay-load,
.replay-play {
    height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.replay-load:disabled {
    opacity: 0.6;
    cursor: default;
}

.replay-play {
    width: 44px;
    padding: 0;
}

.replay-timeline {
    flex: 1;
    min-width: 160px;
    accent-color: var(--accent);
}

.replay-info {
    color: var(--text-muted);
    font-size: 12px;
}

.replay-info strong {
    color: var(--text);
    font-size: 14px;
}

.replay-warning,
.replay-message {
    color: var(--danger);
}

.replay-message {
    margin: 0;
}

.map-app.replay .status-bar {
    display: none;
}

@media (max-width: 640px) {
    .replay-panel {
        bottom: 24px;
    }

    .opcis-legend {
        top: 100px;
        max-width: 200px;
    }
}

/* ---------------------------------------------------------------------
   Replay-Website (Zugangsschluessel)
   --------------------------------------------------------------------- */

.token-languages {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    color: var(--text-muted);
}

.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    cursor: pointer;
}

.link-button:hover {
    text-decoration: underline;
}

.link-button[aria-pressed="true"] {
    color: var(--text);
    font-weight: 600;
}

.token-replay .toolbar-title {
    max-width: min(420px, 50vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
