/*
 * DamageBrief — the component layer (loaded after application.css): page headers with actions, cards with titled
 * headers, status chips, empty states, flash messages, the analysis stepper, skeletons for pending live updates,
 * tables that become stacked cards on phones, the phone action bar, filter chips, the dropzone, photo galleries and
 * the lightbox, maps, the vehicle choice, the estimate document, key figures, the install card. Same tokens as the
 * landing page (brand.css + application.css). Every animation stops under prefers-reduced-motion (application.css).
 */

/* ---- page header: back link, eyebrow, title, chips, actions ---- */
.page-header { display: grid; gap: 10px; margin: 0 0 22px; }
.page-back {
  display: inline-flex; align-items: center; gap: 6px; justify-self: start; min-height: 32px;
  color: var(--ui-text-muted); font-size: .9375rem; font-weight: 500; text-decoration: none;
}
.page-back:hover { color: var(--ui-text-strong); }
.page-header-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; }
.page-heading { display: grid; gap: 6px; min-width: 0; }
.page-eyebrow { margin: 0; color: var(--ui-primary-text); font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.page-title { margin: 0; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 750; line-height: 1.15; letter-spacing: -.025em; overflow-wrap: anywhere; }
.page-title .mono { font-size: .92em; letter-spacing: 0; }
.page-subtitle { margin: 0; max-width: 60em; color: var(--ui-text-muted); }
.page-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.page-actions form { display: inline-flex; margin: 0; }
@media (max-width: 991.98px) {
  .page-back { display: none; }   /* the top bar carries the back affordance on phones and tablets */
}
@media (max-width: 575.98px) {
  .page-header { margin-bottom: 16px; }
  .page-header-row { align-items: stretch; }
  .page-actions { width: 100%; }
  .page-actions > .btn, .page-actions > form { flex: 1 1 auto; }
  .page-actions > form .btn { width: 100%; }
}

/* ---- cards: a titled header (icon tile + title + actions), generous body ---- */
/* Bootstrap sets --bs-card-bg on .card itself (to the page colour), so the theme's value must be set here too: a card
   is a raised surface, one step lighter than the page. */
[data-bs-theme="dark"] .card {
  --bs-card-bg: var(--ui-surface); --bs-card-border-radius: 14px; --bs-card-inner-border-radius: 13px; border-color: var(--ui-border);
}
[data-bs-theme="dark"] .card-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
  padding: 16px 20px 0; border-bottom: 0; background: transparent;
}
[data-bs-theme="dark"] .card-header + .card-body { padding-top: 14px; }
[data-bs-theme="dark"] .card-body { padding: 18px 20px 20px; }
[data-bs-theme="dark"] .card-footer { padding: 12px 20px; border-top-color: var(--ui-border-soft); background: transparent; }
.card-title {
  display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0;
  color: var(--ui-text-strong); font-size: 1.0625rem; font-weight: 650; letter-spacing: -.01em;
}
.card-icon {
  display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 9px;
  background: var(--ui-primary-soft); color: var(--db-blue-300); font-size: 1rem;
}
.card-icon.is-amber { background: rgba(245, 165, 36, .14); color: var(--db-amber-300); }
.card-icon.is-danger { background: rgba(226, 98, 90, .16); color: var(--bs-danger-text-emphasis); }
.card-icon.is-success { background: rgba(76, 175, 99, .16); color: var(--bs-success-text-emphasis); }
.card-sub { color: var(--ui-text-faint); font-size: .875rem; font-weight: 400; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card-actions form { display: inline-flex; margin: 0; }
.card + .card, .card + .stack, .stack + .card { margin-top: 0; }
.card.card-danger { border-color: var(--bs-danger-border-subtle); }
.stack { display: grid; gap: 16px; }
.stack-lg { display: grid; gap: 20px; }
.section-gap { margin-bottom: 16px; }
@media (max-width: 575.98px) {
  [data-bs-theme="dark"] .card-header { padding: 14px 16px 0; }
  [data-bs-theme="dark"] .card-body { padding: 14px 16px 16px; }
  [data-bs-theme="dark"] .card-footer { padding: 10px 16px; }
}

/* ---- chips (Bootstrap badges, restyled): status, fault, flags — always text + colour, never colour alone ---- */
[data-bs-theme="dark"] .badge {
  --bs-badge-padding-x: .62em; --bs-badge-padding-y: .34em; --bs-badge-font-size: .75rem; --bs-badge-font-weight: 600;
  --bs-badge-border-radius: 999px;
  display: inline-flex; align-items: center; gap: .38em; border: 1px solid transparent; letter-spacing: .01em; line-height: 1.15;
  white-space: nowrap;
}
[data-bs-theme="dark"] .badge.text-wrap { white-space: normal; text-align: left; }
.bg-success-subtle.badge { border-color: var(--bs-success-border-subtle); }
.bg-danger-subtle.badge { border-color: var(--bs-danger-border-subtle); }
.bg-warning-subtle.badge { border-color: var(--bs-warning-border-subtle); }
.bg-info-subtle.badge { border-color: var(--bs-info-border-subtle); }
.bg-primary-subtle.badge { border-color: var(--bs-primary-border-subtle); }
.bg-secondary-subtle.badge { border-color: var(--bs-secondary-border-subtle); }
.chip-status::before { content: ""; width: .5em; height: .5em; border-radius: 50%; background: currentColor; }
.chip-status.is-live::before { animation: chip-pulse 1.4s ease-in-out infinite; }
@keyframes chip-pulse { 50% { opacity: .25; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.chips > .badge { max-width: 100%; white-space: normal; text-align: left; overflow-wrap: anywhere; }

/* ---- alerts and flash messages ---- */
[data-bs-theme="dark"] .alert {
  --bs-alert-border-radius: 12px; --bs-alert-padding-x: 16px; --bs-alert-padding-y: 12px; border-width: 1px; line-height: 1.5;
}
/* an icon beside the message: only where the message is wrapped (.alert-body) — inline content stays one text flow */
.alert:has(> .alert-body) { display: flex; align-items: flex-start; gap: 10px; }
[data-bs-theme="dark"] .alert > ul { padding-left: 1.1rem; }
.alert-body { flex: 1; min-width: 0; }
.alert-icon { flex: none; margin-top: .1em; font-size: 1.1rem; line-height: 1; }
[data-bs-theme="dark"] .alert-link { color: inherit; text-decoration: underline; }
.flash-stack { display: grid; gap: 10px; margin: 0 0 18px; }
.flash { margin: 0; box-shadow: var(--ui-shadow); animation: flash-in .25s ease-out; }
.flash .btn-close { flex: none; margin: -2px -4px 0 auto; padding: 8px; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } }

/* ---- empty states ---- */
.empty-state { display: grid; justify-items: center; gap: 8px; padding: 36px 20px; font-style: normal; text-align: center; }
.empty-state-icon {
  display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 6px; border-radius: 16px;
  background: var(--ui-primary-soft); color: var(--db-blue-300); font-size: 1.6rem;
}
.empty-state-title { margin: 0; color: var(--ui-text-strong); font-size: 1.0625rem; font-weight: 650; }
.empty-state-text { margin: 0; max-width: 34em; color: var(--ui-text-muted); }
.empty-state .btn { margin-top: 8px; }

/* ---- the analysis stepper (status panel) ---- */
.status-panel { overflow: hidden; }
.status-panel.is-ready { border-color: var(--bs-success-border-subtle); }
.status-panel.is-attention { border-color: var(--bs-warning-border-subtle); }
.status-panel.is-failed { border-color: var(--bs-danger-border-subtle); }
.status-panel.is-running { border-color: var(--bs-info-border-subtle); }
.status-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.status-message { display: flex; align-items: flex-start; gap: 12px; min-width: 0; flex: 1 1 320px; }
.status-message-icon {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; font-size: 1.2rem;
  background: var(--ui-primary-soft); color: var(--db-blue-300);
}
.is-ready .status-message-icon { background: rgba(76, 175, 99, .16); color: var(--bs-success-text-emphasis); }
.is-attention .status-message-icon { background: rgba(245, 165, 36, .14); color: var(--db-amber-300); }
.is-failed .status-message-icon { background: rgba(226, 98, 90, .16); color: var(--bs-danger-text-emphasis); }
.status-message-title { margin: 0; color: var(--ui-text-strong); font-size: 1.0625rem; font-weight: 650; }
.status-message p { margin: 2px 0 0; }
.status-action { display: flex; flex-wrap: wrap; gap: 8px; }
.status-action form { margin: 0; display: inline-flex; }
.stepper { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; counter-reset: step; }
.step { display: grid; gap: 8px; min-width: 0; color: var(--ui-text-faint); font-size: .8125rem; font-weight: 600; }
.step-bar { height: 6px; border-radius: 3px; background: var(--ui-surface-2); overflow: hidden; }
.step-label { display: flex; align-items: center; gap: 6px; min-width: 0; }
.step-label > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-label .bi { flex: none; font-size: .95rem; }
.step.is-done { color: var(--ui-text-muted); }
.step.is-done .step-bar { background: var(--db-blue-500); }
.step.is-skipped .step-bar { background: repeating-linear-gradient(135deg, var(--ui-surface-2) 0 6px, #2c333e 6px 12px); }
.step.is-current { color: var(--ui-text-strong); }
.step.is-current .step-bar { position: relative; background: rgba(63, 127, 214, .3); }
.step.is-current .step-bar::after {
  content: ""; position: absolute; inset: 0; width: 40%; border-radius: 3px; background: var(--db-blue-400);
  animation: step-run 1.3s ease-in-out infinite;
}
@keyframes step-run { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
.step.is-attention { color: var(--db-amber-300); }
.step.is-attention .step-bar { background: var(--db-amber-500); }
.step.is-failed { color: var(--bs-danger-text-emphasis); }
.step.is-failed .step-bar { background: #c8524a; }
@media (max-width: 575.98px) {
  .stepper { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .step { grid-template-columns: 20px minmax(0, 1fr); align-items: center; gap: 10px; font-size: .875rem; }
  .step-bar { width: 6px; height: 20px; justify-self: center; }
  .step.is-current .step-bar::after { width: 100%; height: 40%; animation-name: step-run-v; }
  @keyframes step-run-v { 0% { transform: translateY(-100%); } 100% { transform: translateY(250%); } }
}

/* ---- skeletons: what a live update will fill in ---- */
.skeleton { display: grid; gap: 10px; }
.skeleton-line {
  height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--ui-surface-2) 0%, #2c333e 40%, var(--ui-surface-2) 80%) 0 0 / 300% 100%;
  animation: skeleton-shine 1.6s linear infinite;
}
.skeleton-line.w-90 { width: 90%; } .skeleton-line.w-75 { width: 75%; } .skeleton-line.w-60 { width: 60%; } .skeleton-line.w-40 { width: 40%; }
.skeleton-block { height: 120px; border-radius: 12px; }
@keyframes skeleton-shine { to { background-position: -150% 0; } }

/* ---- tables that become stacked cards on phones (each cell labelled by its data-label) ---- */
.table-cell-main { min-width: 0; }
.row-title { color: var(--ui-text-strong); font-weight: 600; text-decoration: none; }
a.row-title:hover { text-decoration: underline; }
.row-sub { color: var(--ui-text-faint); font-size: .8125rem; }
@media (min-width: 992px) {
  .table-responsive > .table-nowrap > :not(caption) > * > *:not(.text-wrap) { white-space: nowrap; }
}
@media (max-width: 767.98px) {
  .card-list { border: 0 !important; background: transparent !important; box-shadow: none !important; }
  .card-list > .card-header { padding: 0 2px 10px !important; }
  .card-list > .card-footer { padding: 12px 0 0 !important; border-top: 0 !important; }
  .table-stack thead { display: none; }
  .table-stack, .table-stack > tbody, .table-stack > tfoot, .table-stack > tbody > tr, .table-stack > tfoot > tr,
  .table-stack > tbody > tr > td, .table-stack > tbody > tr > th, .table-stack > tfoot > tr > td, .table-stack > tfoot > tr > th {
    display: block; width: 100%;
  }
  [data-bs-theme="dark"] .table-stack > tbody > tr {
    margin: 0 0 10px; padding: 10px 0; border: 1px solid var(--ui-border); border-radius: 14px; background: var(--ui-surface);
  }
  [data-bs-theme="dark"] .table-stack > :not(caption) > * > * { padding: 4px 14px; border-bottom: 0; text-align: right; overflow-wrap: break-word; }
  /* only code-like values (a JSON example, a parameter name) may break anywhere: a word never splits ("sou-rce") */
  .table-stack > tbody > tr > td.mono, .table-stack > tbody > tr > td .mono { overflow-wrap: anywhere; }
  .table-stack > tbody > tr > td[data-label], .table-stack > tfoot > tr > [data-label] {
    display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  }
  .table-stack > tbody > tr > td[data-label]::before, .table-stack > tfoot > tr > [data-label]::before {
    content: attr(data-label); flex: none; max-width: 45%; color: var(--ui-text-faint);
    font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-align: left; text-transform: uppercase;
  }
  .table-stack > tbody > tr > .cell-main { text-align: left; }
  /* a wide cell with a label (a field in a table row): the label above it, the field the full width */
  .table-stack > tbody > tr > td.cell-wide[data-label] { display: block; }
  .table-stack > tbody > tr > td.cell-wide[data-label]::before { display: block; max-width: none; margin-bottom: 4px; }
  .table-stack > tbody > tr > .cell-wide { text-align: left; }
  .table-stack > tbody > tr > td.cell-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-top: 8px; }
  .table-stack > tbody > tr > td.cell-empty-hide:empty { display: none; }
  .table-stack > tbody > tr > td.empty { text-align: center; }
  [data-bs-theme="dark"] .table-stack > tbody > tr:has(> td.empty) { border-style: dashed; background: transparent; }
  .table-stack > tbody > tr > td > .row-title { font-size: 1rem; }
  [data-bs-theme="dark"] .table-stack > tfoot > tr { padding: 0; }
  [data-bs-theme="dark"] .table-stack > tfoot > tr > * { padding: 6px 14px; }
  .table-stack .hide-stacked { display: none !important; }
  .table-stack > tbody > tr > td.w-50 { width: 100% !important; }
  /* compact rows: the title and its status on one line, the actions under them */
  [data-bs-theme="dark"] .table-stack.table-stack-compact > tbody > tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; row-gap: 6px; padding: 10px 0;
  }
  .table-stack.table-stack-compact > tbody > tr > td { width: auto; }
  .table-stack.table-stack-compact > tbody > tr > td.cell-wide { text-align: right; }
  .table-stack.table-stack-compact > tbody > tr > td.cell-actions { grid-column: 1 / -1; padding-top: 4px; }
  /* a labelled value takes its own line, label left and value right (in one grid column it floated mid-card) */
  .table-stack.table-stack-compact > tbody > tr > td[data-label] { grid-column: 1 / -1; }
  .table-responsive:has(> .table-stack) { overflow: visible; }
}

/* ---- the phone action bar: the page's primary actions, fixed above the bottom navigation (thumb reach) ---- */
.action-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.action-bar form { margin: 0; display: inline-flex; }
@media (max-width: 991.98px) {
  .action-bar {
    position: fixed; left: 0; right: 0; bottom: calc(var(--bottom-nav-h) + var(--safe-bottom)); z-index: 1034;
    margin: 0; padding: 10px 16px; flex-wrap: nowrap;
    background: rgba(16, 19, 24, .94); backdrop-filter: blur(12px); border-top: 1px solid var(--ui-border-soft);
  }
  /* every label whole: the buttons share the row, and wrap to a second row rather than cut a label */
  .action-bar { flex-wrap: wrap; }
  .action-bar > .btn, .action-bar > form { flex: 1 1 auto; }
  .action-bar .btn { white-space: nowrap; }
  .action-bar > form .btn { width: 100%; }
  /* the page's end — the footer, which follows <main> — stays reachable above the fixed bar: the reserve is under the
     footer (the content column's bottom padding), not under <main> (the bar sat over the footer, measured at 360 px) */
  .content:has(> main .action-bar) { padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 76px); }
}

@media (max-width: 575.98px) {
  .status-action.action-bar > :not(:first-child) { flex: 0 0 auto; }
  .status-action.action-bar > :not(:first-child) .btn { width: var(--touch); padding-left: 0; padding-right: 0; }
  .status-action.action-bar > :not(:first-child) .btn-label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}

/* ---- search + filter chips ---- */
.toolbar { display: grid; gap: 12px; margin-bottom: 16px; }
.search-bar { position: relative; }
.search-bar > .bi { position: absolute; left: 14px; top: 50%; z-index: 6; transform: translateY(-50%); color: var(--ui-text-faint); pointer-events: none; }
.search-bar .form-control { padding-left: 40px; }
.search-bar .input-group > .form-control { border-top-left-radius: 10px; border-bottom-left-radius: 10px; }
.filter-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 36px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--ui-border-strong); background: var(--ui-surface); color: var(--ui-text-muted);
  font-size: .875rem; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.filter-chip:hover { border-color: #4a5462; color: var(--ui-text-strong); }
.filter-chip.is-active { border-color: var(--db-blue-500); background: var(--ui-primary-soft); color: #dce9fb; }
.filter-chip-count { min-width: 1.5em; padding: 0 .45em; border-radius: 999px; background: var(--ui-surface-2); color: var(--ui-text-strong); font-size: .75rem; text-align: center; }
.filter-chip.is-active .filter-chip-count { background: rgba(130, 180, 255, .22); }
@media (pointer: coarse) { .filter-chip { min-height: var(--touch); } }

/* ---- the case list: a thumbnail per row ---- */
.case-thumb {
  display: block; flex: none; width: 56px; height: 44px; border-radius: 8px; object-fit: cover;
  background: var(--ui-surface-2); border: 1px solid var(--ui-border);
}
.case-thumb-empty { display: grid; place-items: center; color: var(--ui-text-faint); }
.case-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.case-cell-text { display: grid; gap: 2px; min-width: 0; }
.case-cell-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
@media (max-width: 767.98px) {
  .case-thumb { width: 72px; height: 56px; }
  #cases-table > tbody > tr > td.cell-main { padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--ui-border-soft) !important; }
}

/* ---- dropzones (drag & drop / paste / click-to-browse; on phones: the camera) ---- */
.dropzone {
  position: relative; display: grid; align-content: center; gap: 14px; min-height: 190px; height: 100%; padding: 22px;
  border: 2px dashed var(--ui-border-strong); border-radius: 14px; background: var(--ui-surface-sunken);
  text-align: center; cursor: pointer; transition: border-color .15s, background-color .15s;
}
.dropzone:hover { border-color: var(--db-blue-400); }
.dropzone:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 2px; border-color: var(--db-blue-400); }
.dropzone.is-dragover { border-color: var(--db-blue-400); background: rgba(63, 127, 214, .1); }
.dropzone-prompt { display: grid; justify-items: center; gap: 4px; color: var(--ui-text-muted); }
.dropzone-prompt-icon {
  display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 6px; border-radius: 14px;
  background: var(--ui-primary-soft); color: var(--db-blue-300); font-size: 1.5rem;
}
.dropzone-prompt strong { color: var(--ui-text-strong); font-size: 1.0625rem; }
.dropzone-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.dropzone.has-files { align-content: start; }
.dropzone-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; text-align: left; }
.dropzone-previews:empty { display: none; }
.dropzone-file { position: relative; margin: 0; padding: 6px; border: 1px solid var(--ui-border); border-radius: 10px; background: var(--ui-surface); }
.dropzone-file img { display: block; width: 100%; height: 84px; object-fit: cover; border-radius: 6px; }
.dropzone-file > i { display: block; height: 84px; line-height: 84px; text-align: center; color: var(--ui-text-muted); }
.dropzone-file figcaption { margin-top: 4px; overflow: hidden; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.dropzone-remove {
  position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 50%; background: rgba(16, 19, 24, .88); color: #fff; font-size: 1rem; line-height: 1; cursor: pointer;
}
.dropzone-remove:hover { background: #a23a33; }
@media (pointer: coarse) { .dropzone-remove { width: 36px; height: 36px; } }
/* the camera button only where a camera is the natural way in */
.camera-only { display: none !important; }
@media (pointer: coarse) { .camera-only { display: inline-flex !important; } .fine-only { display: none !important; } }

/* ---- uploaded files and the photo gallery ---- */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
/* align-content: start — a tile stretched to a taller neighbour (a two-line caption) keeps its rows at the top, so the
   captions of one row line up */
.file-tile { display: grid; align-content: start; gap: 6px; margin: 0; min-width: 0; }
.file-thumb {
  display: block; width: 100%; height: 124px; border-radius: 10px; object-fit: cover;
  background: var(--ui-surface-sunken); border: 1px solid var(--ui-border);
}
.file-thumb-icon { display: flex; align-items: center; justify-content: center; color: var(--ui-text-muted); }
.file-tile figcaption { min-width: 0; overflow-wrap: anywhere; }
.photo-link { position: relative; display: block; border-radius: 10px; }
.photo-link:hover .file-thumb { border-color: var(--db-blue-400); }
.photo-number {
  position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(16, 19, 24, .85);
  color: #fff; font-size: .75rem; font-weight: 700;
}
.photo-caption { margin: 0; color: var(--ui-text-muted); font-size: .875rem; }
/* the case page's captions: three lines (the whole caption is in the lightbox and read out in full) */
#photos .photo-caption { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
@media (min-width: 768px) { #photos .file-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; } #photos .file-thumb { height: 150px; } }
@media (max-width: 575.98px) {
  .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .file-thumb { height: 112px; }
}

/* the photo lightbox (a native <dialog>) */
.lightbox {
  width: min(1100px, 100vw - 24px); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--ui-border);
  border-radius: 16px; background: var(--ui-surface-sunken); color: var(--ui-text); box-shadow: var(--ui-shadow-lg);
}
.lightbox::backdrop { background: rgba(5, 7, 10, .82); }
.lightbox-figure { display: grid; margin: 0; }
.lightbox-image { display: block; width: 100%; max-height: calc(100dvh - 140px); object-fit: contain; background: #000; }
.lightbox-bar { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; }
.lightbox-caption { flex: 1; min-width: 0; margin: 0; color: var(--ui-text-muted); font-size: .9375rem; }
@media (max-width: 575.98px) {
  .lightbox-bar { flex-wrap: wrap; }
  .lightbox-caption { flex: 1 1 100%; }
  .lightbox-bar .btn-primary { margin-left: auto; }
}

/* ---- maps (Leaflet) ---- */
.crash-map {
  width: 100%; height: 340px; border-radius: 12px; border: 1px solid var(--ui-border);
  background: var(--ui-surface-2); cursor: crosshair; touch-action: pan-y;
}
.crash-map-small { height: 220px; cursor: grab; }
.shops-map { height: 300px; cursor: grab; }
.crash-pin { color: #f0a19a; font-size: 32px; line-height: 1; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.crash-pin i { display: block; }
.shop-pin {
  display: grid !important; place-items: center; border: 2px solid #fff; border-radius: 50%;
  background: var(--ui-primary); color: #fff; font: 700 12px/1 var(--db-font-sans); box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
}
.shop-pin.is-partner { background: #277a42; }
.map-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.map-status { color: var(--ui-text-faint); font-size: .875rem; }
@media (max-width: 575.98px) { .crash-map { height: 280px; } .shops-map { height: 240px; } }
.leaflet-container { font-family: var(--db-font-sans); }
/* Leaflet's own controls in the dark theme (its default attribution link is 3.3:1 on its white strip — under AA) */
.leaflet-container .leaflet-control-attribution { background: rgba(16, 19, 24, .88); color: var(--ui-text-muted); font-size: 11px; }
.leaflet-container .leaflet-control-attribution a { color: var(--db-blue-300); }
.leaflet-touch .leaflet-bar, .leaflet-bar { border: 1px solid var(--ui-border-strong); border-radius: 10px; box-shadow: var(--ui-shadow); overflow: hidden; }
.leaflet-container .leaflet-bar a { background: var(--ui-surface-2); color: var(--ui-text-strong); border-bottom-color: var(--ui-border); }
.leaflet-container .leaflet-bar a:hover, .leaflet-container .leaflet-bar a:focus { background: #2c333e; color: #fff; }
.leaflet-container .leaflet-bar a.leaflet-disabled { background: var(--ui-surface); color: var(--ui-text-faint); }

/* ---- the case form ---- */
.form-section-title { display: flex; align-items: center; gap: 10px; margin: 0; }
.form-grid { display: grid; gap: 16px; }
.choice-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice-tiles .btn { justify-content: flex-start; min-height: 56px; padding: 12px 14px; text-align: left; white-space: normal; }
@media (max-width: 400px) { .choice-tiles { grid-template-columns: minmax(0, 1fr); } }
.country-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 4px 14px; }
/* The report-language tick-boxes (~30 languages — the case form, Your data): a compact grid of pills by name. The whole
   pill is the label (a big target); a ticked one is tinted and outlined in the primary colour, so the chosen few stand
   out; the ISO code sits faint at the right for a name in a script the reader does not read. */
.language-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 6px 8px; }
.language-option {
  display: flex; align-items: center; gap: 6px; min-height: 40px; margin: 0; padding: 6px 8px;
  border: 1px solid var(--ui-border); border-radius: var(--ui-radius-sm); background: var(--ui-surface-sunken);
  color: var(--ui-text); font-size: .9375rem; line-height: 1.25; cursor: pointer;
}
.language-option:hover { border-color: var(--ui-border-strong); }
.language-option .form-check-input { flex: none; float: none; margin: 0; }
.language-option:has(.form-check-input:checked) { border-color: var(--ui-primary); background: var(--ui-primary-soft); color: var(--ui-text-strong); }
.language-name { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; hyphens: auto; }
.language-code { flex: none; color: var(--ui-text-faint); font-size: .75rem; }
@media (pointer: coarse) { .language-option { min-height: var(--touch); } }
.language-summary { margin: 0 0 10px; color: var(--ui-text); }
.language-summary strong { color: var(--ui-text-strong); font-weight: 600; }
.language-disclosure > summary { min-height: var(--touch); }
details.disclosure > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--touch);
  list-style: none; cursor: pointer; color: var(--ui-text-strong); font-weight: 600;
}
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::after { content: "\F282"; font-family: "bootstrap-icons"; color: var(--ui-text-faint); transition: transform .15s; }
details.disclosure[open] > summary::after { transform: rotate(180deg); }
details.disclosure > summary .summary-note { color: var(--ui-text-faint); font-size: .875rem; font-weight: 400; }

/* ---- the case page: the status panel, then the case in parts — one at a time (tabs, case_tabs_controller.js) ---- */
/* The tab bar sticks under the top of the screen (under the top bar on phones) while its parts are scrolled; on a phone
   it scrolls sideways (the chosen tab is kept in view). Without JavaScript every part is shown, one below the other, and
   the bar is a row of links to them. With JavaScript the parts not chosen are hidden from the FIRST paint (the media
   query below, before the controller has run), then by their `hidden` attribute. */
.case-tabs { --case-bar-top: 0px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }
.case-tabbar {
  min-width: 0; position: sticky; top: var(--case-bar-top); z-index: 1020; margin: 0 -6px; padding: 0 6px;
  background: var(--ui-page); border-bottom: 1px solid var(--ui-border);
}
.case-tablist { position: relative; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.case-tablist::-webkit-scrollbar { display: none; }
.case-tab {
  display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 48px; padding: 0 14px; margin-bottom: -1px;
  border-bottom: 2px solid transparent; color: var(--ui-text-muted); font-size: .9375rem; font-weight: 600;
  text-decoration: none; white-space: nowrap;
}
.case-tab:hover { color: var(--ui-text-strong); border-bottom-color: var(--ui-border-strong); }
/* the ring inside the bar (the scrolling list would clip one drawn outside) */
.case-tab:focus-visible { outline-offset: -3px; border-radius: 8px; }
.case-tab[aria-selected="true"] { color: var(--ui-text-strong); border-bottom-color: var(--db-blue-400); }
.case-tab-meta {
  padding: 1px 8px; border-radius: 999px; background: var(--ui-surface-2); color: var(--ui-text-muted);
  font-size: .75rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.case-tab[aria-selected="true"] .case-tab-meta { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); }
.case-tab-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--db-amber-500); }
.case-panel { display: grid; gap: 20px; min-width: 0; }
.case-panel[hidden] { display: none !important; }
@media (scripting: enabled) {
  .case-tabs:not([data-enhanced]) > .case-panel:not(.is-default) { display: none; }
}
/* a same-page link (#estimate, #vehicles, #report…) lands its target under the stuck tab bar, not behind it */
.case-tabs [id] { scroll-margin-top: 64px; }
@media (max-width: 991.98px) { .case-tabs { --case-bar-top: calc(var(--topbar-h) + var(--safe-top)); } }
@media (pointer: coarse) { .case-tab { min-height: 52px; } }

/* the overview: one column on a phone in the order a reader wants (the totals, the report, the damage, the vehicle, the
   accident); two on a wide screen (the totals, the damage and the vehicle | the report and the accident) */
.case-overview { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.case-overview > .ov-col { display: contents; }
.ov-item:not(:has(*)) { display: none; }  /* a part with nothing to show yet (no estimate: no totals) leaves no gap */
.ov-figures { order: 1; } .ov-report { order: 2; } .ov-damage { order: 3; } .ov-vehicle { order: 4; } .ov-accident { order: 5; }
@media (min-width: 1200px) {
  .case-overview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 32%); align-items: start; }
  .case-overview > .ov-col { display: grid; gap: 20px; min-width: 0; }
  /* the totals in the narrower column: the grand total across it, the other figures two by two */
  .ov-side .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-side .stat.is-primary, .ov-side .stat:last-child:nth-child(even) { grid-column: 1 / -1; }
  .ov-side .stat-value { font-size: 1.125rem; }
  .ov-side .stat.is-primary .stat-value { font-size: 1.75rem; }
}
.summary-open { width: 100%; margin-top: 14px; }

.case-plate {
  display: inline-flex; align-items: center; padding: 2px 9px; border: 1px solid #56606e; border-radius: 6px; background: #f6f8fc;
  color: var(--db-ink); font-family: var(--mono); font-size: .875rem; font-weight: 700; letter-spacing: .04em;
}

/* key figures */
.stats { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat { display: grid; gap: 4px; min-width: 0; padding: 14px 16px; border: 1px solid var(--ui-border); border-radius: 12px; background: var(--ui-surface-sunken); }
.stat-label { color: var(--ui-text-faint); font-size: .75rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.stat-value { color: var(--ui-text-strong); font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-unit { color: var(--ui-text-muted); font-size: .8125rem; font-weight: 600; letter-spacing: .02em; }
@media (min-width: 1200px) and (max-width: 1499.98px) { .stat-value { font-size: 1.0625rem; } .stat.is-primary .stat-value { font-size: 1.25rem; } }
.stat.is-primary { border-color: var(--bs-primary-border-subtle); background: linear-gradient(135deg, rgba(36, 83, 166, .35), rgba(28, 33, 40, .6)); }
.stat.is-primary .stat-value { font-size: 1.5rem; }
.stat.is-primary .stat-label { color: var(--ui-text-muted); } /* on the blue gradient: 4.2:1 in the faint grey */
@media (max-width: 767.98px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat.is-primary { grid-column: 1 / -1; } }
/* two by two under a full-width total: a last figure left alone on its row takes the row (no empty half) */
@media (max-width: 767.98px) { .stats > .stat:last-child:nth-child(even) { grid-column: 1 / -1; } }

/* the damage findings */
.findings { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.finding { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; border: 1px solid var(--ui-border); border-radius: 12px; background: var(--ui-surface-sunken); }
.finding-name { color: var(--ui-text-strong); font-weight: 600; }
.finding-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.finding-detail { grid-column: 1 / -1; color: var(--ui-text-muted); font-size: .875rem; }

/* the estimate: a readable document, the whole width — the work / part column takes the room (the numbers keep theirs) */
.estimate-doc { font-variant-numeric: tabular-nums; }
.estimate-doc .table { margin: 0; }
.estimate-doc td.text-end { white-space: nowrap; }
.estimate-doc .line-text { color: var(--ui-text-strong); }
.estimate-doc .line-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 2px; font-size: .8125rem; }
.estimate-doc .line-part { color: var(--ui-text-faint); font-family: var(--mono); }
.estimate-doc tr.is-excluded td, .estimate-doc tr.is-excluded .line-text { color: var(--ui-text-faint); }
@media (min-width: 768px) {
  .estimate-table .col-pos { width: 3.25rem; }
  .estimate-table .col-num { width: 4.75rem; }
  .estimate-table .col-money { width: 8.75rem; }
  .estimate-table > tbody > tr > td { vertical-align: top; }
  .estimate-table > tbody > tr > td.text-end { padding-top: .75rem; }
}
/* a long AI text: two lines until opened (a <details> — no script); the whole text stays in the page for a reader */
.estimate-doc .line-more > summary { display: block; list-style: none; cursor: pointer; border-radius: 6px; }
.estimate-doc .line-more > summary::-webkit-details-marker { display: none; }
.estimate-doc .line-more:not([open]) .line-text {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.line-more-cue { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; color: var(--ui-primary-text); font-size: .8125rem; font-weight: 600; }
.line-more-cue .when-closed::after { content: "\F282"; margin-left: 4px; font-family: "bootstrap-icons"; font-size: .75em; }
.line-more-cue .when-open::after { content: "\F286"; margin-left: 4px; font-family: "bootstrap-icons"; font-size: .75em; }
.line-more[open] .when-closed, .line-more:not([open]) .when-open { display: none; }
.line-more > summary:hover .line-more-cue { text-decoration: underline; }
/* the notes beside the totals; the grand total the loudest number on the page */
.estimate-foot { display: grid; gap: 16px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--ui-border-strong); }
@media (min-width: 768px) { .estimate-foot { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); align-items: start; } }
.estimate-totals { display: grid; gap: 2px; width: 100%; margin: 0; }
.estimate-totals > div { display: flex; justify-content: space-between; gap: 16px; padding: 6px 12px; }
.estimate-totals dt { color: var(--ui-text-muted); font-weight: 500; }
.estimate-totals dd { margin: 0; color: var(--ui-text-strong); font-weight: 600; white-space: nowrap; }
.estimate-totals .is-grand { align-items: baseline; margin-top: 4px; padding: 10px 12px; border: 1px solid var(--bs-primary-border-subtle); border-radius: 10px; background: var(--bs-primary-bg-subtle); }
.estimate-totals .is-grand dt { color: #dce9fb; font-size: 1rem; font-weight: 700; }
.estimate-totals .is-grand dd { color: #fff; font-size: 1.375rem; font-weight: 750; }
.estimate-facts { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-bottom: 14px; }
.estimate-facts > span { padding: 3px 10px; border: 1px solid var(--ui-border-strong); border-radius: 999px; background: var(--ui-surface-sunken); color: var(--ui-text-muted); font-size: .8125rem; }
.estimate-notes { display: grid; gap: 6px; color: var(--ui-text-muted); font-size: .875rem; }
.estimate-notes p { margin: 0; }
.estimate-more { margin-top: 12px; border-top: 1px solid var(--ui-border-soft); }
.estimate-more-body { display: grid; gap: 6px; padding: 4px 0 2px; color: var(--ui-text-muted); font-size: .875rem; }

/* repair shops: the map beside the list on a wide screen (it stays in view while the list scrolls), above it on a phone;
   each shop a compact row */
.shops-layout { display: grid; gap: 16px; min-width: 0; }
@media (min-width: 1200px) {
  .shops-layout.has-map { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
  .shops-layout.has-map .shops-map-wrap { position: sticky; top: 64px; }
  .shops-layout.has-map .shops-map { height: min(560px, calc(100vh - 120px)); }
}
.shops-table > tbody > tr > td { vertical-align: top; }
.shop-row { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.shop-body { display: grid; gap: 3px; min-width: 0; }
.shop-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.shop-name { color: var(--ui-text-strong); font-weight: 600; overflow-wrap: anywhere; }
.shop-address { color: var(--ui-text-muted); font-size: .875rem; }
.shop-why { color: var(--ui-text-faint); font-size: .8125rem; }
.shop-list { display: grid; gap: 10px; }
.shop-rank {
  display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--ui-primary); color: #fff; font-size: .75rem; font-weight: 700;
}
.shop-rank.is-partner { background: #277a42; }
.shop-distance { color: var(--ui-text-strong); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* vehicle choice: big touch targets */
.vehicle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.vehicle-card { overflow: hidden; }
.vehicle-card.is-target { border-color: var(--bs-success-border-subtle); box-shadow: 0 0 0 1px var(--bs-success-border-subtle); }
.vehicle-crop { display: block; width: 100%; height: 170px; object-fit: cover; background: var(--ui-surface-sunken); }
/* one column that may shrink (minmax(0, …)): an implicit auto column grew to the longest word and the card's overflow
   clipped the description and the "matches the case" badge on a phone (0.14.0 audit F1) */
.vehicle-card .card-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 14px; }
.vehicle-letter {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--ui-primary);
  color: #fff; font-size: .875rem; font-weight: 700;
}
.vehicle-choose { width: 100%; min-height: 50px !important; margin-top: 6px; }
@media (max-width: 575.98px) { .vehicle-grid { grid-template-columns: minmax(0, 1fr); } .vehicle-crop { height: 200px; } }
/* not choosing: each vehicle a compact row — the crop beside its description — and one vehicle fills the row */
.vehicle-grid.is-compact { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.vehicle-grid.is-compact .vehicle-card { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.vehicle-grid.is-compact .vehicle-crop { height: 100%; min-height: 150px; max-height: 220px; }
@media (max-width: 575.98px) {
  .vehicle-grid.is-compact .vehicle-card { grid-template-columns: 116px minmax(0, 1fr); }
  .vehicle-grid.is-compact .vehicle-crop { min-height: 120px; }
}

/* report languages */
.report-rows { display: grid; gap: 10px; }


/* ---- settings: a section index (chips that jump to each card) ---- */
.section-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
@media (max-width: 767.98px) { .section-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } }
.section-nav::-webkit-scrollbar { display: none; }
#agents td .form-control { min-width: 200px; }
#agents td .form-select { min-width: 210px; }

/* ---- code blocks ---- */
.code-block {
  margin: 0; padding: 12px 14px; overflow-x: auto; border: 1px solid var(--ui-border); border-radius: 10px;
  background: var(--ui-surface-sunken); color: var(--ui-text-strong); font-size: .8125rem;
}

/* ---- the install card (PWA) ---- */
.install-card { display: none; }
.install-card.is-available {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 0 0 18px; padding: 14px 16px;
  border: 1px solid var(--bs-primary-border-subtle); border-radius: 14px;
  background: linear-gradient(135deg, rgba(36, 83, 166, .3), rgba(28, 33, 40, .9) 70%);
}
.install-card-text { flex: 1 1 260px; min-width: 0; }
.install-card-title { margin: 0; color: var(--ui-text-strong); font-weight: 650; }
.install-card-note { margin: 2px 0 0; color: var(--ui-text-muted); font-size: .875rem; }
.install-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ios-steps { margin: 6px 0 0; padding-left: 1.2rem; color: var(--ui-text-muted); font-size: .875rem; }
.nav-install { display: none !important; }
.nav-install.is-available { display: flex !important; }
html[data-standalone] .install-card, html[data-standalone] .nav-install { display: none !important; }

/* ---- the offline page ---- */
.offline-page {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(50rem 24rem at 50% -6rem, rgba(36, 83, 166, .32), transparent 70%), var(--db-slate-900);
}
.offline-card { display: grid; justify-items: center; gap: 12px; max-width: 440px; padding: 32px 26px; text-align: center; }
.offline-card h1 { margin: 6px 0 0; font-size: 1.5rem; font-weight: 750; }
.offline-card p { margin: 0; color: var(--ui-text-muted); }

/* ---- small utilities ---- */
.min-w-0 { min-width: 0; }

/* the sign-in page's legal links sit on the brand glow: the muted (not the faint) grey keeps them above 4.5:1 */
.auth-page .auth-legal a { color: var(--ui-text-muted); }

/* ---- the contact form (in the app and on the visitor's /contact page; the landing page styles it in landing.css) ---- */
.contact-card { max-width: 820px; }
.contact-page-card { max-width: 560px; }
.form-row { display: grid; gap: 16px; }
@media (min-width: 640px) { .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field-hint { margin: 6px 0 0; color: var(--ui-text-muted); font-size: .875rem; }
.field-error { margin: 6px 0 0; color: #f0a19b; font-size: .875rem; font-weight: 500; }
.form-alert { margin: 0; }
.form-alert .form-alert-title { margin: 0 0 4px; font-weight: 600; }
.form-alert ul { margin: 0; padding-left: 1.1rem; }
.form-control[readonly] { background: var(--ui-surface-2); }
.contact-submit { display: grid; gap: 10px; justify-items: start; }

/* ---- Admin → Messages ---- */
.nav-count { margin-left: auto; }
.message-unread .message-from .text-strong::before {
  content: ""; display: inline-block; width: .5em; height: .5em; margin-right: .45em; border-radius: 50%;
  background: var(--db-blue-400); vertical-align: .12em;
}
.message-from { display: block; text-decoration: none; }
.message-from .mono { color: var(--ui-text-muted); overflow-wrap: anywhere; }
.message-excerpt { min-width: 14em; color: var(--ui-text-muted); overflow-wrap: anywhere; }
.message-body { margin: 0; color: var(--ui-text-strong); white-space: pre-wrap; overflow-wrap: anywhere; }

/* the case list's report downloads (PDF, ZIP): under the status, side by side, wrapping in a narrow cell */
.case-downloads { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.case-downloads .btn { white-space: nowrap; }
