/*
  Fluid tablet and phone overrides. Keep this stylesheet last so these
  responsive rules can safely refine the desktop layout.
*/

html {
  -webkit-text-size-adjust: 100%;
}

img,
canvas,
video {
  max-width: 100%;
}

.mobile-menu-toggle {
  display: none;
}

.notification-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notification-panel-close {
  display: none;
}

@media (min-width: 900px) and (max-width: 1600px) {
  .app-shell {
    grid-template-columns: clamp(196px, 23vw, 248px) minmax(0, 1fr);
  }

  .sidebar {
    position: sticky;
    top: 0;
    width: auto;
    height: 100dvh;
    padding: clamp(16px, 2.2vh, 22px) clamp(14px, 2vw, 22px);
    gap: clamp(14px, 2vh, 20px);
    overflow: hidden;
  }

  .brand {
    flex: 0 0 auto;
    min-width: 0;
  }

  .brand-subtitle,
  .nav-link small {
    font-size: 10px;
  }

  .nav-link {
    min-width: 0;
    min-height: 38px;
    padding-block: 8px;
    padding-inline: clamp(10px, 1.5vw, 16px);
  }

  .nav-list {
    flex: 0 0 auto;
    gap: 2px;
    overflow: visible;
    padding-right: 0;
  }

  .nav-section-label {
    margin-block: 10px 3px;
  }

  .sidebar-bottom-cta {
    flex: 0 0 auto;
    width: 100%;
    min-height: 40px;
    margin: auto 0 0;
    padding-inline: 12px;
  }

  .main-content {
    min-width: 0;
    padding: clamp(22px, 3.2vw, 38px);
  }

  .page-header {
    gap: clamp(18px, 2.5vw, 30px);
  }

  .page-header h1 {
    font-size: clamp(28px, 3.8vw, 42px);
  }

  .header-actions {
    width: min(100%, 520px);
  }

  .header-search-wrap,
  .header-search {
    width: 100%;
  }

  .top-controls {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .header-summary,
  .company-stat-row,
  .profile-grid,
  .mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-tools,
  .report-controls {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .status-tabs,
  .report-filter-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .overview-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fleet-cockpit {
    grid-template-columns: minmax(0, 1fr);
  }

  .fleet-list-panel,
  .selected-truck-detail {
    min-height: 0;
  }

  .fleet-card-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 0;
    max-height: none;
    overflow: visible;
  }

  .selected-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selected-detail-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selected-detail-actions .action-button {
    width: 100%;
    min-width: 0;
  }

  .overview-viewer,
  .detail-truck-visual .damage-viewer-placeholder {
    min-height: clamp(280px, 46vw, 430px);
  }

  .truck-card-header,
  .truck-card-body,
  .report-detail,
  .detail-grid {
    gap: clamp(14px, 2vw, 22px);
  }

  #view-trucks .simple-panel {
    padding: clamp(14px, 2vw, 18px);
  }

  .vehicle-registry-head {
    align-items: center;
  }

  .vehicle-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .vehicle-summary {
    grid-template-columns: minmax(90px, 0.55fr) repeat(2, minmax(0, 1fr)) auto;
    gap: 10px 12px;
    padding: 12px;
  }

  .vehicle-summary .plate {
    grid-column: 1;
    grid-row: 1;
  }

  .vehicle-summary .vehicle-registry-meta:nth-of-type(2),
  .vehicle-summary .vehicle-registry-meta:nth-of-type(3) {
    grid-row: 1;
  }

  .vehicle-summary .vehicle-registry-meta:nth-of-type(4) {
    grid-column: 1 / 3;
  }

  .vehicle-summary .vehicle-registry-meta:nth-of-type(5) {
    grid-column: 3 / 4;
  }

  .vehicle-summary .company-chevron {
    grid-column: 4;
    grid-row: 1 / 3;
  }

  .vehicle-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vehicle-history-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .company-truck-table,
  .report-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .company-table-head,
  .company-truck-row {
    min-width: 760px;
  }

  .report-table {
    min-width: 0;
  }

  .report-table th,
  .report-table td {
    padding: 9px 10px;
  }

  .dashboard-dialog {
    width: min(720px, calc(100vw - 48px));
  }
}

@media (min-width: 900px) and (max-width: 1600px) {
  #view-reports {
    min-width: 0;
    overflow: hidden;
  }

  #view-reports .report-table-wrap {
    width: 100%;
    min-width: 0;
    overflow: visible;
  }

  #view-reports .report-table {
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  #view-reports .report-table thead {
    display: none;
  }

  #view-reports .report-table tbody {
    display: grid;
    gap: 12px;
    padding: 12px;
  }

  #view-reports .report-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    overflow: hidden;
  }

  #view-reports .report-row td {
    display: grid;
    align-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 64px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #view-reports .report-row td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.1;
    text-transform: uppercase;
  }

  #view-reports .report-row td:last-child {
    grid-column: 1 / -1;
    min-height: 48px;
    border-bottom: 0;
  }

  #view-reports .report-row td:last-child::before {
    display: none;
  }

  #view-reports .report-toggle {
    width: 100%;
  }

  #view-reports .report-detail-row {
    display: block;
    width: 100%;
  }

  #view-reports .report-detail-row[hidden] {
    display: none;
  }

  #view-reports .report-detail-row > td {
    display: block;
    width: 100%;
    padding: 0;
    white-space: normal;
  }

  #view-reports .report-detail {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-width: 0;
  }

  #view-reports .report-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-reports .report-media,
  #view-reports .report-detail-main {
    min-width: 0;
  }

  #view-reports .report-thumbs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 899px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    min-width: 0;
  }

  .app-shell {
    width: 100%;
    min-height: 100vh;
    height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    height: auto;
    max-height: none;
    padding: 12px;
    gap: 0;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  }

  .brand {
    width: calc(100% - 54px);
    min-width: 0;
    align-items: center;
    padding-right: 8px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
  }

  .brand-name {
    font-size: 13px;
  }

  .brand-subtitle {
    font-size: 11px;
  }

  .mobile-menu-toggle {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    width: 42px;
    height: 42px;
    padding: 10px;
    place-content: center;
    gap: 5px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-text);
    cursor: pointer;
    touch-action: manipulation;
  }

  .mobile-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .sidebar.menu-open .mobile-menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .sidebar.menu-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .sidebar.menu-open .mobile-menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .nav-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    width: 100%;
    max-height: 0;
    margin-top: 0;
    overflow: hidden;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition:
      max-height 260ms ease,
      margin-top 180ms ease,
      padding 180ms ease,
      opacity 180ms ease,
      transform 180ms ease;
  }

  .sidebar.menu-open .nav-list {
    max-height: min(70dvh, 520px);
    margin-top: 12px;
    padding: 4px 0 2px;
    overflow-y: auto;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-section-label,
  .sidebar-bottom-cta {
    display: none;
  }

  .nav-link {
    width: 100%;
    min-height: 44px;
    align-items: center;
    padding: 9px 12px;
    font-size: 14px;
    white-space: nowrap;
  }

  .nav-link-action {
    margin: 0;
    gap: 7px;
  }

  .nav-link.disabled {
    display: none;
  }

  .main-content {
    width: 100%;
    min-width: 0;
    height: auto;
    overflow: visible;
    padding: 20px 14px 34px;
  }

  .page-header {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
  }

  h1 {
    font-size: clamp(25px, 9vw, 34px);
  }

  .page-intro {
    font-size: 14px;
  }

  .header-actions,
  .top-controls {
    width: 100%;
  }

  .header-search-wrap,
  .header-search {
    width: 100%;
  }

  .top-controls {
    justify-content: space-between;
    gap: 8px;
  }

  .user-chip {
    max-width: calc(100vw - 92px);
    min-height: 42px;
  }

  .user-chip > span:last-child,
  .language-toggle {
    min-width: 0;
  }

  .notification-panel,
  .global-search-panel {
    position: fixed;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
  }

  .notification-panel {
    top: 72px;
    bottom: 12px;
    z-index: 2000;
    max-height: calc(100dvh - 84px);
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
  }

  .notification-list {
    max-height: none;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .notification-panel-head {
    align-items: center;
  }

  .notification-panel-actions {
    flex: 0 0 auto;
  }

  .notification-panel-head #markNotificationsRead {
    min-height: 36px;
    padding-inline: 10px;
    font-size: 11px;
  }

  .notification-panel-close {
    display: inline-grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-muted);
    color: var(--text);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    touch-action: manipulation;
  }

  .notification-desktop-button {
    display: none;
  }

  .header-summary {
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header-summary > div {
    padding: 12px;
  }

  .summary-value {
    font-size: 22px;
  }

  .overview-tools {
    gap: 12px;
    margin-bottom: 16px;
  }

  .overview-stat-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .overview-stat-card {
    min-height: 92px;
    padding: 14px;
  }

  .search-field {
    max-width: none;
  }

  .search-field input {
    min-height: 46px;
    font-size: 16px;
  }

  .status-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .filter-button,
  .action-button,
  .table-link {
    min-height: 42px;
    touch-action: manipulation;
  }

  .truck-list {
    gap: 16px;
  }

  .fleet-cockpit {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .fleet-list-panel,
  .selected-truck-detail {
    min-width: 0;
    min-height: 0;
    padding: 14px;
  }

  .fleet-panel-head,
  .selected-detail-header,
  .selected-photo-panel .media-heading {
    align-items: flex-start;
  }

  .fleet-panel-head h2 {
    font-size: clamp(20px, 7vw, 26px);
  }

  .fleet-card-list {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  .fleet-vehicle-card {
    min-height: 0;
  }

  .fleet-card-info {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }

  .fleet-card-info span:first-child {
    grid-row: auto;
  }

  .fleet-card-info span:nth-child(2),
  .fleet-card-info span:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .selected-detail-header {
    flex-wrap: wrap;
  }

  .selected-detail-header h2 {
    font-size: clamp(27px, 10vw, 38px);
  }

  .selected-detail-grid,
  .selected-photo-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .selected-history-box,
  .selected-photo-panel {
    padding: 13px;
  }

  .overview-viewer,
  .detail-truck-visual .damage-viewer-placeholder {
    min-height: 230px;
    padding: 10px;
  }

  .detail-truck-visual .damage-viewer-stage {
    min-height: 190px;
  }

  .selected-detail-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .selected-detail-actions .action-button {
    width: 100%;
    min-width: 0;
  }

  .truck-card {
    width: 100%;
  }

  .truck-card-header,
  .truck-card-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
  }

  .truck-meta,
  .truck-meta-status {
    min-width: 0;
    justify-self: stretch;
    padding-right: 0;
  }

  .status-pill {
    width: fit-content;
    max-width: 100%;
  }

  .detail-grid,
  .report-detail-grid,
  .profile-grid,
  .company-stat-row,
  .company-info-grid,
  .mini-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .status-copy,
  .detail-item,
  .history-box,
  .media-panel {
    padding: 14px;
  }

  .process-timeline {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .timeline-step {
    grid-template-columns: 18px minmax(0, 1fr);
    justify-items: start;
    align-items: center;
    text-align: left;
  }

  .timeline-step::before {
    top: -10px;
    bottom: calc(100% - 8px);
    left: 7px;
    right: auto;
    width: 2px;
    height: auto;
  }

  .photo-preview {
    min-height: 170px;
  }

  .thumbnail-grid,
  .report-thumbs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .thumb {
    min-height: 72px;
  }

  .view-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .company-summary {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 15px;
  }

  .company-summary > span:not(:first-of-type) {
    grid-column: 2;
  }

  .company-status {
    justify-self: start;
  }

  .company-details {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px;
  }

  .company-truck-table,
  .report-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .report-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .report-filter-tabs {
    width: 100%;
  }

  .company-table-head,
  .company-truck-row {
    min-width: 0;
  }

  .company-truck-table {
    overflow: visible;
  }

  .company-table-head {
    display: none;
  }

  .company-truck-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin-top: 10px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
  }

  .company-truck-row > span,
  .company-truck-row > button {
    display: grid;
    align-content: center;
    justify-items: start;
    gap: 4px;
    width: 100%;
    min-width: 0;
    min-height: 58px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .company-truck-row > span::before,
  .company-truck-row > button::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.1;
    text-transform: uppercase;
  }

  .company-truck-row > .status-pill {
    grid-template-columns: auto minmax(0, 1fr);
    width: 100%;
  }

  .company-truck-row > .status-pill::before {
    grid-column: 1 / -1;
  }

  .company-truck-row > .history-toggle {
    grid-column: 1 / -1;
    border-bottom: 0;
  }

  .company-truck-row > .truck-history {
    grid-column: 1 / -1;
    margin: 0;
    padding: 12px;
    border-top: 1px dashed var(--line);
    border-bottom: 0;
  }

  .report-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  .report-table thead {
    display: none;
  }

  .report-table tbody {
    display: grid;
    gap: 12px;
    padding: 12px;
  }

  .report-table .report-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    overflow: hidden;
  }

  .report-table .report-row td {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .report-table .report-row td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.1;
    text-transform: uppercase;
  }

  .report-table .report-row td:nth-last-child(2) {
    border-bottom: 0;
  }

  .report-table .report-row td:last-child {
    grid-column: 1 / -1;
    border-bottom: 0;
  }

  .report-table .report-row td:last-child::before {
    display: none;
  }

  .report-table .report-toggle {
    width: 100%;
  }

  .report-table .report-detail-row {
    display: block;
  }

  .report-table .report-detail-row[hidden] {
    display: none;
  }

  .report-table .report-detail-row > td {
    display: block;
    padding: 0;
    white-space: normal;
  }

  .report-table .report-detail-row > td::before {
    display: none;
  }

  .report-detail {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
  }

  .report-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .simple-panel {
    padding: 16px;
  }

  #view-trucks .simple-panel {
    padding: 14px;
  }

  .vehicle-registry-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
  }

  .vehicle-registry-head h2 {
    font-size: clamp(20px, 7vw, 27px);
  }

  .vehicle-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .vehicle-summary {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px 12px;
    padding: 12px;
  }

  .vehicle-summary .plate {
    grid-column: 1;
    grid-row: 1;
  }

  .vehicle-summary .vehicle-registry-meta {
    grid-column: 1 / -1;
    overflow: visible;
  }

  .vehicle-summary .company-chevron {
    grid-column: 2;
    grid-row: 1;
  }

  .vehicle-summary strong,
  .vehicle-registry-meta strong {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .vehicle-details {
    padding: 12px;
  }

  .vehicle-detail-grid,
  .vehicle-history-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .activity-log div,
  .activity-log.compact div {
    grid-template-columns: 12px minmax(0, 1fr);
  }

  .activity-log small,
  .activity-log.compact small {
    grid-column: 2;
    white-space: normal;
  }

  .profile-hero {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
    padding: 16px;
  }

  .user-license-card {
    padding: 12px;
  }

  .license-frame {
    min-height: 560px;
    border-radius: 16px;
    padding: 22px;
  }

  .license-frame::before {
    inset: 7px;
    border-radius: 12px;
  }

  .license-top {
    align-items: flex-start;
    gap: 12px;
  }

  .license-shield {
    width: 44px;
    height: 52px;
  }

  .license-main {
    margin-top: 42px;
  }

  .license-main h3 {
    font-size: clamp(33px, 12vw, 52px);
  }

  .license-meta {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .license-meta .license-company {
    grid-column: auto;
  }

  .license-badges {
    gap: 8px;
  }

  .lightbox {
    display: none;
    grid-template-columns: 46px minmax(0, 1fr) 46px;
    align-items: center;
    justify-items: center;
    padding: 18px 12px 76px;
  }

  .lightbox.open {
    display: grid;
  }

  .lightbox-frame {
    width: min(100%, calc(100vw - 24px));
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .lightbox-frame img {
    max-height: 66vh;
  }

  .lightbox-arrow {
    position: fixed;
    top: auto;
    bottom: 18px;
    width: 46px;
    height: 46px;
    transform: none;
  }

  .lightbox-prev {
    left: calc(50% - 58px);
  }

  .lightbox-next {
    right: calc(50% - 58px);
  }

  .lightbox-arrow:hover {
    transform: none;
  }

  .lightbox-close {
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
  }

  .dashboard-dialog {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }
}

@media (min-width: 768px) and (max-width: 899px) {
  .main-content {
    padding: clamp(20px, 3.5vw, 30px);
  }

  .page-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-header h1 {
    font-size: clamp(28px, 5vw, 36px);
  }

  .header-actions {
    width: 100%;
  }

  .top-controls {
    justify-content: flex-end;
  }

  .overview-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fleet-card-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fleet-card-info {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(34px, auto));
  }

  .fleet-card-info span:first-child {
    grid-row: span 2;
  }

  .fleet-card-info span:nth-child(2),
  .fleet-card-info span:nth-child(3) {
    padding-left: 10px;
    border-left: 1px solid var(--line);
  }

  .selected-detail-grid,
  .selected-photo-grid,
  .vehicle-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selected-detail-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-table .report-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vehicle-registry-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .vehicle-summary {
    grid-template-columns: minmax(100px, 0.6fr) repeat(2, minmax(0, 1fr)) auto;
  }

  .vehicle-summary .plate {
    grid-column: 1;
    grid-row: 1;
  }

  .vehicle-summary .vehicle-registry-meta {
    grid-column: auto;
  }

  .vehicle-summary .vehicle-registry-meta:nth-of-type(2),
  .vehicle-summary .vehicle-registry-meta:nth-of-type(3) {
    grid-row: 1;
  }

  .vehicle-summary .vehicle-registry-meta:nth-of-type(4) {
    grid-column: 1 / 3;
  }

  .vehicle-summary .vehicle-registry-meta:nth-of-type(5) {
    grid-column: 3;
  }

  .vehicle-summary .company-chevron {
    grid-column: 4;
    grid-row: 1 / 3;
    align-self: center;
  }
}

@media (max-width: 420px) {
  .main-content {
    padding-inline: 12px;
  }

  .status-tabs,
  .header-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .thumbnail-grid,
  .report-thumbs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-table .report-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .company-truck-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .company-truck-row > .history-toggle {
    grid-column: 1;
  }

  .report-table .report-row td,
  .report-table .report-row td:nth-last-child(2) {
    border-bottom: 1px solid var(--line);
  }

  .report-table .report-row td:last-child {
    grid-column: 1;
    border-bottom: 0;
  }

  .vehicle-registry-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .vehicle-registry-head .access-badge {
    justify-self: start;
  }

  .license-frame {
    min-height: 600px;
    padding: 20px;
  }
}

.compact-support-chat {
  grid-template-rows: auto auto minmax(280px, 1fr) auto;
}

.support-chat-topics button {
  display: inline-flex;
  width: auto;
  min-width: 0;
  height: 34px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

@media (max-width: 767px) {
  body.auth-ready {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }

  .mobile-action-dock {
    position: fixed;
    z-index: 80;
    right: 10px;
    bottom: 8px;
    left: 10px;
    display: grid;
    grid-template-columns: 0.9fr 1.35fr;
    gap: 6px;
    border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
    border-radius: 18px;
    padding: 7px 7px calc(7px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: 0 16px 40px rgba(14, 31, 47, 0.24);
    backdrop-filter: blur(18px);
  }

  body.auth-locked .mobile-action-dock {
    display: none;
  }

  .mobile-action-dock button {
    display: grid;
    min-width: 0;
    min-height: 52px;
    place-items: center;
    gap: 2px;
    border: 0;
    border-radius: 13px;
    padding: 6px 4px;
    background: transparent;
    color: var(--text);
    font: inherit;
  }

  .mobile-action-dock button > span {
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
  }

  .mobile-action-dock button > small {
    max-width: 100%;
    overflow: hidden;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
    text-overflow: ellipsis;
  }

  .mobile-action-dock .mobile-action-primary {
    background: linear-gradient(135deg, var(--accent), #36a7b5);
    color: #fff;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 28%, transparent);
  }

  .mobile-selected-vehicle {
    position: sticky;
    z-index: 6;
    top: 6px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
    border-radius: 15px;
    padding: 10px 11px;
    background: color-mix(in srgb, var(--surface) 95%, transparent);
    box-shadow: 0 10px 24px rgba(20, 42, 57, 0.13);
    backdrop-filter: blur(14px);
  }

  #view-overview .fleet-detail-panel {
    display: none;
  }

  #view-support .compact-support-chat {
    grid-template-rows: auto auto minmax(180px, 42dvh) auto;
  }

  #view-support .support-chat-topics {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 10px 12px;
    scrollbar-width: none;
  }

  .mobile-selected-vehicle > div {
    min-width: 0;
  }

  .mobile-selected-vehicle small,
  .mobile-selected-vehicle strong {
    display: block;
  }

  .mobile-selected-vehicle small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .mobile-selected-vehicle strong {
    overflow: hidden;
    margin-top: 2px;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-selected-vehicle button {
    min-height: 42px;
    border: 0;
    border-radius: 11px;
    padding: 0 13px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
  }

  #dashboardDialog.mobile-vehicle-sheet {
    width: 100%;
    max-width: none;
    max-height: 91dvh;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
  }

  #dashboardDialog.mobile-vehicle-sheet .dialog-content {
    max-height: calc(91dvh - 64px);
    overflow-y: auto;
    padding: 12px;
  }

  #dashboardDialog.mobile-vehicle-sheet .selected-truck-detail {
    border: 0;
    padding: 0;
    box-shadow: none;
  }

  #dashboardDialog.mobile-vehicle-sheet .overview-viewer {
    min-height: 250px;
  }

  .wizard-location-card,
  .dispatch-map-card {
    grid-template-columns: minmax(0, 1fr);
    padding: 11px;
  }

  .wizard-location-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .wizard-location-actions .action-button {
    width: 100%;
  }

  .location-map-frame {
    min-height: 190px;
  }
}

/* Responsive login experience */
@media (min-width: 900px) and (max-width: 1366px) {
  .login-screen {
    grid-template-columns: minmax(300px, 0.78fr) minmax(430px, 1.22fr);
    min-height: 100dvh;
    background: linear-gradient(125deg, #141b2b 0%, #1d293c 43%, #f7f9fb 43.2%, #eef3f6 100%);
  }

  .login-brand-panel {
    min-width: 0;
    padding: clamp(30px, 4vw, 50px);
  }

  .login-copy {
    max-width: 430px;
  }

  .login-copy h1 {
    font-size: clamp(42px, 5.4vw, 66px);
  }

  .login-copy p {
    font-size: clamp(14px, 1.5vw, 17px);
    line-height: 1.55;
  }

  .login-card-panel {
    min-width: 0;
    padding: clamp(64px, 7vw, 92px) clamp(28px, 5vw, 64px) 38px;
  }

  .login-card {
    width: min(100%, 480px);
    padding: clamp(24px, 3vw, 32px);
  }
}

@media (max-width: 899px) {
  body.auth-locked {
    min-height: 100dvh;
    overflow: hidden;
  }

  .login-screen {
    position: fixed;
    inset: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background:
      radial-gradient(circle at 82% 8%, rgba(51, 166, 178, 0.24), transparent 26%),
      linear-gradient(180deg, #141b2b 0 34%, #eef3f6 34.2% 100%);
  }

  body.dark-theme .login-screen {
    background:
      radial-gradient(circle at 82% 8%, rgba(88, 199, 211, 0.18), transparent 26%),
      linear-gradient(180deg, #0f1726 0 34%, #101820 34.2% 100%);
  }

  .login-tools {
    position: absolute;
    top: max(14px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
  }

  .login-brand-panel {
    min-height: clamp(210px, 32dvh, 290px);
    justify-content: space-between;
    gap: 28px;
    padding:
      max(72px, calc(env(safe-area-inset-top) + 62px))
      clamp(20px, 5vw, 42px)
      42px;
  }

  .login-brand .brand-mark {
    width: 38px;
    height: 38px;
  }

  .login-copy {
    max-width: 620px;
  }

  .login-copy h1 {
    margin: 12px 0 8px;
    font-size: clamp(36px, 8vw, 54px);
  }

  .login-copy p {
    font-size: clamp(14px, 2.2vw, 16px);
    line-height: 1.5;
  }

  .login-card-panel {
    align-content: start;
    min-width: 0;
    padding:
      0
      clamp(16px, 5vw, 42px)
      max(28px, env(safe-area-inset-bottom));
  }

  .login-card {
    width: min(100%, 560px);
    margin-top: -24px;
    padding: clamp(22px, 4vw, 30px);
    border-radius: 20px;
    gap: 16px;
  }

  .login-card h2 {
    font-size: clamp(25px, 5vw, 31px);
  }

  .login-field input {
    min-height: 48px;
    height: 48px;
    font-size: 16px;
  }

  .login-submit,
  .login-demo-button {
    min-height: 48px;
  }
}

@media (min-width: 768px) and (max-width: 899px) and (orientation: landscape) {
  .login-screen {
    grid-template-columns: minmax(280px, 0.8fr) minmax(420px, 1.2fr);
    grid-template-rows: minmax(100dvh, auto);
    background: linear-gradient(125deg, #141b2b 0 40%, #f7f9fb 40.2% 100%);
  }

  body.dark-theme .login-screen {
    background: linear-gradient(125deg, #0f1726 0 40%, #101820 40.2% 100%);
  }

  .login-brand-panel {
    min-height: 100dvh;
    padding: max(74px, calc(env(safe-area-inset-top) + 64px)) 30px 34px;
  }

  .login-copy h1 {
    font-size: clamp(38px, 6vw, 54px);
  }

  .login-card-panel {
    align-content: center;
    padding: 72px 30px 30px;
  }

  .login-card {
    margin-top: 0;
    padding: 22px;
    gap: 13px;
  }

  .login-card h2 {
    margin-top: 8px;
  }
}

@media (max-width: 767px) {
  .login-screen {
    background:
      radial-gradient(circle at 82% 7%, rgba(51, 166, 178, 0.26), transparent 30%),
      linear-gradient(180deg, #141b2b 0 29%, #eef3f6 29.2% 100%);
  }

  body.dark-theme .login-screen {
    background:
      radial-gradient(circle at 82% 7%, rgba(88, 199, 211, 0.2), transparent 30%),
      linear-gradient(180deg, #0f1726 0 29%, #101820 29.2% 100%);
  }

  .login-tools {
    left: auto;
    gap: 8px;
  }

  .login-language-toggle,
  .login-theme-button {
    min-height: 42px;
  }

  .login-brand-panel {
    min-height: 190px;
    padding:
      max(66px, calc(env(safe-area-inset-top) + 58px))
      18px
      34px;
  }

  .login-brand {
    gap: 10px;
  }

  .login-brand .brand-subtitle {
    max-width: 210px;
  }

  .login-copy .access-badge {
    display: none;
  }

  .login-copy h1 {
    margin: 8px 0 5px;
    font-size: clamp(32px, 11vw, 44px);
  }

  .login-copy p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .login-card-panel {
    padding-inline: 12px;
  }

  .login-card {
    margin-top: -18px;
    padding: 20px 16px;
    border-radius: 18px;
    gap: 14px;
  }

  .login-card h2 {
    margin: 8px 0 5px;
    font-size: clamp(23px, 7vw, 28px);
  }

  .login-card p {
    font-size: 13px;
    line-height: 1.4;
  }

  .login-options {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .login-options button {
    min-height: 36px;
    padding: 0;
    text-align: left;
  }
}

@media (max-width: 420px) {
  .login-brand-panel {
    min-height: 174px;
  }

  .login-brand .brand-subtitle {
    display: none;
  }

  .login-card {
    border-radius: 16px;
  }
}

@media (max-width: 899px) and (max-height: 620px) {
  .login-brand-panel {
    min-height: 150px;
    padding-bottom: 26px;
  }

  .login-copy p,
  .login-brand .brand-subtitle {
    display: none;
  }

  .login-copy h1 {
    margin-bottom: 0;
  }

  .login-card-panel {
    padding-bottom: 18px;
  }
}

/* Access management and cost reporting */
.access-management,
.cost-dashboard {
  display: grid;
  gap: 16px;
}

.access-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.access-hero h2,
.access-create h3,
.role-permission-panel h3,
.cost-layout h2 {
  margin: 6px 0;
}

.access-hero p {
  margin: 0;
  color: var(--muted);
}

.access-hero > strong {
  font-size: clamp(38px, 6vw, 68px);
  color: var(--accent-dark);
}

.access-create,
.access-user-card,
.role-permission-card {
  display: grid;
  gap: 16px;
}

.access-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.access-form-grid label,
.access-active {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.access-form-grid input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--text);
  padding: 0 12px;
}

.access-assignment-grid,
.role-permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.access-assignment-grid fieldset,
.role-permission-card {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
  padding: 12px;
}

.access-assignment-grid legend {
  padding-inline: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.access-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 4px 12px 4px 0;
  font-size: 13px;
}

.access-user-list {
  display: grid;
  gap: 12px;
}

.access-user-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.access-user-head,
.access-card-actions,
.cost-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.access-user-head div {
  display: grid;
  gap: 3px;
}

.access-user-head small,
.cost-list small {
  color: var(--muted);
}

.access-active {
  display: inline-flex;
  align-items: center;
}

.role-permission-card > div {
  display: flex;
  flex-wrap: wrap;
}

.cost-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.cost-summary-grid article {
  min-height: 120px;
  display: grid;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.cost-summary-grid span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.cost-summary-grid strong {
  font-size: clamp(28px, 4vw, 42px);
}

.cost-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.cost-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.cost-list article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
  padding: 12px;
}

.cost-list article > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.cost-list b {
  white-space: nowrap;
}

.wizard-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.wizard-photo-grid figure {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
  overflow: hidden;
}

.wizard-photo-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
}

.wizard-photo-grid figcaption {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
}

.wizard-photo-grid button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
}

.wizard-connectivity {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.wizard-mini-status.offline {
  border-color: color-mix(in srgb, var(--yellow) 40%, var(--line));
  background: color-mix(in srgb, var(--yellow) 12%, var(--surface));
  color: var(--text);
}

@media (max-width: 899px) {
  .access-form-grid,
  .access-assignment-grid,
  .role-permission-grid,
  .cost-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .cost-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wizard-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wizard-connectivity {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .access-hero,
  .access-user-head,
  .access-card-actions,
  .cost-list article {
    align-items: flex-start;
    flex-direction: column;
  }

  .cost-summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cost-list b {
    white-space: normal;
  }

  .wizard-photo-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Preserve the physical license-plate proportions after legacy list overrides. */
.vehicle-summary .license-plate,
.company-truck-row .license-plate,
.report-table .license-plate,
.fleet-vehicle-card .license-plate,
.mini-card .license-plate,
.plate-list .license-plate {
  grid-template-columns: 15px minmax(0, 1fr);
  width: 108px;
  min-width: 108px;
  height: 23px;
  min-height: 23px;
  padding: 1px 5px 1px 0;
  border-left-width: 1px;
  font-family: "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0.025em;
}

.license-plate .license-plate-eu .license-plate-country {
  color: #fff !important;
  opacity: 1;
  text-shadow: none;
  -webkit-text-fill-color: #fff !important;
}

#view-trucks .vehicle-summary {
  grid-template-columns:
    minmax(146px, 0.6fr)
    minmax(180px, 1.2fr)
    minmax(170px, 1fr)
    minmax(145px, 0.8fr)
    minmax(150px, 0.85fr)
    24px;
}

#view-trucks .vehicle-summary .license-plate {
  grid-column: auto;
  grid-row: auto;
  justify-self: start;
  align-self: center;
  box-sizing: border-box;
  width: 128px;
  min-width: 128px;
  max-width: 128px;
  height: 28px;
  min-height: 28px;
  padding: 1px 7px 1px 0;
  border-left-width: 1px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
}

#view-trucks .license-plate > .license-plate-eu {
  display: grid;
  overflow: visible;
}

#view-trucks .license-plate > .license-plate-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  overflow: visible;
}

#view-trucks .license-plate-number > .license-plate-block {
  display: inline-block;
  overflow: visible;
}

.license-plate-heading {
  margin: 0;
  line-height: 1;
}

@media (min-width: 761px) and (max-width: 1060px) {
  #view-trucks .vehicle-summary {
    grid-template-columns: minmax(140px, 0.65fr) repeat(4, minmax(0, 1fr)) 24px;
  }
}

@media (max-width: 760px) {
  #view-trucks .vehicle-summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #view-trucks .vehicle-summary .license-plate {
    grid-column: 1;
    grid-row: 1;
  }
}

@media (max-width: 520px) {
  .vehicle-summary .license-plate,
  .company-truck-row .license-plate,
  .report-table .license-plate {
    transform-origin: left center;
  }
}
/* Author display rules must never override semantic visibility. */
[hidden] {
  display: none !important;
}

@media (max-width: 767px) {
  #view-reports .report-table tbody {
    display: block;
    padding: 2px 2px 16px;
  }

  #view-reports .report-row {
    position: relative;
    margin: 0 0 16px;
    border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
    border-left: 4px solid var(--accent);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 7px 18px rgba(20, 42, 57, 0.08);
    overflow: hidden;
  }

  #view-reports .report-row:nth-of-type(4n + 3) {
    border-left-color: color-mix(in srgb, var(--accent) 64%, var(--yellow));
  }

  #view-reports .report-row td {
    background: transparent;
  }

  #view-reports .report-row td:first-child {
    background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  }

  #view-reports .report-row td:first-child strong {
    font-size: 14px;
  }

  #view-reports .report-toggle {
    min-height: 44px;
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  }

  #view-reports .report-toggle:active {
    background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  }

  #view-reports .report-row:has(+ .report-detail-row:not([hidden])) {
    margin-bottom: 0;
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
    box-shadow: none;
  }

  #view-reports .report-detail-row:not([hidden]) {
    margin: 0 0 16px;
    border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
    border-top: 0;
    border-left: 4px solid var(--accent);
    border-radius: 0 0 14px 14px;
    background: var(--surface);
    box-shadow: 0 8px 20px rgba(20, 42, 57, 0.1);
    overflow: hidden;
  }
}

/* Targeted mobile fixes: searchable compact vehicle registry, login spacing, support chat alignment. */
.vehicle-registry-controls {
  margin: 0 0 12px;
}

.registry-search-field {
  display: grid;
  max-width: 520px;
  gap: 6px;
}

.registry-search-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.15;
  text-transform: uppercase;
}

.registry-search-field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.registry-search-field input:focus {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-soft) 56%, transparent);
  outline: none;
}

@media (max-width: 899px) {
  .login-screen {
    grid-template-rows: auto auto;
    align-content: start;
    row-gap: 0;
    background: var(--bg) !important;
  }

  .login-brand-panel {
    min-height: auto !important;
    gap: 18px;
    padding:
      max(72px, calc(env(safe-area-inset-top) + 62px))
      clamp(18px, 5vw, 42px)
      clamp(28px, 5dvh, 44px) !important;
    background:
      radial-gradient(circle at 82% 8%, rgba(51, 166, 178, 0.24), transparent 30%),
      linear-gradient(135deg, #141b2b 0%, #123342 100%);
  }

  .login-card-panel {
    padding-top: clamp(18px, 3dvh, 30px) !important;
    background: var(--bg);
  }

  .login-card {
    margin-top: 0 !important;
    transform: none !important;
  }

  body.dark-theme .login-screen {
    background: var(--bg) !important;
  }

  body.dark-theme .login-brand-panel {
    background:
      radial-gradient(circle at 82% 8%, rgba(88, 199, 211, 0.2), transparent 30%),
      linear-gradient(135deg, #0f1726 0%, #123040 100%);
  }

  body.dark-theme .login-card-panel {
    background: var(--bg);
  }
}

@media (max-width: 767px) {
  .login-brand-panel {
    min-height: auto !important;
    padding-bottom: clamp(24px, 4dvh, 36px) !important;
  }

  .login-copy h1 {
    margin-top: 4px;
  }

  .login-card {
    margin-top: 0 !important;
  }

  #view-trucks .vehicle-registry-head {
    gap: 8px;
    margin-bottom: 10px;
  }

  #view-trucks .vehicle-registry-controls {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 2px 0 10px;
    background: var(--bg);
  }

  #view-trucks .registry-search-field {
    max-width: none;
  }

  #view-trucks .vehicle-list {
    max-height: min(58dvh, 560px) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    padding-right: 4px;
    scrollbar-width: thin;
  }

  #view-trucks .vehicle-summary {
    grid-template-columns: minmax(96px, auto) minmax(0, 1fr) 28px !important;
    min-height: 58px;
    gap: 3px 10px !important;
    align-items: center;
    padding: 8px 10px !important;
  }

  #view-trucks .vehicle-summary .license-plate {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  #view-trucks .vehicle-meta-model {
    display: grid !important;
    grid-column: 2;
    grid-row: 1;
  }

  #view-trucks .vehicle-meta-status {
    display: grid !important;
    grid-column: 2;
    grid-row: 2;
  }

  #view-trucks .vehicle-meta-company,
  #view-trucks .vehicle-meta-report {
    display: none !important;
  }

  #view-trucks .vehicle-registry-meta small {
    display: none;
  }

  #view-trucks .vehicle-registry-meta strong {
    font-size: 12.5px;
    line-height: 1.2;
  }

  #view-trucks .vehicle-summary .company-chevron {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
  }

  #view-support .compact-support-chat {
    min-height: auto;
    grid-template-rows: auto minmax(180px, 42dvh) auto;
  }

  #view-support .support-chat-header {
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
  }

  #view-support .support-chat-body {
    min-height: 180px;
    max-height: 42dvh;
    overflow-y: auto;
    padding: 12px;
  }

  #view-support .support-message {
    max-width: 100%;
  }

  #view-support .support-chat-form {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 12px 12px;
  }

  #view-support .support-chat-form .action-button {
    width: 100%;
    min-height: 40px;
  }
}

@media (max-width: 420px) {
  .login-brand-panel {
    min-height: auto !important;
    padding-bottom: 22px !important;
  }
}
