/* DB0BLX Montagsrunde (plain CSS, prefixed mr-) */
.mr {
    --mr-red: #ef4444;
    --mr-red-dark: #dc2626;
    --mr-red-soft: #fee2e2;
    --mr-green: #16a34a;
    --mr-line: #e5e7eb;
    --mr-muted: #6b7280;
    font-size: 1rem;
    line-height: 1.5;
    color: #111827;
}

.mr-loading,
.mr-empty {
    padding: 2rem 0;
    color: var(--mr-muted);
}

/* toolbar */
.mr-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.mr-toolbar__label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.mr-toolbar__right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.mr-select,
.mr-input,
.mr-notes {
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background: #fff;
    padding: 0.375rem 0.625rem;
    font-size: 0.9375rem;
    color: inherit;
}

.mr-select {
    max-width: 100%;
}

.mr-input:focus,
.mr-select:focus,
.mr-notes:focus {
    outline: 2px solid var(--mr-red);
    outline-offset: 0;
    border-color: transparent;
}

.mr-input--tg {
    width: 6.5rem;
}

.mr-new {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.mr-user,
.mr-login {
    color: var(--mr-muted);
}

.mr-user a,
.mr-login {
    text-decoration: underline;
}

.mr-btn {
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background: #fff;
    padding: 0.375rem 0.875rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    white-space: nowrap;
}

.mr-btn--primary {
    background: var(--mr-red);
    border-color: var(--mr-red);
    color: #fff;
}

.mr-btn--primary:hover {
    background: var(--mr-red-dark);
}

/* live banner */
.mr-live {
    border: 1px solid var(--mr-line);
    border-radius: 0.5rem;
    background: #fff;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    transition: background 0.2s, border-color 0.2s;
}

.mr-live--on {
    background: var(--mr-red-soft);
    border-color: var(--mr-red);
}

.mr-live--archive {
    background: #f9fafb;
}

.mr-live__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.mr-live__meta {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-left: auto;
}

.mr-dot {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 9999px;
    background: #9ca3af;
    flex-shrink: 0;
}

.mr-dot--ok {
    background: var(--mr-green);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

.mr-speaker {
    font-size: 1.125rem;
}

.mr-speaker--idle {
    color: var(--mr-muted);
}

.mr-speaker__icon {
    margin-right: 0.25rem;
}

.mr-speaker__time {
    margin-left: 0.625rem;
    font-variant-numeric: tabular-nums;
    color: var(--mr-red-dark);
    font-weight: 700;
}

.mr-tg {
    display: inline-block;
    border-radius: 9999px;
    background: #111827;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.125rem 0.625rem;
}

.mr-meta {
    font-size: 0.875rem;
    color: var(--mr-muted);
}

.mr-listen {
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    text-decoration: underline;
}

/* layout */
.mr-grid {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .mr-grid--edit {
        grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
        align-items: start;
    }

    .mr-editor {
        position: sticky;
        top: 1rem;
    }
}

.mr-h2 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0 0 0.75rem;
}

.mr-h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 1.25rem 0 0.5rem;
}

.mr-h3 small {
    font-weight: 400;
    color: var(--mr-muted);
}

.mr-count {
    display: inline-block;
    min-width: 1.75rem;
    border-radius: 9999px;
    background: var(--mr-red);
    color: #fff;
    font-size: 0.8125rem;
    text-align: center;
    padding: 0 0.5rem;
    vertical-align: middle;
}

.mr-hint {
    color: var(--mr-muted);
    font-size: 0.875rem;
}

/* participant list */
.mr-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mr-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid var(--mr-line);
    border-radius: 0.5rem;
    background: #fff;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.mr-list--edit .mr-item {
    cursor: grab;
}

.mr-item--drag {
    opacity: 0.5;
}

.mr-item--speaking {
    background: var(--mr-red-soft);
    border-color: var(--mr-red);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
    animation: mr-pulse 1.6s ease-in-out infinite;
}

@keyframes mr-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.1); }
}

@media (prefers-reduced-motion: reduce) {
    .mr-item--speaking { animation: none; }
}

.mr-drop-target {
    border-color: var(--mr-red) !important;
    border-style: dashed !important;
}

.mr-handle {
    color: #9ca3af;
    font-size: 1.125rem;
    cursor: grab;
    user-select: none;
}

.mr-pos {
    width: 1.75rem;
    flex-shrink: 0;
    font-weight: 800;
    color: var(--mr-muted);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.mr-item__info {
    flex: 1;
    min-width: 0;
}

.mr-item__main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
}

.mr-call {
    font-weight: 800;
    letter-spacing: 0.02em;
}

a.mr-call:hover {
    text-decoration: underline;
}

.mr-name {
    color: #374151;
}

.mr-qth {
    font-size: 0.8125rem;
    color: var(--mr-muted);
}

.mr-stats {
    font-size: 0.8125rem;
    color: var(--mr-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.mr-note {
    width: 9rem;
    font-size: 0.8125rem;
    padding: 0.25rem 0.5rem;
}

.mr-actions {
    display: flex;
    gap: 0.25rem;
}

.mr-icon {
    width: 1.875rem;
    height: 1.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background: #fff;
    font-size: 0.75rem;
    cursor: pointer;
    line-height: 1;
}

.mr-icon:disabled {
    opacity: 0.35;
    cursor: default;
}

.mr-icon--del:hover {
    background: var(--mr-red-soft);
    border-color: var(--mr-red);
}

.mr-icon--add {
    background: var(--mr-red);
    border-color: var(--mr-red);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
}

.mr-dropzone {
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 0.625rem;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--mr-muted);
}

.mr-notes-label {
    display: block;
    margin-top: 1rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.mr-notes {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-weight: 400;
}

.mr-notes-view {
    margin-top: 1rem;
    white-space: pre-line;
}

/* editor */
.mr-editor {
    border: 1px solid var(--mr-line);
    border-radius: 0.5rem;
    background: #fff;
    padding: 1rem;
}

.mr-status {
    min-height: 1.25rem;
    font-size: 0.8125rem;
    color: var(--mr-muted);
    margin-bottom: 0.5rem;
}

.mr-field {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.mr-field--inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mr-add {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
    font-weight: 400;
}

.mr-add .mr-input {
    flex: 1;
    min-width: 0;
    text-transform: uppercase;
}

.mr-suggestions {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 26rem;
    overflow-y: auto;
}

.mr-sugg {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--mr-line);
    border-radius: 0.375rem;
    padding: 0.375rem 0.5rem;
    margin-bottom: 0.375rem;
    cursor: grab;
}

.mr-sugg .mr-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mr-sugg--speaking {
    background: var(--mr-red-soft);
    border-color: var(--mr-red);
}

@media (max-width: 640px) {
    .mr-item {
        flex-wrap: wrap;
    }

    .mr-handle {
        display: none;
    }

    .mr-note {
        order: 10;
        width: 100%;
    }

    .mr-live__meta {
        margin-left: 0;
    }
}

/* map */
.mr-mapbox {
    margin-bottom: 1.25rem;
}

.mr-mapbox[hidden] {
    display: none;
}

.mr-map {
    height: 380px;
    border: 1px solid var(--mr-line);
    border-radius: 0.5rem;
    background: #f3f4f6;
    z-index: 0;
}

@media (max-width: 640px) {
    .mr-map {
        height: 300px;
    }
}

.mr-map__hint {
    margin: 0.25rem 0 0;
    font-size: 0.75rem;
    color: var(--mr-muted);
}

.mr-map__hint:empty {
    display: none;
}

.mr-line {
    stroke: #1f2937;
    stroke-opacity: 0.7;
    stroke-dasharray: 6 5;
    fill: none;
}

.mr-line--trunk {
    stroke: #374151;
    stroke-opacity: 0.6;
    stroke-dasharray: none;
}

.mr-line--live {
    stroke: var(--mr-red);
    stroke-opacity: 0.95;
    stroke-dasharray: 10 8;
    animation: mr-flow 0.8s linear infinite;
}

@keyframes mr-flow {
    to { stroke-dashoffset: -18; }
}

.mr-dot-map {
    stroke: #111827;
    fill: #fff;
    fill-opacity: 1;
}

.mr-dot-map--live {
    stroke: var(--mr-red-dark);
    fill: var(--mr-red);
}

.mr-node--rpt span {
    display: block;
    width: 14px;
    height: 14px;
    background: #374151;
    border: 2px solid #fff;
    border-radius: 3px;
    transform: rotate(45deg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.mr-node--rpt.mr-node--live span {
    background: var(--mr-red);
}

.mr-node--hub span {
    display: block;
    border-radius: 9999px;
    background: #111827;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.leaflet-tooltip.mr-tip {
    font-size: 12px;
    padding: 2px 6px;
}

.leaflet-tooltip.mr-tip--rpt {
    background: #374151;
    color: #fff;
    border: 0;
    font-weight: 700;
    font-size: 11px;
}

.leaflet-tooltip.mr-tip--rpt::before {
    border-top-color: #374151;
}

.leaflet-tooltip.mr-tip--live {
    background: var(--mr-red);
    color: #fff;
    border: 0;
    font-weight: 700;
}

.leaflet-tooltip.mr-tip--live::before {
    border-top-color: var(--mr-red);
}

@media (prefers-reduced-motion: reduce) {
    .mr-line--live { animation: none; }
}

/* calm, slightly desaturated base map so the connection lines stand out */
.mr-map .leaflet-tile-pane {
    filter: grayscale(0.85) brightness(1.04) contrast(0.92);
}

/* ---------- summary & statistics ---------- */
.mr {
    --mr-bar: #dc2626;          /* single-series data colour (brand red, 4.8:1 on white) */
    --mr-track: #f3f4f6;
}

.mr-meta--strong {
    font-weight: 700;
    color: #111827;
}

.mr-muted {
    color: var(--mr-muted);
    font-weight: 400;
}

.mr-summary,
.mr-history {
    border: 1px solid var(--mr-line);
    border-radius: 0.5rem;
    background: #fff;
    padding: 1rem 1.25rem 1.25rem;
    margin-bottom: 1.25rem;
}

.mr-history:empty {
    display: none;
}

.mr-history {
    margin-top: 1.5rem;
}

.mr-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.75rem;
}

.mr-tile {
    border: 1px solid var(--mr-line);
    border-radius: 0.5rem;
    padding: 0.75rem 0.875rem;
    background: #f9fafb;
}

.mr-tile__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--mr-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mr-tile__value {
    font-size: 1.625rem;
    font-weight: 800;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.mr-tile__sub {
    font-size: 0.75rem;
    color: var(--mr-muted);
}

/* horizontal bars */
.mr-bars {
    display: grid;
    gap: 0.375rem;
}

.mr-bar {
    display: grid;
    grid-template-columns: minmax(8rem, 14rem) 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    outline: none;
}

.mr-bar:hover,
.mr-bar:focus-visible {
    background: #f9fafb;
}

.mr-bar__label {
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mr-bar__track {
    display: block;
    height: 14px;
    background: var(--mr-track);
    border-radius: 4px;
}

.mr-bar__fill {
    display: block;
    height: 100%;
    background: var(--mr-bar);
    border-radius: 0 4px 4px 0;
}

.mr-bar__value {
    font-size: 0.8125rem;
    color: #374151;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.mr-bars--regulars .mr-bar__fill {
    background: #374151;
}

/* timeline */
.mr-timeline {
    display: grid;
    gap: 0.25rem;
}

.mr-tl__row {
    display: grid;
    grid-template-columns: minmax(8rem, 14rem) 1fr;
    align-items: center;
    gap: 0.75rem;
}

.mr-tl__row--axis {
    margin-bottom: 0.125rem;
}

.mr-tl__axis {
    position: relative;
    height: 1.25rem;
    border-bottom: 1px solid #d1d5db;
}

.mr-tl__tick {
    position: absolute;
    bottom: 0.125rem;
    transform: translateX(-50%);
    font-size: 0.6875rem;
    color: var(--mr-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.mr-tl__lane {
    position: relative;
    height: 16px;
    background: repeating-linear-gradient(to right, transparent 0, transparent calc(10% - 1px), #f3f4f6 calc(10% - 1px), #f3f4f6 10%);
    border-radius: 3px;
}

.mr-tl__mark {
    position: absolute;
    top: 2px;
    bottom: 2px;
    min-width: 3px;
    background: var(--mr-bar);
    border-radius: 2px;
    box-shadow: 0 0 0 1px #fff;   /* 1px surface gap between neighbouring transmissions */
    outline: none;
    cursor: default;
}

.mr-tl__mark:hover,
.mr-tl__mark:focus-visible {
    background: #991b1b;
    top: 0;
    bottom: 0;
}

/* log table */
.mr-log {
    margin-top: 1rem;
    font-size: 0.875rem;
}

.mr-log summary {
    cursor: pointer;
    font-weight: 600;
    color: #374151;
}

.mr-log__scroll {
    max-height: 22rem;
    overflow: auto;
    margin-top: 0.5rem;
    border: 1px solid var(--mr-line);
    border-radius: 0.375rem;
}

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

.mr-table th,
.mr-table td {
    padding: 0.3125rem 0.625rem;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}

.mr-table th {
    position: sticky;
    top: 0;
    background: #f9fafb;
    font-size: 0.75rem;
    color: var(--mr-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mr-num {
    text-align: right !important;
    font-variant-numeric: tabular-nums;
}

/* column chart: participants per round */
.mr-cols {
    display: flex;
    align-items: stretch;
    gap: 2px;
    height: 10rem;
    padding-top: 1rem;
    border-bottom: 1px solid #d1d5db;
    overflow-x: auto;
}

.mr-col-bar {
    position: relative;
    flex: 1 0 1.75rem;
    max-width: 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    border: 0;
    background: transparent;
    padding: 0 0 1.25rem;
    cursor: pointer;
}

.mr-col-bar__fill {
    display: block;
    width: 60%;
    min-height: 2px;
    background: var(--mr-bar);
    border-radius: 4px 4px 0 0;
}

.mr-col-bar.is-current .mr-col-bar__fill {
    background: #991b1b;
}

.mr-col-bar:hover .mr-col-bar__fill,
.mr-col-bar:focus-visible .mr-col-bar__fill {
    background: #991b1b;
}

.mr-col-bar__value {
    font-size: 0.75rem;
    font-weight: 700;
    color: #374151;
    min-height: 1rem;
}

.mr-col-bar__date {
    position: absolute;
    bottom: 0;
    font-size: 0.6875rem;
    color: var(--mr-muted);
    white-space: nowrap;
}

/* tooltip */
.mr-tooltip {
    position: fixed;
    z-index: 9999;
    max-width: 18rem;
    padding: 0.375rem 0.625rem;
    background: #111827;
    color: #fff;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    line-height: 1.4;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.mr-tooltip[hidden] {
    display: none;
}

.mr-close {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--mr-line);
}

.mr-close .mr-btn {
    white-space: normal;
}

@media (max-width: 640px) {
    .mr-bar,
    .mr-tl__row {
        grid-template-columns: 6.5rem 1fr auto;
        gap: 0.5rem;
    }

    .mr-tl__row {
        grid-template-columns: 6.5rem 1fr;
    }
}

/* last speaker stays marked for a while after the PTT is released */
.mr-item--last {
    border-color: #fca5a5;
    background: #fff7f7;
}

.mr-speaker--last {
    color: #374151;
}

.mr-speaker__ago {
    margin-left: 0.5rem;
    font-size: 0.875rem;
    color: var(--mr-muted);
    font-variant-numeric: tabular-nums;
}

.mr-btn--dark {
    background: #111827;
    border-color: #111827;
    color: #fff;
}

.mr-btn--dark:hover {
    background: #374151;
}
