.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* WaferGuard dashboard styling */

:root {
    --wg-navy: #0f1f52;
    --wg-navy-dark: #0a1638;
    --wg-blue: #2952e3;
    --wg-bg: #f4f6fb;
    --wg-card: #ffffff;
    --wg-border: #e2e6f0;
    --wg-text: #1c2333;
    --wg-text-muted: #6b7280;
    --wg-success: #1a9e6b;
    --wg-danger: #d0342c;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    background: var(--wg-bg);
    color: var(--wg-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a {
    color: var(--wg-blue);
    text-decoration: none;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--wg-navy);
    color: #cdd6f4;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 0;
}

.sidebar-brand {
    padding: 0 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.75rem;
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
}

.brand-subtitle {
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: #8891c2;
    text-transform: uppercase;
}

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1.25rem;
    color: #cdd6f4;
    font-size: 0.92rem;
}

.sidebar-nav li a i, .logout-button i {
    font-size: 1rem;
    width: 1.1rem;
    text-align: center;
}

.sidebar-nav li a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.sidebar-nav li a.active {
    background: var(--wg-blue);
    color: #fff;
    font-weight: 600;
}

.logout-button {
    margin: 0.75rem 1.25rem 0;
    padding: 0.55rem 1rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #cdd6f4;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.logout-button:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.logout-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background: var(--wg-navy);
    color: #fff;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.topbar-agent {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.topbar-agent.agent-connected {
    color: #8fe3a8;
}

.topbar-agent.agent-disconnected {
    color: #ffd27a;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #cdd6f4;
}

.content {
    flex: 1;
    padding: 1.75rem 2rem;
    max-width: 100%;
    overflow-x: auto;
}

.chart-title {
    font-weight: 700;
    color: var(--wg-blue);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.label-edit-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin: 0.25rem 0 0.5rem;
}

.label-edit-input {
    flex: 1;
    max-width: 320px;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--wg-border);
    border-radius: 6px;
    font-size: 1rem;
}

.icon-button {
    background: none;
    border: none;
    color: var(--wg-text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0 0.25rem;
}

.icon-button:hover {
    color: var(--wg-blue);
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--wg-navy-dark);
}

.auth-card {
    width: 360px;
    background: var(--wg-card);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

.auth-brand {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
}

.auth-brand .brand-title {
    color: var(--wg-navy);
}

.auth-brand .brand-subtitle {
    color: var(--wg-text-muted);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.page-header h1 {
    font-size: 1.4rem;
    margin: 0;
}

.panel {
    background: var(--wg-card);
    border: 1px solid var(--wg-border);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.panel-title {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--wg-text-muted);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    background: var(--wg-card);
    border: 1px solid var(--wg-border);
    border-radius: 10px;
    padding: 1rem;
}

.stat-card-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--wg-blue);
    letter-spacing: 0.03em;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.stat-card-values {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
}

.stat-card {
    min-width: 0;
}

/* Events on their own line at the bottom of every card, so the value row never overflows. */
.stat-card-events {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 0.6rem;
    padding-top: 0.45rem;
    border-top: 1px solid var(--wg-border);
}

.stat-card-events .stat-value-label {
    display: inline;
}

.stat-card-events-value {
    font-size: 0.95rem;
    font-weight: 600;
}

.stat-value-label {
    font-size: 0.7rem;
    color: var(--wg-text-muted);
    display: block;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

.chart-panel {
    background: var(--wg-card);
    border: 1px solid var(--wg-border);
    border-radius: 10px;
    padding: 1rem;
}

.chart-container {
    position: relative;
    width: 100%;
}

.chart-click-target {
    cursor: pointer;
}

/* Persistent pan control shown under EnableZoom charts (the individual parameter graph only -
   see LineChart.razor's EnableZoom param and charts.js's initScrollbar). Thumb width/position
   track the chart's current zoom window, like a native scrollbar. */
.chart-hscroll {
    position: relative;
    height: 10px;
    margin-top: 0.6rem;
    background: var(--wg-border);
    border-radius: 5px;
}

.chart-hscroll-thumb {
    position: absolute;
    top: 0;
    height: 100%;
    min-width: 20px;
    background: var(--wg-blue);
    border-radius: 5px;
    cursor: grab;
}

.chart-hscroll-thumb:active {
    cursor: grabbing;
}

/* Splits the "Shipment Summary" panel's own content area (not the stat-card grid or charts
   below it, which stay full-width) into the existing summary info on the left and the
   Damage Risk Score on the right - see ShipmentSummaryPanel.razor's ShowRiskScore param. */
.shipment-summary-split {
    display: flex;
    gap: 1.5rem;
}

.shipment-summary-main {
    flex: 1 1 60%;
    min-width: 0;
}

.shipment-summary-risk {
    flex: 1 1 40%;
    min-width: 0;
    border-left: 1px solid var(--wg-border);
    padding-left: 1.5rem;
}

@media (max-width: 720px) {
    .shipment-summary-split {
        flex-direction: column;
    }

    .shipment-summary-risk {
        border-left: none;
        border-top: 1px solid var(--wg-border);
        padding-left: 0;
        padding-top: 1.25rem;
    }
}

.risk-score-panel {
    height: 100%;
}

.risk-score-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.risk-ring {
    --pct: 0;
    --risk-ring-color: var(--wg-success);
    flex: none;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: conic-gradient(var(--risk-ring-color) calc(var(--pct) * 3.6deg), var(--wg-border) 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.risk-ring::before {
    content: "";
    position: absolute;
    inset: 9px;
    border-radius: 50%;
    background: var(--wg-card);
}

.risk-ring-value {
    position: relative;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--wg-navy);
    line-height: 1;
}

.risk-ring-value small {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--wg-text-muted);
}

.risk-band-label {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.risk-band-label.risk-band-low {
    color: var(--wg-success);
}

.risk-band-label.risk-band-elevated {
    color: #b8860b;
}

.risk-band-label.risk-band-high {
    color: var(--wg-danger);
}

.risk-band-description {
    font-size: 0.8rem;
    color: var(--wg-text-muted);
    line-height: 1.35;
}

.risk-factor-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--wg-border);
}

.risk-factor-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.85rem;
    gap: 0.75rem;
}

.risk-factor-label {
    color: var(--wg-text);
}

.risk-factor-value {
    font-weight: 700;
    white-space: nowrap;
}

.risk-factor-value-warning {
    color: #b8860b;
}

.risk-factor-value-critical {
    color: var(--wg-danger);
}

.risk-factor-empty {
    color: var(--wg-text-muted);
    font-size: 0.85rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th, .data-table td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--wg-border);
}

.data-table th {
    color: var(--wg-text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(26, 158, 107, 0.12);
    color: var(--wg-success);
}

.badge-warning {
    background: rgba(212, 148, 16, 0.12);
    color: #b8860b;
}

.badge-danger {
    background: rgba(208, 52, 44, 0.12);
    color: var(--wg-danger);
}

.btn {
    display: inline-block;
    padding: 0.55rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--wg-border);
    background: #fff;
    color: var(--wg-text);
    cursor: pointer;
    font-size: 0.9rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.btn-block {
    display: block;
    width: 100%;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--wg-border);
    border-radius: 6px;
    font-size: 0.9rem;
}

.alert {
    padding: 0.7rem 0.9rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.alert-danger {
    background: rgba(208, 52, 44, 0.1);
    color: var(--wg-danger);
    border: 1px solid rgba(208, 52, 44, 0.25);
}

.alert-info {
    background: rgba(41, 82, 227, 0.08);
    color: var(--wg-blue);
    border: 1px solid rgba(41, 82, 227, 0.2);
}

.upload-dropzone {
    border: 2px dashed var(--wg-border);
    border-radius: 10px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--wg-text-muted);
    background: #fbfcff;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--wg-text-muted);
}

/* Combined sensor chart (Dashboard) */

.combined-sensor-row {
    display: flex;
    gap: 1rem;
    align-items: stretch;
    margin-bottom: 1.25rem;
}

.combined-chart-col {
    flex: 3 1 0;
    min-width: 0;
}

.combined-box-col {
    flex: 1 1 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--wg-card);
    border: 1px solid var(--wg-border);
    border-radius: 10px;
    padding: 1rem;
}

@media (max-width: 900px) {
    .combined-sensor-row {
        flex-direction: column;
    }
}

.sensor-toggle-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.sensor-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--wg-text-muted);
    cursor: pointer;
    user-select: none;
}

.sensor-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.sensor-toggle .toggle-track {
    position: relative;
    width: 30px;
    height: 16px;
    border-radius: 999px;
    background: #d7dce6;
    transition: background 0.15s ease;
    flex-shrink: 0;
}

.sensor-toggle .toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease;
}

.sensor-toggle input:checked + .toggle-track {
    background: var(--toggle-color, var(--wg-blue));
}

.sensor-toggle input:checked + .toggle-track .toggle-thumb {
    transform: translateX(14px);
}

.sensor-toggle i {
    color: var(--toggle-color, var(--wg-text-muted));
}

/* The "All" master switch, set apart from the per-sensor ones by a divider. */
.sensor-toggle-all {
    --toggle-color: var(--wg-navy, #0f1f52);
    padding-right: 0.75rem;
    border-right: 1px solid #d7dce6;
}

.combined-chart-container {
    margin-bottom: 0.75rem;
}

.cursor-readout {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    padding: 0.6rem 0.75rem;
    background: #fbfcff;
    border: 1px solid var(--wg-border);
    border-radius: 8px;
    font-size: 0.82rem;
    min-height: 2.4rem;
    align-items: center;
}

.cursor-readout-time {
    font-weight: 700;
    color: var(--wg-text);
    width: 100%;
    margin-bottom: 0.15rem;
}

.cursor-readout-row {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.cursor-readout-swatch {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.cursor-readout-label {
    color: var(--wg-text-muted);
}

.cursor-readout-value {
    font-weight: 600;
}

.cursor-readout-hint {
    color: var(--wg-text-muted);
    font-style: italic;
}

/* Cardboard box (accelerometer orientation + shock shake) - a real three.js
   scene (wwwroot/js/box3d.js). Two full-size stacked canvases share one
   scene/camera: the bottom canvas renders the interior only (shell hidden),
   the top canvas renders the closed box and is masked with a CSS
   radial-gradient at the cursor, so a circular "window" reveals the
   interior underneath as the cursor moves - an x-ray magnifier with no
   second camera needed. The ring div is created by box3d.js and just
   follows the cursor to frame the window. */

.wafer-box-scene {
    position: relative;
    text-align: center;
    height: 260px;
    max-width: 320px;
    margin: 0 auto;
}

.wafer-box-canvas,
.wafer-lens-canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.wafer-box-canvas {
    z-index: 1;
}

.wafer-lens-canvas {
    z-index: 2;
    cursor: crosshair;
}

.wafer-box-lens-ring {
    position: absolute;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    border: 2px solid var(--wg-blue);
    box-shadow:
        0 0 0 4px rgba(41, 82, 227, 0.12),
        inset 0 0 24px rgba(41, 82, 227, 0.12);
    z-index: 3;
    display: none;
}

.wafer-box-lens-ring.active {
    display: block;
}

.wafer-box-hint {
    font-size: 0.72rem;
    color: var(--wg-text-muted);
    text-align: center;
    margin-top: 0.25rem;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 22, 56, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
}

.modal-dialog {
    width: 100%;
    max-width: 380px;
    background: var(--wg-card);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

.modal-dialog p {
    color: var(--wg-text-muted);
    font-size: 0.85rem;
    margin: 0.5rem 0 1.25rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* test_tilt branch: formula-comparison checkboxes shown under the Tilt parameter graph only
   - see ParameterDetail.razor. Not meant to survive once a final formula is picked. */
.tilt-formula-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.tilt-formula-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.tilt-formula-swatch {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 2px;
}

.tilt-direction-summary {
    flex-basis: 100%;
    padding-top: 0.6rem;
    margin-top: 0.2rem;
    border-top: 1px solid var(--wg-border);
    font-size: 0.85rem;
    color: var(--wg-text-muted);
}

.tilt-direction-summary strong {
    color: var(--wg-navy);
}

/* Tilt graph + 3D orientation view, 70/30 per the feature request - see ParameterDetail.razor. */
.tilt-orientation-split {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.tilt-orientation-chart {
    flex: 1 1 70%;
    min-width: 0;
}

.tilt-orientation-3d {
    flex: 1 1 30%;
    min-width: 0;
}

.tilt-3d-canvas-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
}

.tilt-3d-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.tilt-3d-caption {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    color: var(--wg-text-muted);
    text-align: center;
}

@media (max-width: 900px) {
    .tilt-orientation-split {
        flex-direction: column;
    }

    .tilt-orientation-3d {
        max-width: 320px;
        margin: 0 auto;
    }
}

/* Shock detail: X / Y / Z signed-peak toggles above the graph. */
.shock-axis-toggles {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
}

.form-group .shock-axis-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    cursor: pointer;
}

/* Undo .form-group input's full-width text-field styling for these checkboxes. */
.form-group .shock-axis-toggle input {
    width: auto;
    padding: 0;
    margin: 0;
}

/* Dashboard: shipment picker in the top panel's title row. */
.dashboard-shipment-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.dashboard-shipment-picker {
    min-width: 16rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--wg-border);
    border-radius: 6px;
    font-size: 0.9rem;
    text-transform: none;
    letter-spacing: normal;
}

.badge-latest {
    background: #e0e7ff;
    color: #3730a3;
    text-transform: none;
}

/* Parameter detail: short "what this graph shows" explanation (Vibration). */
.parameter-explainer {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--wg-text);
}

.parameter-explainer p {
    margin: 0 0 0.5rem;
}

.parameter-explainer ul {
    margin: 0 0 0.5rem;
    padding-left: 1.25rem;
}

.parameter-explainer-note {
    color: var(--wg-text-muted);
    font-size: 0.8rem;
}

/* Lumi Sensors logo. The PNG has a white background, so on the navy sidebar it sits on a
   white tile; on the white auth card it needs none. */
.brand-logo-tile {
    display: inline-flex;
    align-self: flex-start;
    margin-top: 0.6rem;
    padding: 0.35rem 0.5rem;
    background: #fff;
    border-radius: 6px;
}

.brand-logo-tile img {
    display: block;
    height: 34px;
    width: auto;
}

.auth-logo {
    display: block;
    align-self: flex-start; /* .auth-brand is a flex column - don't stretch the logo to its width */
    height: 52px;
    width: auto;
    margin-bottom: 0.75rem;
}

/* Damage Risk Score: the number in the ring opens the "how is this calculated" popup. */
.risk-ring-button {
    border: none;
    background: none;
    padding: 0;
    font-family: inherit;
    cursor: pointer;
    border-radius: 50%;
}

.risk-ring-button:hover,
.risk-ring-button:focus-visible {
    text-decoration: underline dotted;
    outline: none;
}

.modal-dialog.risk-help-dialog {
    max-width: 440px;
}

.risk-help-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-bottom: 0.75rem;
}

.risk-help-table td {
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--wg-border);
    vertical-align: top;
}

.risk-help-table td:last-child {
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
    padding-left: 0.75rem;
}

.risk-help-notes {
    margin: 0 0 0.75rem;
    padding-left: 1.1rem;
    font-size: 0.8rem;
    color: var(--wg-text-muted);
}

.risk-help-notes li {
    margin-bottom: 0.3rem;
}

.risk-help-this {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}
