/* Keyboard focus must not end up hidden behind the fixed app bar (64 px) when the browser scrolls (WCAG 2.4.11). */
html {
    scroll-padding-top: 72px;
}

h1:focus {
    outline: none;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "Ein Fehler ist aufgetreten.";
    }



/* User name in the app bar in normal case (MudBlazor buttons default to upper case). */
.mud-appbar .mud-button-root {
    text-transform: none;
}

/* Accessibility (WCAG AA): the current breadcrumb item uses the disabled colour by default (contrast 1.9:1). */
.mud-breadcrumb-item.mud-disabled > a[aria-current="page"] {
    color: var(--mud-palette-text-secondary);
}

/* Links must be recognisable without colour, also inside running text and tables. */
.mud-link.mud-link-underline-hover {
    text-decoration: underline;
}

/* Long German compounds (e.g. "Fahrzeugkombinationen") must not widen the page on phones. */
h1 {
    hyphens: auto;
    overflow-wrap: break-word;
}

/* Hidden but focusable form control, e.g. the file input inside an icon button. */
.gst-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.gst-file-button {
    position: relative;
    cursor: pointer;
}

.gst-file-button:focus-within {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* Visible keyboard focus (WCAG 2.4.7) for elements whose MudBlazor focus style is missing or too faint:
   links, breadcrumbs, the current navigation item, icon buttons in tables, the pager select, tabs and scrollable tables. */
a:focus-visible,
button:focus-visible,
[role="combobox"]:focus-visible,
[role="tab"]:focus-visible,
.mud-table-container:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* Data grid header: the sort and column-options icons are hidden until hover; show them on keyboard focus.
   The outline is drawn inside because the icon button clips its content. */
.mud-data-grid .column-header button:focus-visible {
    outline-offset: -2px;
}

.mud-data-grid .column-header button:focus-visible,
.mud-data-grid .column-header button:focus-visible .mud-icon-root {
    opacity: 0.8 !important; /* beats MudBlazor's hover-only rules */
}

/* Pager rows-per-page select: MudBlazor removes the outline of the select itself, so mark its visible box. */
.mud-table-pagination-select:focus-within .mud-input {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* Combination designer (side view). Units of the drawing are metres. */
.gst-designer {
    border: 1px dashed var(--mud-palette-lines-default);
    border-radius: 4px;
    background: var(--mud-palette-surface);
}

.gst-designer.gst-drop-target {
    border-color: var(--mud-palette-primary);
    background: var(--mud-palette-primary-hover);
}

.gst-designer svg {
    display: block;
    width: 100%;
    height: auto;
    touch-action: none;
}

/* MudBlazor sets a letter spacing that is far too wide at the drawing scale (1 unit = 1 m). */
.gst-designer svg text { letter-spacing: 0; }

.gst-sv-ground { stroke: var(--mud-palette-text-secondary); stroke-width: 0.04; }
.gst-sv-body { fill: #dfe6f0; stroke: var(--mud-palette-primary); stroke-width: 0.04; }
.gst-sv-cab { fill: #b9c8de; stroke: var(--mud-palette-primary); stroke-width: 0.04; }
.gst-sv-deck { fill: var(--mud-palette-primary); }
.gst-sv-wheel { fill: #424242; stroke: #fff; stroke-width: 0.06; }
.gst-sv-coupling { fill: var(--mud-palette-warning); }
.gst-sv-load { fill: rgba(163, 82, 0, 0.25); stroke: var(--mud-palette-warning); stroke-width: 0.06; cursor: grab; }
.gst-sv-load.gst-dragging { cursor: grabbing; fill: rgba(163, 82, 0, 0.4); }
.gst-sv-limit { stroke: var(--mud-palette-error); stroke-width: 0.03; stroke-dasharray: 0.2 0.15; }
.gst-sv-text { fill: var(--mud-palette-text-primary); font-size: 0.45px; font-family: Roboto, sans-serif; }
.gst-sv-text-small { fill: var(--mud-palette-text-secondary); font-size: 0.35px; font-family: Roboto, sans-serif; }
.gst-sv-text-limit { fill: var(--mud-palette-error); font-size: 0.35px; font-family: Roboto, sans-serif; }

/* Designer 3D view (vehicle-3d.js, Three.js) */
.gst-3d { height: 420px; border: 1px solid var(--mud-palette-lines-default); border-radius: 4px; overflow: hidden; touch-action: none; cursor: grab; }
.gst-3d:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }
.gst-3d canvas { display: block; }
@media (max-width: 600px) { .gst-3d { height: 300px; } }


/* ---------------------------------------------------------------- §70 configurator */

/* Status colours of check points (text colours reach 4.5:1 on their background). */
.st-blocker { background: #fdecea; color: #a4161a; border-color: #f2b8b5; }
.st-inreview { background: #e8f0fe; color: #1a4fa0; border-color: #b6ccf5; }
.st-open { background: #fff4e0; color: #8a4b00; border-color: #f5d29a; }
.st-supplement { background: #f3e8fd; color: #6a1b9a; border-color: #d7b8f0; }
.st-closed { background: #e7f4ea; color: #1e6b34; border-color: #b5dcc0; }

.gst-badge { display: inline-block; padding: 1px 8px; border-radius: 10px; border: 1px solid; font-size: .8rem; font-weight: 500; white-space: nowrap; margin-right: 4px; }

.gst-stepper { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; list-style: none; padding: 0; margin: 0; }
.gst-stepper li { border: 1px solid #d5d9e0; border-radius: 8px; padding: 10px 12px; background: #fff; }
.gst-stepper li.done { border-color: #7cc08f; background: #f1f9f3; }
.gst-stepper .nr { font-weight: 700; color: #5f6368; margin-right: 6px; }
.gst-stepper .state { display: block; margin-top: 4px; font-size: .8rem; color: #5f6368; }

.gst-dots { display: inline-flex; gap: 4px; }
.gst-dots span { width: 10px; height: 10px; border-radius: 50%; background: #d5d9e0; }
.gst-dots span.on { background: #2e7d32; }

.gst-path { border-left: 5px solid #9e9e9e; border-radius: 6px; padding: 10px 14px; background: #fff; height: 100%; }
.gst-path.above { border-left-color: #6a1b9a; }
.gst-path.below { border-left-color: #1a4fa0; }
.gst-path.open { border-left-color: #8a4b00; }
.gst-path ul { margin: 6px 0 0 18px; padding: 0; }

.gst-sketch { width: 100%; height: auto; max-height: 230px; }
.gst-sketch .nr { font-size: 11px; fill: #fff; font-weight: 700; }
.gst-sketch .load { font-size: 11px; fill: #333; }
.gst-sketch .dim { font-size: 12px; fill: #0d3a5c; }
.gst-sketch .ref { font-size: 12px; fill: #a35200; }
.gst-sketch .caption { font-size: 11px; fill: #5f6368; }

.gst-delta { font-size: .75rem; margin-left: 4px; font-weight: 600; }
.gst-delta.up { color: #a4161a; }
.gst-delta.down { color: #1e6b34; }
.gst-diff-cell { background: #fff8e1; }
.gst-warn-cell { background: #fdecea; }

.gst-edit-table td { padding: 2px 6px !important; vertical-align: middle; }
.gst-edit-table .mud-input-control { margin-top: 0; }
.gst-lifted td { opacity: .6; }

.gst-config-list .mud-list-item { border-left: 4px solid transparent; }
.gst-config-list .active { border-left-color: var(--mud-palette-primary); background: #eef3fb; }

.gst-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; align-items: start; }
.gst-board-col { border-radius: 8px; padding: 8px; border: 1px solid #d5d9e0; background: #fafbfc; }
.gst-board-col.highlight { box-shadow: 0 0 0 2px var(--mud-palette-primary); }
.gst-board-card { background: #fff; border: 1px solid #e0e3e8; border-radius: 6px; padding: 8px 10px; margin-top: 8px; }

.gst-timeline { list-style: none; padding: 0; margin: 0; }
.gst-timeline > li { border-left: 3px solid #b6ccf5; padding: 4px 0 12px 14px; }
.gst-timeline > li.revoked { border-left-color: #d5d9e0; opacity: .85; }
