body[data-garage-app] {
  background: #eef1f4;
  min-width: 0;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body[data-garage-app] [hidden] {
  display: none !important;
}

.runtime-error {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid #8f3c3c;
  background: #fff0f0;
  color: #6f2525;
  padding: 10px max(12px, env(safe-area-inset-right, 0)) 10px max(12px, env(safe-area-inset-left, 0));
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.app-header .nav {
  width: min(1440px, calc(100% - 24px));
}

.app-main-menu {
  position: relative;
  margin-left: auto;
}

.app-main-menu summary {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  font-size: 24px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.app-main-menu summary::-webkit-details-marker {
  display: none;
}

.app-main-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  z-index: 40;
  width: min(320px, calc(100vw - 24px));
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #19222e;
  box-shadow: var(--shadow);
  padding: 12px;
}

.app-main-menu-user {
  display: grid;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  margin-top: 6px;
  padding-top: 10px;
}

.mobile-quick-nav {
  display: none;
}

.garage-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: calc(100vh - 76px);
  min-height: calc(100dvh - 76px);
}

.login-screen {
  min-height: calc(100vh - 76px);
  min-height: calc(100dvh - 76px);
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-panel {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-brand {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-brand img {
  width: 62px;
  height: 62px;
  object-fit: contain;
}

.login-brand h1 {
  margin: 0;
  font-size: 34px;
}

.app-sidebar {
  position: sticky;
  top: 76px;
  align-self: start;
  display: grid;
  gap: 6px;
  min-height: calc(100vh - 76px);
  min-height: calc(100dvh - 76px);
  padding: 18px 12px;
  border-right: 1px solid var(--line);
  background: #19222e;
}

.app-tab {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font: inherit;
  font-weight: 800;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
}

.app-tab:hover,
.app-tab.active {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.app-workspace {
  min-width: 0;
  padding: 28px;
}

.app-topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 22px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.topbar-account {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.app-user-menu {
  position: relative;
  justify-self: end;
}

.app-user-menu summary {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.app-user-menu summary::-webkit-details-marker {
  display: none;
}

.app-user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  min-width: 240px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 10px;
}

.app-main-menu .sync-state {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.84);
  text-align: center;
}

.settings-status {
  margin: 0;
}

.app-topbar h1 {
  font-size: clamp(32px, 5vw, 54px);
}

.sync-state,
.muted {
  color: var(--muted);
  font-size: 14px;
}

.sync-state {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  padding: 8px 12px;
  font-weight: 800;
}

.app-view {
  display: none;
}

.app-view.active {
  display: block;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 18px;
}

.panel h2 {
  font-size: 24px;
}

.panel h3 {
  font-size: 18px;
}

.panel p {
  color: var(--muted);
}

.ordered-parts-panel {
  margin-top: 18px;
}

.ordered-parts-panel .table-wrap {
  max-height: min(58vh, 560px);
}

.ordered-parts-panel .data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-actions,
.table-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.order-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin: 0 0 14px;
}

.order-actions label {
  min-width: 220px;
}

.clocked-hours {
  display: grid;
  gap: 8px;
}

.clocked-hours-summary,
.clocked-hour-line {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  padding: 10px;
}

.clocked-hours-summary {
  display: grid;
  gap: 4px;
}

.clocked-hours-summary span,
.clocked-hour-line span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.clocked-hour-line p {
  margin: 4px 0 0;
}

.clocked-hour-line label {
  max-width: 180px;
  margin-top: 8px;
}

.panel-head input,
.panel-head select,
.search-row input,
.search-row select {
  max-width: 360px;
}

.catalog-controls {
  display: grid;
  grid-template-columns: minmax(120px, 0.25fr) minmax(170px, 0.35fr) minmax(280px, 0.75fr) minmax(280px, 0.65fr);
  gap: 12px;
  margin-bottom: 12px;
}

.split-panel {
  display: grid;
  grid-template-columns: minmax(360px, 0.85fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.settings-stack {
  display: grid;
  gap: 18px;
}

.vehicle-panels,
.workorder-panels {
  grid-template-columns: minmax(420px, 0.85fr) minmax(0, 1fr);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-grid.compact {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 18px;
}

.metric strong {
  display: block;
  font-size: 32px;
  line-height: 1;
}

.metric span {
  color: var(--muted);
  font-weight: 800;
}

.profit-chart {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
}

.profit-bar {
  display: grid;
  grid-template-columns: minmax(120px, 0.28fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  color: #344052;
  font-size: 13px;
  font-weight: 800;
}

.profit-bar-track {
  min-height: 18px;
  border-radius: 999px;
  background: #eef1f4;
  overflow: hidden;
}

.profit-bar-fill {
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: #25697d;
}

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

.form-grid .panel-head,
.form-grid .wide {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 6px;
  color: #344052;
  font-size: 13px;
  font-weight: 800;
}

.form-help {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.password-toggle {
  min-width: 44px;
  min-height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
}

.password-toggle-eye {
  width: 19px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 50%;
  position: relative;
  display: inline-block;
}

.password-toggle-eye::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.password-toggle.is-visible .password-toggle-eye::before {
  content: "";
  width: 24px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-35deg);
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  padding: 9px 10px;
  font: inherit;
}

textarea {
  resize: vertical;
}

.stack-list {
  display: grid;
  gap: 10px;
}

.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.list-row p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.vehicle-thumb {
  width: 76px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.vehicle-photo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.vehicle-photo-row .vehicle-thumb {
  cursor: zoom-in;
}

.vehicle-overview {
  display: grid;
  gap: 14px;
  width: min(100%, 1120px);
  max-width: 100%;
  min-width: 0;
  max-height: 86vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.vehicle-overview-dialog {
  width: min(1120px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  overflow-x: hidden;
}

.vehicle-overview,
.vehicle-overview * {
  min-width: 0;
  max-width: 100%;
}

.vehicle-overview-hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(260px, 1fr);
  gap: 16px;
  align-items: start;
}

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

.vehicle-overview-photo-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
}

.vehicle-overview-chart {
  display: grid;
  gap: 8px;
}

.mileage-point {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: #344052;
  font-size: 13px;
  font-weight: 800;
}

.mileage-track {
  min-height: 12px;
  border-radius: 999px;
  background: #eef1f4;
  overflow: hidden;
}

.mileage-fill {
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: #b46a31;
}

.apk-callout {
  border: 1px solid rgba(37, 105, 125, 0.24);
  border-radius: 8px;
  background: rgba(80, 182, 210, 0.13);
  padding: 16px;
}

.apk-callout strong {
  display: block;
  font-size: 28px;
  line-height: 1.1;
}

.vehicle-overview-section {
  display: grid;
  gap: 10px;
  overflow: hidden;
}

.vehicle-overview-section h3 {
  margin: 0;
}

.vehicle-overview-section .list-row {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.vehicle-overview-section .row-actions {
  justify-content: flex-start;
}

.vehicle-overview-section strong,
.vehicle-overview-section p {
  overflow-wrap: anywhere;
}

.vehicle-scroll-list {
  max-height: min(68vh, 720px);
  overflow: auto;
  padding-right: 4px;
}

.vehicle-client-group {
  display: grid;
  gap: 8px;
}

.vehicle-client-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 9px 12px;
  color: #344052;
  font-size: 14px;
}

.photo-viewer {
  display: grid;
  gap: 12px;
  min-width: min(92vw, 860px);
}

.photo-viewer img {
  width: 100%;
  max-height: 76vh;
  border-radius: 8px;
  object-fit: contain;
  background: #111820;
}

.client-row {
  align-items: start;
}

.client-overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 14px;
  align-items: start;
}

.client-scroll-list {
  max-height: min(68vh, 720px);
  overflow: auto;
  padding-right: 4px;
}

.client-map-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.client-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.client-map-head h3 {
  margin: 0;
}

.client-map-plot {
  position: relative;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f5;
  overflow: hidden;
}

.client-map-plot .leaflet-container,
.client-map-plot.leaflet-container {
  min-height: 420px;
  border-radius: 8px;
  font: inherit;
}

.client-leaflet-pin {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 2px solid var(--white);
  border-radius: 50% 50% 50% 0;
  background: #25697d;
  box-shadow: 0 2px 8px rgba(20, 39, 53, 0.28);
  transform: rotate(-45deg);
}

.client-leaflet-pin.company {
  background: #b46a31;
}

.client-map-fallback {
  padding: 18px;
  color: var(--muted);
}

.client-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.client-detail-grid h3 {
  margin: 0 0 6px;
  color: #344052;
  font-size: 13px;
  text-transform: uppercase;
}

.client-detail-grid p {
  font-size: 13px;
}

.link-row {
  display: block;
  width: 100%;
  min-height: 0;
  border: 0;
  background: transparent;
  color: #25697d;
  padding: 3px 0;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.link-row:hover {
  text-decoration: underline;
}

.supplier-row {
  align-items: start;
}

.supplier-scroll-list {
  max-height: min(68vh, 720px);
  overflow: auto;
  padding-right: 4px;
}

.supplier-history {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  color: #344052;
  font-size: 13px;
}

.supplier-order {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: var(--white);
}

.supplier-order-head,
.supplier-order-line {
  display: grid;
  grid-template-columns: 120px 120px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.supplier-order-head {
  font-weight: 900;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.row-actions button,
.small-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 7px 10px;
  cursor: pointer;
}

.row-actions button.danger {
  border-color: rgba(184, 39, 47, 0.35);
  color: var(--red);
}

.small-button.danger {
  border-color: rgba(184, 39, 47, 0.35);
  color: var(--red);
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.catalog-search-box {
  position: relative;
  width: min(520px, 100%);
}

.catalog-search-box input {
  max-width: none;
}

.catalog-suggestions {
  position: absolute;
  z-index: 8;
  inset: calc(100% + 6px) 0 auto 0;
  overflow: auto;
  max-height: 340px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.catalog-suggestions button {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.catalog-suggestions button:hover {
  background: #f4f8fa;
}

.catalog-suggestions span,
.catalog-suggestions small {
  color: var(--muted);
}

.catalog-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.72fr) minmax(420px, 1fr);
  gap: 16px;
  align-items: start;
}

.diagram-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.diagram-panel img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.catalog-table-wrap {
  max-height: min(66vh, 720px);
  min-height: 420px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  background: var(--white);
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4f6f8;
  color: #344052;
  font-size: 13px;
  text-transform: uppercase;
}

.table-input {
  min-width: 150px;
  min-height: 34px;
  padding: 6px 8px;
}

.data-table tr.highlight-row td {
  background: rgba(80, 182, 210, 0.18);
  box-shadow: inset 4px 0 0 var(--blue);
}

.catalog-part-cell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.catalog-part-cell img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: rgba(80, 182, 210, 0.13);
  color: #25697d;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.photo-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.photo-strip img {
  width: 82px;
  height: 62px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
}

.line-editor {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

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

.line-row {
  grid-template-columns: 1.2fr 0.6fr 0.7fr 0.9fr auto;
  margin-top: 8px;
}

.labor-row {
  grid-template-columns: 1.4fr 0.5fr 0.8fr auto;
}

.part-row {
  grid-template-columns: minmax(160px, 1.35fr) 0.5fr minmax(120px, 0.85fr) 0.75fr 0.75fr 0.85fr 0.8fr 0.75fr auto;
}

.part-column-head {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.external-row {
  grid-template-columns: 0.55fr 0.55fr minmax(180px, 1.4fr) 0.75fr 0.9fr 0.65fr 0.75fr auto;
}

.fluid-row {
  grid-template-columns: minmax(180px, 1.5fr) 0.65fr 0.65fr 0.8fr 0.9fr 0.75fr auto;
}

.service-task-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 120px auto;
  gap: 8px;
  align-items: center;
}

.checkbox-list {
  display: grid;
  gap: 8px;
}

.task-option {
  min-height: 38px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 8px 4px;
}

.task-option input,
.completion-checks input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  flex: 0 0 20px;
}

.task-option span,
.completion-checks span {
  min-width: 0;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.section-help {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.completion-checks,
.completion-photos {
  display: grid;
  gap: 10px;
}

.completion-checks .checkbox-line {
  align-items: flex-start;
  min-height: 38px;
}

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

.completion-photo-preview img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.completion-error {
  padding: 12px;
  border: 1px solid #b42318;
  border-radius: 6px;
  background: #fff1f0;
  color: #8a1c13;
  white-space: pre-line;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.report-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.report-controls select,
.report-controls input {
  min-width: 130px;
}

.plan-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.plan-controls label {
  min-width: 160px;
}

.planboard-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 900;
}

.planboard-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 68vh;
}

.plan-grid {
  display: grid;
  min-width: 980px;
  background: var(--white);
}

.plan-head-cell,
.plan-bay-cell,
.plan-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.plan-head-cell {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f4f6f8;
  padding: 10px;
  color: #344052;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.plan-head-cell.today {
  background: #dfe3e8;
  color: #1f2935;
}

.plan-bay-cell {
  position: sticky;
  left: 0;
  z-index: 1;
  display: grid;
  gap: 3px;
  align-content: start;
  background: #fbfcfd;
  padding: 10px;
}

.plan-bay-cell span {
  color: var(--muted);
  font-size: 12px;
}

.plan-bay-cell.special.other,
.plan-cell.special.other,
.plan-bay-cell.special.birthday-row,
.plan-cell.special.birthday-row {
  min-height: 58px;
  background: #f8fafc;
}

.plan-bay-cell.special.ground {
  background: #f3f8f5;
}

.plan-cell {
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 86px;
  border-top: 0;
  border-left: 0;
  background: var(--white);
  padding: 8px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.plan-cell.today {
  background: #f0f2f4;
}

.plan-cell:hover {
  background: #f8fafc;
}

.plan-cell.today:hover {
  background: #e6eaee;
}

.plan-item {
  display: grid;
  gap: 2px;
  border-radius: 6px;
  color: var(--white);
  padding: 7px 8px;
  font-size: 12px;
}

.plan-item.has-workorder {
  background: #31855b;
}

.plan-item.no-workorder {
  background: #2877b8;
}

.plan-cell.special.ground .plan-item.no-workorder,
.plan-cell.special.ground .plan-item.has-workorder {
  background: #4f7d4f;
}

.plan-item.appointment.vacation {
  background: #9a6a1f;
}

.plan-item.appointment.adv {
  background: #587a35;
}

.plan-item.appointment.sick {
  background: #8f3c3c;
}

.plan-item.appointment.visit {
  background: #1f7a76;
}

.plan-item.appointment.other {
  background: #586274;
}

.plan-item.birthday.client {
  background: #7b5aa6;
}

.plan-item.birthday.employee {
  background: #b45a7c;
}

.plan-item small {
  color: rgba(255, 255, 255, 0.86);
}

.bay-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(150px, 0.8fr) auto;
  gap: 8px;
  align-items: center;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-line input {
  width: auto;
  min-height: auto;
}

.schedule-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.file-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.app-dialog {
  width: min(960px, calc(100% - 28px));
  max-height: min(900px, calc(100vh - 28px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.result-limit-notice {
  margin: 12px 0 0;
  border: 1px solid #d7dee7;
  border-radius: 8px;
  background: #f7f9fb;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.load-more-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid #d7dee7;
  border-radius: 8px;
  background: #f7f9fb;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 800;
}

@media (max-width: 1080px) {
  .garage-shell {
    display: block;
  }

  .app-sidebar {
    display: none;
  }

  .app-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .split-panel,
  .vehicle-panels,
  .workorder-panels,
  .catalog-layout,
  .vehicle-overview-hero {
    grid-template-columns: 1fr;
  }

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

  .app-workspace {
    padding: 24px 20px;
  }

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

  .client-overview-layout,
  .supplier-overview-layout {
    grid-template-columns: 1fr;
  }

  .client-map-plot .leaflet-container,
  .client-map-plot.leaflet-container {
    min-height: 340px;
  }

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

  [data-time-entry-form],
  [data-time-entry-form] .form-grid {
    grid-template-columns: 1fr;
  }

  [data-time-entry-form] .wide {
    grid-column: auto;
  }
}

@media (max-width: 680px) {
  body[data-garage-app] {
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0));
  }

  body[data-garage-app].login-active {
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .mobile-quick-nav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 50;
    display: flex;
    gap: 2px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    background: #19222e;
    padding: 5px max(4px, env(safe-area-inset-right, 0)) calc(5px + env(safe-area-inset-bottom, 0)) max(4px, env(safe-area-inset-left, 0));
    box-shadow: 0 -8px 24px rgba(14, 22, 31, 0.16);
  }

  .mobile-quick-nav::-webkit-scrollbar {
    display: none;
  }

  body.login-active .mobile-quick-nav {
    display: none;
  }

  .mobile-quick-nav .app-tab {
    flex: 0 0 72px;
    min-width: 72px;
    min-height: 54px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    padding: 4px 2px;
    border-radius: 7px;
    text-align: center;
    scroll-snap-align: start;
  }

  .mobile-quick-nav .app-tab span {
    font-size: 20px;
    line-height: 1;
  }

  .mobile-quick-nav .app-tab small {
    max-width: 100%;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.1;
    text-overflow: ellipsis;
  }

  .app-header .nav {
    width: auto;
    min-height: 60px;
    margin: 0;
    padding: env(safe-area-inset-top, 0) max(12px, env(safe-area-inset-right, 0)) 0 max(12px, env(safe-area-inset-left, 0));
  }

  .app-header .brand img {
    width: 42px;
    height: 50px;
  }

  .app-main-menu-panel {
    position: fixed;
    inset: calc(62px + env(safe-area-inset-top, 0)) max(8px, env(safe-area-inset-right, 0)) auto max(8px, env(safe-area-inset-left, 0));
    width: auto;
    max-height: calc(100dvh - 76px - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .login-screen {
    min-height: calc(100dvh - 60px - env(safe-area-inset-top, 0));
    place-items: start stretch;
    padding: 16px max(12px, env(safe-area-inset-right, 0)) calc(16px + env(safe-area-inset-bottom, 0)) max(12px, env(safe-area-inset-left, 0));
  }

  .login-panel {
    width: 100%;
    padding: 18px;
  }

  .login-brand img {
    width: 52px;
    height: 52px;
  }

  .login-brand h1 {
    font-size: 28px;
  }

  .app-workspace {
    padding: 16px max(10px, env(safe-area-inset-right, 0)) calc(24px + env(safe-area-inset-bottom, 0)) max(10px, env(safe-area-inset-left, 0));
  }

  .app-topbar,
  .panel-head {
    display: grid;
  }

  .app-topbar {
    gap: 10px;
    margin-bottom: 14px;
  }

  .app-topbar h1 {
    font-size: clamp(26px, 9vw, 36px);
    line-height: 1.08;
  }

  .topbar-account {
    display: none;
  }

  .panel {
    padding: 14px;
  }

  .panel-head {
    gap: 10px;
    align-items: stretch;
  }

  .panel-head .button,
  .panel-head input,
  .panel-head select,
  .search-row input,
  .search-row select {
    width: 100%;
    max-width: none;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  button,
  .button,
  .small-button,
  .file-button,
  summary {
    touch-action: manipulation;
  }

  .form-grid,
  .metric-grid,
  .catalog-controls,
  .bay-row,
  .line-row,
  .labor-row,
    .part-row,
    .external-row,
    .fluid-row,
    .service-task-row,
    .list-row,
  .profit-bar,
  .mileage-point {
    grid-template-columns: 1fr;
  }

  .supplier-order-head,
  .supplier-order-line {
    grid-template-columns: 1fr;
  }

  .client-detail-grid {
    grid-template-columns: 1fr;
  }

  .client-overview-layout {
    grid-template-columns: 1fr;
  }

  .completion-photo-grid,
  .completion-photo-preview {
    grid-template-columns: 1fr;
  }

  .part-column-head {
    display: none;
  }

  .client-scroll-list {
    max-height: 56vh;
  }

  .metric-grid.compact {
    grid-template-columns: 1fr;
  }

  .metric {
    padding: 14px;
  }

  .table-wrap,
  .catalog-table-wrap,
  .planboard-wrap,
  .vehicle-scroll-list,
  .client-scroll-list,
  .supplier-scroll-list {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
  }

  .catalog-layout {
    gap: 12px;
  }

  .catalog-controls {
    grid-template-columns: 1fr;
  }

  .catalog-table-wrap .data-table {
    min-width: 640px;
  }

  .diagram-panel img {
    max-height: 55dvh;
    object-fit: contain;
  }

  .app-dialog,
  .vehicle-overview-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: max(16px, env(safe-area-inset-top, 0)) max(12px, env(safe-area-inset-right, 0)) calc(18px + env(safe-area-inset-bottom, 0)) max(12px, env(safe-area-inset-left, 0));
    box-sizing: border-box;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
  }

  .app-dialog *,
  .app-dialog form,
  .app-dialog fieldset,
  .app-dialog .form-grid,
  .app-dialog .line-editor,
  .app-dialog .line-row {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .app-dialog input,
  .app-dialog select,
  .app-dialog textarea,
  .app-dialog .table-wrap {
    width: 100%;
    max-width: 100%;
  }

  .photo-viewer {
    min-width: 0;
  }

  .photo-viewer img {
    max-height: 72dvh;
    object-fit: contain;
  }

  .row-actions,
  .topbar-actions,
  .order-actions,
  .schedule-dialog-actions {
    justify-content: stretch;
  }

  .row-actions > *,
  .topbar-actions > *,
  .order-actions > *,
  .schedule-dialog-actions > * {
    flex: 1 1 100%;
  }
}
