/* Same palette as CrashDiagram.Showcase's app.css (Bad Marine's own colors, confirmed 2026-08-18
   they're fine to keep) - deliberately no Bad Marine name/logo/wordmark anywhere in this file or
   the markup that uses it. This is the citizen-facing report workflow, not the tool showcase. */
:root {
    --bg-0: #08090b;
    --panel: #16181d;
    --border: #2a2d34;
    --text: #eef0f3;
    --muted: #9aa0ac;
    --accent: #33c7f5;
    --accent-glow: #7fe3ff;
    --accent-ink: #04222c;

    /* Pulled from Skippy's own UI (2026-08-18, user pointed at it directly) - a muted teal-green
       for "already handled" states (distinct from the brighter cyan used for "current/active"),
       and a warm amber for reversible remove/undo actions instead of alarm-red, matching how
       Skippy uses orange rather than red for its own "Delete" actions. */
    --accent-2: #2dd4a0;
    --accent-2-glow: #6ee7c0;
    --warn: #f2994a;
    --warn-glow: #ffb673;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
    background: radial-gradient(1200px 600px at 50% -10%, #14171d 0%, var(--bg-0) 60%), var(--bg-0);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
}

#app { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; display: flex; flex-direction: column; min-height: 0; }

a { color: var(--accent-glow); }
a:hover { color: var(--accent); }

.wrap { max-width: 980px; margin: 0 auto; padding: 0 24px; }

h1:focus { outline: none; }

.site-header {
    flex: 0 0 auto;
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}
.site-header .wrap { display: flex; align-items: center; gap: 8px; position: relative; }
.app-title { font-size: 1.15rem; margin: 0; color: var(--text); flex: 1; }

/* Inline with the title text itself (not the 44px wipe/info icon row on the right), so a bug
   report is always one tap away no matter which of the 7 steps a driver is on. Smaller than the
   other header buttons since it sits inside a line of text rather than its own row, but still
   padded enough to stay comfortably tappable. Opens .ndp-bug-popover rather than jumping straight
   to mailto: - direct follow-up request 2026-08-24, so the driver knows what's about to happen
   before their mail app opens. */
.ndp-bug-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-left: 4px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--panel);
    font-size: 15px;
    vertical-align: middle;
    cursor: pointer;
}
.ndp-bug-btn:hover, .ndp-bug-btn[aria-expanded="true"] { border-color: var(--accent); }

/* Left-anchored (not right:0 like .ndp-info-popover) since the bug button sits at the start of the
   header, next to the title, not out with the wipe/info icons on the right. */
.ndp-bug-popover {
    position: absolute;
    top: 52px;
    left: 0;
    z-index: 40;
    width: min(340px, calc(100vw - 48px));
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.ndp-bug-popover p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

/* Privacy blurb collapsed behind a tap/click-toggled info button instead of a paragraph that used
   to eat most of the first screen before a single input was reachable. */
.ndp-info-btn {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--muted);
    font-size: 15px;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, serif;
    cursor: pointer;
}
.ndp-info-btn:hover, .ndp-info-btn[aria-expanded="true"] { color: var(--accent-glow); border-color: var(--accent); }

/* Same footprint as .ndp-info-btn (44x44, circular, icon-only) so it sits naturally alongside it
   in the header - visible on every step, not buried at the end, for anyone on a shared/public
   device who needs to bail out and leave no trace (direct user request 2026-08-24). Warn-colored
   (not the app's neutral chrome) since it's a real destructive action, not an info toggle. */
.ndp-wipe-btn {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--warn);
    font-size: 17px;
    cursor: pointer;
}
.ndp-wipe-btn:hover { color: var(--warn-glow); border-color: var(--warn); }

.ndp-info-popover {
    position: absolute;
    top: 52px;
    right: 0;
    z-index: 40;
    width: min(340px, calc(100vw - 48px));
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.ndp-info-popover p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

/* Stepper: one text line ("Step X of 6: Label") over a thin progress bar, with small dot links
   below for direct jump navigation - replaces the old row of wrapping text badges that used to
   burn three lines of vertical space before any real content. */
.ndp-stepper {
    flex: 0 0 auto;
    max-width: 980px;
    margin: 0 auto;
    padding: 10px 24px 12px;
    border-bottom: 1px solid var(--border);
}
.ndp-stepper-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    font-size: 12.5px;
    margin-bottom: 6px;
}
.ndp-stepper-count { color: var(--muted); font-weight: 600; flex: 0 0 auto; }
.ndp-stepper-label { color: var(--text); font-weight: 600; text-align: right; }
.ndp-stepper-track {
    height: 4px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
}
.ndp-stepper-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
    transition: width 0.2s ease;
}
.ndp-stepper-dots {
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
}
.ndp-step-dot {
    flex: 0 0 auto;
    width: 44px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ndp-step-dot::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--border);
}
.ndp-step-dot-done::before { background: var(--accent-2); }
.ndp-step-dot-current::before { background: var(--accent-glow); width: 9px; height: 9px; }

.ndp-page {
    flex: 1;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 24px 48px;
}

.ndp-page h1 { margin: 0 0 4px; font-size: 1.15rem; }
.ndp-page-hint { margin: 0 0 20px; color: var(--muted); font-size: 13px; }

.ndp-section { margin-bottom: 22px; }
.ndp-section-title {
    margin: 0 0 10px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.ndp-field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.ndp-field { display: block; }
.ndp-field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }

.ndp-field select, .ndp-field input[type="text"], .ndp-field input[type="date"],
.ndp-field input[type="time"], .ndp-field input[type="number"], .ndp-field input[type="tel"], .ndp-field textarea,
.ndp-field-card select, .ndp-field-card input[type="text"], .ndp-field-card input[type="date"],
.ndp-field-card input[type="time"], .ndp-field-card input[type="number"], .ndp-field-card input[type="tel"], .ndp-field-card textarea {
    width: 100%;
    min-height: 44px;
    font-family: inherit;
    /* 16px, not 15 - anything smaller makes iOS Safari auto-zoom the whole page on focus. */
    font-size: 16px;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
}

/* Each coded field (CodedSelect / CodedCheckboxGroup) is its own recessed card - same idea as an
   accordion sitting on the page's black background, one level deeper: a near-black box on the
   accordion's grey panel, so "Traffic control device working" and "Horizontal alignment" (or any
   two adjacent pill/chip groups) read as visibly separate cards instead of one undifferentiated
   stack. A thin border-only divider wasn't visible enough on this palette (user feedback,
   2026-08-18) - a real background/shape break reads clearly at a glance instead. */
.ndp-field-card {
    background: var(--bg-0);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
}
.ndp-field-card > span:first-child, .ndp-field > span:first-child {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 8px;
}

/* Opens the same searchable bottom-sheet picker as CodedCheckboxGroup, for a CodedSelect long
   enough (> 6 options) that a native <select>'s closed-box text was clipping on narrow screens
   with no cross-browser way to fix it. Same visual footprint as a real <select> otherwise. */
.ndp-select-trigger {
    width: 100%;
    min-height: 44px;
    font-family: inherit;
    font-size: 16px;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    text-align: left;
}
.ndp-select-trigger > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ndp-select-trigger:hover { border-color: var(--accent); }
.ndp-select-trigger-caret { color: var(--muted); font-size: 11px; flex: 0 0 auto; }
.ndp-field select:focus, .ndp-field input:focus, .ndp-field textarea:focus,
.ndp-field-card select:focus, .ndp-field-card input:focus, .ndp-field-card textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(51, 199, 245, 0.25);
}
.ndp-field textarea { resize: vertical; min-height: 70px; }

/* Minimum 44x44 tap area on the whole label, not just the visual checkbox box, so a thumb doesn't
   need surgical precision to hit a 16px square. */
.ndp-check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14.5px;
    min-height: 44px;
    padding: 4px 2px;
}
.ndp-check input[type="checkbox"] { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--accent); }

.ndp-field-error { margin: 8px 0 0; color: #fca5a5; font-size: 12.5px; }
.ndp-field-error-list { margin: 8px 0 0; padding-left: 18px; color: #fca5a5; font-size: 12.5px; }
.ndp-field-error-list li { margin-bottom: 2px; }
/* Each "Before continuing, finish these" message is a real button, not just text - clicking one
   jumps straight to the field it's about (direct user request, 2026-08-19). Styled to still read as
   plain error text at rest; the underline only signals "clickable" on hover/focus. */
.ndp-error-link {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    min-height: 24px;
}
.ndp-error-link:hover, .ndp-error-link:focus-visible { color: #ffb4b4; text-decoration: underline; text-underline-offset: 2px; }

/* Matches the legacy NDOT portal's own red-asterisk convention for required fields (screenshotted
   directly from that portal, 2026-08-19) - reuses the same red already established for
   .ndp-field-error rather than introducing a third color for the same "needs attention" meaning. */
.ndp-required-mark { color: #fca5a5; font-weight: 700; margin-left: 2px; }

/* Segmented pill control - CodedSelect's replacement for a native <select> when the option list is
   short enough (<= 6) that every choice can just be a tappable card instead of hidden behind a
   dropdown. Options never show their underlying NDOT code, only the plain-English label. */
.ndp-pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ndp-pill {
    flex: 1 1 auto;
    min-width: 84px;
    min-height: 44px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    text-align: center;
}
.ndp-pill:hover { border-color: var(--accent); }
.ndp-pill-selected {
    background: rgba(51, 199, 245, 0.16);
    border-color: var(--accent);
    color: var(--accent-glow);
}
.ndp-pill:disabled { opacity: 0.35; cursor: not-allowed; }
.ndp-pill:disabled:hover { border-color: var(--border); }

/* Multi-select chip field - CodedCheckboxGroup's replacement for a wall of checkboxes. Selected
   values render as removable chips; a "+ Add" chip opens a bottom-sheet picker so a 25-option list
   (Contributing Circumstances, Traffic Control Device Type) never sits fully expanded on the page. */
.ndp-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ndp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 14px;
    cursor: pointer;
}
.ndp-chip-remove-x { color: var(--muted); font-size: 15px; line-height: 1; }
.ndp-chip:hover .ndp-chip-remove-x { color: #fca5a5; }
.ndp-chip-add {
    color: var(--accent-glow);
    border-color: var(--accent);
    border-style: dashed;
    background: transparent;
}
.ndp-chip-add:disabled { opacity: 0.5; cursor: not-allowed; }

.ndp-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 60;
}
.ndp-sheet {
    width: 100%;
    max-width: 560px;
    max-height: 78vh;
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
}
.ndp-sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ndp-sheet-header h3 { margin: 0; font-size: 15px; }
.ndp-sheet-hint { margin: -6px 0 10px; color: var(--muted); font-size: 12.5px; }
.ndp-sheet-search {
    width: 100%;
    min-height: 44px;
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    background: var(--bg-0);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
}
.ndp-sheet-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    overflow-y: auto;
    padding-bottom: 4px;
}
.ndp-sheet-options .ndp-pill { flex: 0 1 auto; min-width: 0; }
.ndp-sheet-empty { color: var(--muted); font-size: 13.5px; padding: 8px 0; }

/* Seat map (SeatingPositionPicker) - one row per vehicle-type row, each showing its seat buttons
   left-to-right, matching the MMUCC5 reference figure's per-body-style layout (front row at top,
   matching the "12 o'clock = front" convention used by the clock diagram above). */
.ndp-seat-map { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.ndp-seat-row { display: flex; align-items: center; gap: 10px; }
.ndp-seat-row-label { flex: 0 0 78px; font-size: 12px; font-weight: 600; color: var(--muted); }
.ndp-seat-row-seats { display: flex; gap: 6px; flex: 1 1 auto; }
.ndp-seat-row-seats .ndp-pill { flex: 1 1 0; min-width: 0; padding-left: 4px; padding-right: 4px; }

.ndp-signature-pad { margin-top: 8px; }
.ndp-signature-canvas {
    display: block;
    width: 100%;
    height: 160px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    touch-action: none; /* signing on mobile must not also scroll the page */
    cursor: crosshair;
}
.ndp-signature-preview {
    display: block;
    width: 100%;
    max-width: 400px;
    height: 160px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 8px;
}

.ndp-attachments { margin-top: 8px; }
.ndp-attachment-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 8px;
}
.ndp-attachment-thumb {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--panel);
    border: 1px solid var(--border);
}
.ndp-attachment-thumb-generic {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
}
.ndp-attachment-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ndp-attachment-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ndp-attachment-size { font-size: 12px; color: var(--muted); }
.ndp-attachment-add { display: inline-block; cursor: pointer; }

/* Clock-face-over-a-car diagram (DamagedAreaPicker/ContactPointPicker) - real <button> hotspots
   positioned around a decorative car silhouette, not SVG-only hit shapes, so touch/keyboard/screen
   reader access all work the same as every other pill/chip control. 40px rather than the usual 44px
   minimum is a deliberate compromise: 12 spots share one circle and 44px hotspots would overlap. */
.ndp-clock-diagram {
    position: relative;
    width: 220px;
    max-width: 100%;
    aspect-ratio: 1;
    margin: 4px auto 0;
}
.ndp-clock-diagram-car { position: absolute; inset: 0; width: 100%; height: 100%; }
.ndp-clock-spot {
    position: absolute;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    background: var(--panel);
    border: 1px solid var(--border);
    cursor: pointer;
}
.ndp-clock-spot:hover { border-color: var(--accent); color: var(--text); }
/* Solid fill rather than the tinted-background treatment used for pills/chips elsewhere - a 40px
   circle needs stronger contrast than a full-width pill to read as "selected" at a glance during a
   quick tap (direct user request, 2026-08-19: "bright, highlighted active state ... instant visual
   feedback when tapping" on mobile). Scoped to just the clock diagram, not a repaint of the shared
   pill/chip selected style used everywhere else. The :hover variant is listed explicitly, not
   relying on cascade order, since ".ndp-clock-spot:hover" (two classes) otherwise outranks
   ".ndp-clock-spot-selected" (one class) on specificity alone and would win back a light text
   color on desktop mouse-hover, leaving light text on the same light cyan fill. */
.ndp-clock-spot-selected, .ndp-clock-spot-selected:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

/* Accordion section cards - one category open at a time instead of every field group stacked in a
   single continuous scroll. Native <details>/<summary> for free keyboard + screen-reader support. */
.ndp-accordion {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    margin-bottom: 12px;
    overflow: hidden;
}
.ndp-accordion[open] { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); }
.ndp-accordion summary, .ndp-accordion-summary-btn {
    list-style: none;
    cursor: pointer;
    min-height: 44px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
}
.ndp-accordion summary::-webkit-details-marker { display: none; }
/* Same look as a native <details> summary, but a real <button> - used where the section's content
   (e.g. the Leaflet map) must not mount into the DOM at all until a driver actually opens it, which
   a CSS-hidden but still-rendered <details> body doesn't guarantee. */
.ndp-accordion-summary-btn {
    font-family: inherit;
    background: transparent;
    border: none;
    color: inherit;
    text-align: left;
}
.ndp-accordion-title {
    flex: 1;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text);
}
.ndp-accordion-caret { color: var(--muted); font-size: 11px; transition: transform 0.15s ease; display: inline-block; }
.ndp-accordion[open] .ndp-accordion-caret, .ndp-accordion-caret-open { transform: rotate(90deg); }
.ndp-accordion-body { padding: 4px 16px 18px; border-top: 1px solid var(--border); padding-top: 14px; }
@media (prefers-reduced-motion: reduce) {
    .ndp-accordion-caret { transition: none; }
}

.ndp-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    padding: 16px;
    margin-bottom: 14px;
}
.ndp-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ndp-card-header h3 { margin: 0; font-size: 14px; }

/* Vehicle summary card (VehiclesStep) - the whole card is a tap target that opens the edit drawer,
   so each vehicle costs one glance + one tap instead of scrolling past its entire ~30-field form
   inline (direct user feedback, 2026-08-18: "100+ fields on a phone screen" with 2-3 vehicles). */
.ndp-vehicle-summary-card { cursor: pointer; }
.ndp-vehicle-summary-title { margin: 0 0 2px; font-size: 14.5px; font-weight: 700; }
.ndp-vehicle-summary-sub { margin: 0; color: var(--muted); font-size: 13px; }

/* Full-screen edit drawer - same overlay/sheet-from-bottom language as .ndp-sheet, one size class up
   since it holds an entire vehicle's form rather than one field's option list. Sits below
   .ndp-sheet-overlay (60) and .ndp-scanner-overlay (65) so a CodedSelect picker or the VIN scanner
   opened from inside the drawer still layers on top of it. */
.ndp-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 55;
}
.ndp-drawer {
    width: 100%;
    max-width: 640px;
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-1, var(--panel));
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
}
.ndp-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    flex: 0 0 auto;
}
.ndp-drawer-header h2 { margin: 0; font-size: 15px; }
.ndp-drawer-body {
    overflow-y: auto;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
}

.ndp-btn {
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    min-height: 44px;
    border-radius: 8px;
    padding: 10px 18px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    cursor: pointer;
}
.ndp-btn:hover { border-color: var(--accent); }
.ndp-btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ndp-btn-primary:hover { background: var(--accent-glow); border-color: var(--accent-glow); }
.ndp-btn-danger { color: var(--warn); border-color: transparent; }
.ndp-btn-danger:hover { color: var(--warn-glow); border-color: var(--warn); }
.ndp-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.ndp-nav-row { display: flex; justify-content: space-between; margin-top: 28px; }

/* Sticky safe-area bottom nav (direct user feedback, 2026-08-18): on a real phone the Back/Next row
   used to sit at plain document-flow bottom margin, risking a home-indicator/gesture-bar overlay
   cutting it off, and requiring a scroll to reach it at all on a long page. Mobile-only (matches
   this feedback's own scope) - desktop keeps the plain in-flow row, no reason to pin it there. */
@media (max-width: 640px) {
    .ndp-nav-row {
        position: sticky;
        bottom: 0;
        margin-left: -24px;
        margin-right: -24px;
        margin-bottom: -48px;
        padding: 12px 24px calc(12px + env(safe-area-inset-bottom, 0px));
        background: var(--bg-0);
        border-top: 1px solid var(--border);
        z-index: 5;
    }
}

.ndp-link-btn {
    display: inline-block;
    background: transparent;
    border: none;
    color: var(--accent-glow);
    font-family: inherit;
    font-size: 13px;
    text-decoration: underline;
    padding: 6px 0;
    min-height: 32px;
    cursor: pointer;
}
.ndp-link-btn:hover { color: var(--accent); }

.ndp-summary dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); margin-top: 10px; }
.ndp-summary dd { margin: 2px 0 0; font-size: 13.5px; }

/* NdotSubmitAddress - a prominent, always-visible, copyable rendering of the NDOT submission
   address, so it doesn't rely purely on a mailto:/share hand-off actually working. */
.ndp-address-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
    font-size: 13.5px;
}
.ndp-address-callout strong { color: var(--accent-glow); }

/* overflow: hidden is a defensive backstop, not the real fix (see DiagramCanvas.razor's mobile
   min-height override) - if the embedded canvas ever again grows taller than this box, it gets
   clipped inside its own box instead of silently spilling over the Narrative field below it. */
.ndp-diagram-wrap { height: 70vh; min-height: 480px; overflow: hidden; }

.ndp-location-map { height: 320px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }

/* Leaflet control built in locationMap.js - the explicit "tap to interact further" toggle for the
   pan/zoom-disabled-by-default touch-trap fix. Styled to match .ndp-btn without depending on it
   (this element is created by Leaflet's own DOM code, not Blazor markup). */
.ndp-map-panzoom-btn {
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* First-load gate - above every other overlay in the app (drawer 55, sheet 60, scanner 65) since
   nothing else can legitimately be open yet the moment this shows. */
.ndp-welcome-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 100;
}
.ndp-welcome-modal {
    background: var(--bg-1, var(--panel));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    max-width: 460px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}
.ndp-welcome-modal h2 { margin: 0 0 10px; font-size: 18px; }
.ndp-welcome-modal > p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.ndp-welcome-section-title { font-weight: 600; color: var(--text) !important; }
.ndp-welcome-list { margin: 0 0 14px; padding-left: 20px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.ndp-welcome-list li { margin-bottom: 8px; }
.ndp-welcome-list strong { color: var(--text); }
.ndp-welcome-warning { font-size: 13px; line-height: 1.5; color: var(--warn); border-top: 1px solid var(--border); padding-top: 12px; }

.ndp-scanner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    /* Above .ndp-drawer-overlay (55) and .ndp-sheet-overlay (60) - scanning a VIN barcode can be
       started from inside the vehicle edit drawer, so the camera view must layer on top of it. */
    z-index: 65;
}
.ndp-scanner-box { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; max-width: 420px; width: 100%; }
.ndp-scanner-video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: #000; }

#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: var(--border);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--accent);
    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;
    color: var(--text);
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

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

code {
    color: var(--accent-glow);
}
