.workshop-add-panel {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--preview-bg);
}

.workshop-add-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.workshop-add-summary::-webkit-details-marker {
  display: none;
}

.workshop-add-summary-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.workshop-add-summary-hint {
  display: none;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted-color);
}

.workshop-add-panel[open] .workshop-add-summary {
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}

.workshop-add-panel[open] .workshop-add-summary-hint {
  display: none;
}

.workshop-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 0.75rem;
}

.workshop-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted-color);
}

.workshop-form-grid input,
.workshop-form-grid select,
.workshop-form-grid textarea {
  min-height: 2.75rem;
}

.workshop-form-grid textarea {
  min-height: 4.5rem;
  resize: vertical;
  font: inherit;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--text);
}

.workshop-form-full {
  grid-column: 1 / -1;
}

.workshop-form-actions {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.workshop-table-wrap {
  margin-top: 0.5rem;
}

.workshop-main-tabs {
  margin-bottom: 0.5rem;
}

.workshop-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.workshop-checkbox-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.workshop-checkbox-label input {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  accent-color: var(--accent-color);
}

.workshop-remove-fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0;
  padding: 0.75rem 0.85rem;
}

.workshop-remove-fieldset legend {
  padding: 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted-color);
}

.workshop-remove-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}

.workshop-remove-option:first-of-type {
  margin-top: 0.35rem;
}

.workshop-remove-option input {
  margin-top: 0.2rem;
  flex-shrink: 0;
  accent-color: var(--accent-color);
}

.workshop-remove-exchange {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.workshop-remove-exchange label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.workshop-vehicles-table {
  width: 100%;
  min-width: 56rem;
  table-layout: fixed;
  border-collapse: collapse;
}

.workshop-vehicles-table th,
.workshop-vehicles-table td {
  white-space: normal;
  vertical-align: top;
  word-break: break-word;
}

.workshop-vehicles-table .col-plate {
  width: 6.5rem;
}

.workshop-vehicles-table .col-vehicle {
  width: 8rem;
}

.workshop-vehicles-table .col-rental {
  width: 7rem;
}

.workshop-vehicles-table .col-condition,
.workshop-vehicles-table .col-repair,
.workshop-vehicles-table .col-tires {
  width: 5.5rem;
}

.workshop-vehicles-table .col-damage {
  width: auto;
  min-width: 10rem;
}

.workshop-vehicles-table .col-added {
  width: 7.5rem;
  white-space: nowrap;
}

.workshop-vehicles-table .col-parts {
  width: 5.5rem;
}

.workshop-vehicles-table .col-actions {
  width: 11.5rem;
  white-space: nowrap;
}

.workshop-damage-cell {
  font-size: 0.8125rem;
  line-height: 1.4;
}

.workshop-damage-text {
  display: block;
  white-space: pre-wrap;
}

.workshop-damage-empty {
  color: var(--muted-color);
}

.workshop-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.workshop-badge-good {
  background: color-mix(in srgb, var(--success-color) 18%, transparent);
  color: var(--success-color);
}

.workshop-badge-bad {
  background: color-mix(in srgb, var(--danger) 15%, transparent);
  color: var(--danger);
}

.workshop-badge-neutral {
  background: var(--ghost-bg);
  color: var(--muted-color);
}

.workshop-plate {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.workshop-filter-bar {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
}

.workshop-filter-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted-color);
  max-width: 20rem;
}

.workshop-table-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-end;
}

.workshop-edit-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: min(100%, 28rem);
}

.workshop-edit-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.workshop-edit-form select,
.workshop-edit-form textarea {
  font: inherit;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--text);
}

.workshop-edit-form textarea {
  min-height: 7rem;
  resize: vertical;
}

@media (min-width: 721px) {
  .workshop-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workshop-add-summary {
    pointer-events: none;
  }

  .workshop-add-panel[open] .workshop-add-summary {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
  }
}

@media (max-width: 720px) {
  .workshop-filter-grid {
    grid-template-columns: 1fr;
  }

  .workshop-table-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .workshop-vehicles-table .workshop-table-actions .btn {
    width: 100%;
  }

  .workshop-add-summary-hint {
    display: inline;
  }

  .workshop-add-panel:not([open]) .workshop-add-summary-hint::after {
    content: " ▾";
  }

  .workshop-add-panel[open] .workshop-add-summary-hint::after {
    content: " ▴";
  }

  .workshop-form-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .workshop-form-grid input,
  .workshop-form-grid select,
  .workshop-form-grid textarea,
  .workshop-edit-form input,
  .workshop-edit-form select,
  .workshop-edit-form textarea {
    font-size: 16px;
    min-height: 48px;
  }

  .workshop-form-grid textarea,
  .workshop-edit-form textarea {
    min-height: 5.5rem;
  }

  .workshop-form-actions,
  .workshop-add-submit {
    width: 100%;
  }

  .workshop-form-actions .btn,
  .workshop-add-submit {
    width: 100%;
    min-height: 48px;
  }

  .workshop-filter-bar {
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.75rem;
  }

  .workshop-filter-label {
    max-width: none;
  }

  .workshop-panel-refresh {
    width: 100%;
    min-height: 44px;
  }

  .workshop-table-wrap {
    margin-left: 0;
    margin-right: 0;
    overflow: visible;
    border: none;
  }

  .workshop-table-wrap .workshop-vehicles-table {
    min-width: 0;
  }

  .workshop-vehicles-table thead {
    display: none;
  }

  .workshop-vehicles-table,
  .workshop-vehicles-table tbody {
    display: block;
  }

  .workshop-vehicles-table .workshop-vehicle-row {
    display: block;
    margin-bottom: 0.75rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg);
    box-shadow: 0 1px 0 color-mix(in srgb, var(--line) 65%, transparent);
  }

  .workshop-vehicles-table .workshop-vehicle-row td {
    display: grid;
    grid-template-columns: minmax(5.25rem, 36%) 1fr;
    gap: 0.25rem 0.65rem;
    align-items: start;
    padding: 0.4rem 0;
    border: none;
    font-size: 0.9375rem;
  }

  .workshop-vehicles-table .workshop-vehicle-row td::before {
    content: attr(data-label);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted-color);
    line-height: 1.35;
    padding-top: 0.15rem;
  }

  .workshop-vehicles-table .workshop-vehicle-row td.col-plate,
  .workshop-vehicles-table .workshop-vehicle-row td.col-vehicle {
    display: block;
    grid-template-columns: unset;
    padding-top: 0;
  }

  .workshop-vehicles-table .workshop-vehicle-row td.col-plate::before,
  .workshop-vehicles-table .workshop-vehicle-row td.col-vehicle::before {
    content: none;
  }

  .workshop-vehicles-table .workshop-vehicle-row td.col-plate {
    padding-bottom: 0.15rem;
  }

  .workshop-vehicles-table .workshop-vehicle-row td.col-plate .workshop-plate {
    font-size: 1.125rem;
  }

  .workshop-vehicles-table .workshop-vehicle-row td.col-vehicle {
    font-weight: 600;
    font-size: 1rem;
    padding-bottom: 0.55rem;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid var(--line);
  }

  .workshop-vehicles-table .workshop-vehicle-row td.col-actions {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    padding-top: 0.65rem;
    margin-top: 0.35rem;
    border-top: 1px solid var(--line);
  }

  .workshop-vehicles-table .workshop-vehicle-row td.col-actions::before {
    content: none;
  }

  .workshop-vehicles-table .workshop-table-actions .btn {
    flex: 1 1 0;
    min-height: 44px;
    font-size: 0.9375rem;
  }

  .workshop-vehicles-table .workshop-vehicle-row td.col-damage {
    grid-template-columns: 1fr;
  }

  .workshop-vehicles-table .workshop-vehicle-row td.col-damage::before {
    margin-bottom: 0.15rem;
  }

  .workshop-damage-cell {
    font-size: 0.875rem;
  }

  .workshop-badge {
    font-size: 0.8125rem;
    padding: 0.2rem 0.55rem;
  }

  #login-section .form-grid input {
    font-size: 16px;
    min-height: 48px;
  }

  #login-section .form-grid button {
    min-height: 48px;
  }

  #location-form .btn {
    min-height: 48px;
  }

  .location-step-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .location-step-actions .btn {
    width: 100%;
  }
}
