:root {
  --ink: #172128;
  --muted: #66747c;
  --line: #d9e0e3;
  --surface: #ffffff;
  --canvas: #f1f4f4;
  --brand: #e04b2f;
  --brand-dark: #b9311c;
  --brand-soft: #fff1ed;
  --success: #237b55;
  --shadow: 0 18px 50px rgb(20 35 43 / 9%);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 10% 0, rgb(224 75 47 / 9%), transparent 26rem),
    var(--canvas);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.app-frame {
  display: grid;
  min-width: 0;
  min-height: 100vh;
  grid-template-rows: auto 1fr auto;
}

.topbar {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  padding: 12px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid rgb(23 33 40 / 8%);
  background: rgb(255 255 255 / 88%);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  color: white;
  background: var(--brand);
  font-size: 1.35rem;
  font-weight: 800;
  box-shadow: 0 8px 20px rgb(224 75 47 / 24%);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  letter-spacing: .04em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
}

.session-tools {
  align-items: center;
  gap: 14px;
  color: var(--muted);
}

.session-tools:not([hidden]) {
  display: flex;
}

main {
  display: grid;
  min-width: 0;
  align-items: start;
  padding: clamp(28px, 5vw, 72px) clamp(18px, 5vw, 80px);
}

.center-card {
  width: min(100%, 460px);
  margin: auto;
  padding: clamp(28px, 5vw, 46px);
  border: 1px solid rgb(23 33 40 / 8%);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.center-card h1,
.workspace h1 {
  margin: 4px 0 8px;
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  line-height: 1.12;
}

.eyebrow {
  margin: 0;
  color: var(--brand);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  line-height: 1.55;
}

.auth-form {
  display: grid;
  gap: 17px;
  margin-top: 28px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  font-size: .9rem;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: #fbfcfc;
  color: var(--ink);
}

.quick-create-form input,
.quick-create-form textarea,
.repair-search-form input,
.repair-overview-form input,
.repair-overview-form textarea,
.repair-status-form select,
.repair-assignment-form select,
.repair-filter-form select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: #fbfcfc;
  color: var(--ink);
  resize: vertical;
}

.quick-create-form input:focus,
.quick-create-form textarea:focus,
.repair-search-form input:focus,
.repair-overview-form input:focus,
.repair-overview-form textarea:focus,
.repair-status-form select:focus,
.repair-assignment-form select:focus,
.repair-filter-form select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgb(224 75 47 / 12%);
}

.repair-overview-form input[aria-invalid="true"],
.repair-overview-form textarea[aria-invalid="true"] {
  border-color: #b83320;
}

.repair-status-form select,
.repair-assignment-form select,
.repair-filter-form select {
  resize: none;
}

.auth-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgb(224 75 47 / 12%);
}

.auth-form small {
  color: var(--muted);
  font-weight: 400;
}

.button {
  min-height: 42px;
  padding: 10px 17px;
  border: 0;
  border-radius: 10px;
  font-weight: 750;
}

.button-primary {
  color: white;
  background: var(--brand);
}

.button-primary:hover {
  background: var(--brand-dark);
}

.button-quiet {
  color: var(--ink);
  background: #edf1f2;
}

.button-danger {
  color: white;
  background: #a52c1b;
}

.button-danger:hover {
  background: #7f2115;
}

.form-message {
  min-height: 1.4em;
  margin: 16px 0 0;
  color: #a52c1b;
  line-height: 1.4;
}

.form-success {
  min-height: 1.4em;
  margin: 16px 0 0;
  color: var(--success);
  line-height: 1.4;
  font-weight: 700;
}

#repair-card-save-state[data-state="idle"],
#repair-card-save-state[data-state="saving"] {
  color: var(--muted);
}

#repair-card-save-state[data-state="pending"] {
  color: #725617;
}

#repair-card-save-state[data-state="error"] {
  color: #a52c1b;
}

.workspace {
  width: min(100%, 1120px);
  min-width: 0;
  margin: 0 auto;
}

.welcome-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.status-chip {
  padding: 8px 12px;
  border: 1px solid #e5c7bf;
  border-radius: 999px;
  color: #8b3828;
  background: var(--brand-soft);
  font-size: .82rem;
  font-weight: 700;
}

.status-chip.is-ready {
  border-color: #b9dacb;
  color: var(--success);
  background: #eaf7f1;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 34px;
}

.action-card {
  display: grid;
  min-height: 210px;
  align-content: start;
  gap: 8px;
  padding: 26px;
  border: 1px solid rgb(23 33 40 / 9%);
  border-radius: 19px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
  box-shadow: 0 10px 32px rgb(20 35 43 / 5%);
  transition: transform .16s ease, box-shadow .16s ease;
}

.action-card:hover,
.action-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.action-card-primary {
  border-color: transparent;
  color: white;
  background: linear-gradient(145deg, #ec5c3e, #c43620);
}

.action-card strong {
  margin-top: 14px;
  font-size: 1.25rem;
}

.action-card span:last-child {
  color: var(--muted);
  line-height: 1.45;
}

.action-card-primary span:last-child {
  color: rgb(255 255 255 / 78%);
}

.action-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 14px;
  background: #edf1f2;
  font-size: 1.65rem;
}

.action-card-primary .action-icon {
  background: rgb(255 255 255 / 17%);
}

.stage-panel {
  position: relative;
  margin-top: 24px;
  padding: 26px 62px 26px 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.work-panel {
  position: relative;
  margin-top: 24px;
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid rgb(224 75 47 / 20%);
  border-radius: 19px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-heading h2,
.section-heading h2 {
  margin: 6px 0;
  font-size: 1.45rem;
}

.panel-heading .muted {
  margin: 0;
}

.quick-create-form {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(320px, 1.5fr);
  gap: 18px;
  margin-top: 24px;
}

.repair-search-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-top: 24px;
}

.repair-search-form label {
  display: grid;
  gap: 7px;
  font-size: .9rem;
  font-weight: 700;
}

.quick-create-form label {
  display: grid;
  align-content: start;
  gap: 7px;
  font-size: .9rem;
  font-weight: 700;
}

.intake-extra {
  grid-column: 1 / -1;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafa;
}

.intake-extra summary {
  cursor: pointer;
  color: var(--brand-dark);
  font-size: .9rem;
  font-weight: 750;
}

.intake-extra-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.form-actions {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 14px;
}

.form-buttons {
  display: flex;
  gap: 10px;
}

.form-actions span {
  color: var(--muted);
  font-size: .82rem;
}

.created-result {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid #b9dacb;
  border-radius: 13px;
  color: #165e41;
  background: #eaf7f1;
}

.created-check {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--success);
  font-weight: 800;
}

.created-result p,
.created-result strong,
.created-result span {
  display: block;
}

.created-result p {
  margin: 0 0 2px;
  font-size: .78rem;
  font-weight: 750;
  text-transform: uppercase;
}

.created-result strong {
  font-size: 1.2rem;
}

.created-result span:last-child {
  margin-top: 2px;
  color: #3f705d;
}

.repairs-section {
  margin-top: 34px;
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid rgb(23 33 40 / 9%);
  border-radius: 19px;
  background: var(--surface);
  box-shadow: 0 10px 32px rgb(20 35 43 / 5%);
}

.repair-filter-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) auto;
  align-items: end;
  gap: 14px;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7f9f9;
}

.repair-filter-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 750;
}

.repair-filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-state {
  min-height: 1.35em;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: .88rem;
}

.section-heading,
.list-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.count-badge {
  display: grid;
  min-width: 34px;
  height: 34px;
  place-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-size: .86rem;
  font-weight: 800;
}

.list-state {
  margin: 24px 0 4px;
  padding: 20px;
  border-radius: 12px;
  color: var(--muted);
  background: #f6f8f8;
  text-align: center;
}

.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
}

.search-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.search-summary h3 {
  margin: 0;
  font-size: 1.05rem;
}

.repairs-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: .9rem;
}

.repairs-table th,
.repairs-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #e7ebed;
  text-align: left;
  vertical-align: top;
}

.repairs-table th {
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.repairs-table th:nth-child(1) {
  width: 17%;
}

.repairs-table th:nth-child(2) {
  width: 16%;
}

.repairs-table th:nth-child(3) {
  width: 20%;
}

.repairs-table th:nth-child(4) {
  width: 31%;
}

.repairs-table th:nth-child(5) {
  width: 16%;
}

.repair-number-cell {
  color: var(--brand-dark);
  font-weight: 800;
}

.repair-link {
  padding: 0;
  border: 0;
  color: var(--brand-dark);
  background: transparent;
  font: inherit;
  font-weight: 800;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: rgb(185 49 28 / 28%);
  text-underline-offset: 3px;
}

@media (max-width: 760px) {
  .repair-filter-form {
    grid-template-columns: 1fr;
  }

  .repair-filter-actions {
    flex-wrap: wrap;
  }
}

.repair-link:hover,
.repair-link:focus-visible {
  text-decoration-color: currentcolor;
}

.button-compact {
  min-height: 36px;
  padding: 7px 11px;
  font-size: .8rem;
}

.complaint-cell {
  color: #3f4c53;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.repair-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  color: #35505f;
  background: #eaf0f3;
  font-size: .78rem;
  font-weight: 750;
}

.repair-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #638596;
  content: "";
}

.repair-status[data-color="green"] {
  color: #1f684b;
  background: #e7f6ef;
}

.repair-status[data-color="green"]::before {
  background: #2c8b63;
}

.repair-status[data-color="amber"] {
  color: #80591a;
  background: #fff4dc;
}

.repair-status[data-color="amber"]::before {
  background: #d89b2b;
}

.repair-status[data-color="red"] {
  color: #8d3529;
  background: #fdece9;
}

.repair-status[data-color="red"]::before {
  background: #c54b3a;
}

.archive-tag {
  display: inline-flex;
  margin: 6px 0 0 6px;
  padding: 4px 7px;
  border-radius: 999px;
  color: #6c5962;
  background: #eee9eb;
  font-size: .72rem;
  font-weight: 750;
}

.repair-search-table th:nth-child(1) {
  width: 15%;
}

.repair-search-table th:nth-child(2) {
  width: 12%;
}

.repair-search-table th:nth-child(3) {
  width: 14%;
}

.repair-search-table th:nth-child(4) {
  width: 18%;
}

.repair-search-table th:nth-child(5) {
  width: 22%;
}

.repair-search-table th:nth-child(6) {
  width: 11%;
}

.repair-search-table th:nth-child(7) {
  width: 8%;
}

.repair-identifiers {
  color: #3f4c53;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.repair-identifiers span {
  display: block;
}

.repair-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-right: 38px;
}

.repair-card-title-row h2 {
  margin: 6px 0 0;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
}

.repair-card-status-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.repair-card-tabs {
  display: flex;
  gap: 6px;
  margin-top: 20px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid #dde5e7;
  border-radius: 13px;
  background: #f2f5f5;
  scrollbar-width: thin;
}

.repair-card-tab {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #536066;
  font: inherit;
  font-size: .88rem;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.repair-card-tab:hover {
  color: var(--ink);
  background: #e7ecee;
}

.repair-card-tab[aria-selected="true"] {
  border-color: #d5dddf;
  background: #fff;
  color: var(--accent-dark);
  box-shadow: 0 2px 7px rgb(28 43 48 / 8%);
}

.repair-card-tab:focus-visible {
  outline: 3px solid rgb(230 74 44 / 23%);
  outline-offset: 1px;
}

.repair-card-tabpanel {
  margin-top: 18px;
}

.repair-tab-placeholder {
  min-height: 180px;
  padding: 24px;
  border: 1px dashed #cbd6d9;
  border-radius: 13px;
  background: #f8fafa;
}

.repair-tab-placeholder h3 {
  margin: 8px 0 10px;
  font-size: 1.15rem;
}

.repair-tab-placeholder > p:not(.eyebrow) {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.parts-workspace > h3 {
  margin: 8px 0 10px;
}

.parts-workspace > p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.55;
}

.parts-actions {
  display: flex;
  gap: 12px;
  align-items: end;
  margin: 16px 0 8px;
}

.catalog-search-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 10px;
  align-items: end;
  flex: 1;
}

.catalog-search-results,
.repair-parts-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.catalog-result-card,
.repair-part-card {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.catalog-result-card p,
.repair-part-card p {
  margin: 4px 0;
}

.catalog-result-card small,
.repair-part-card small,
.part-selection span {
  display: block;
  color: var(--muted);
}

.part-add-form {
  display: grid;
  grid-template-columns: 1fr minmax(100px, 140px) minmax(120px, 160px);
  gap: 12px;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #cfdadd;
  border-radius: 13px;
  background: #f7f9f9;
}

.part-selection,
.part-comment-field,
.part-add-actions,
#custom-part-name-field {
  grid-column: 1 / -1;
}

.part-selection {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.parts-list-heading,
.repair-part-card-header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.parts-list-heading {
  margin-top: 22px;
  border-bottom: 1px solid var(--line);
}

.parts-list-heading h4 {
  margin: 0 0 8px;
}

.repair-part-card {
  display: block;
}

.repair-part-card-header span {
  color: var(--accent-dark);
  font-weight: 700;
}

.repair-part-comment {
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.repair-part-status-form {
  display: flex;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.repair-part-status-form label {
  display: grid;
  flex: 1;
  gap: 6px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}

.repair-part-status-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfc;
  color: var(--ink);
}

.work-editor,
.repair-work-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #cfdadd;
  border-radius: 13px;
  background: #f7f9f9;
}

.work-editor label,
.repair-work-form label,
.checklist-item-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}

.work-editor input,
.work-editor select,
.work-editor textarea,
.repair-work-form input,
.repair-work-form select,
.repair-work-form textarea,
.checklist-item-form select,
.checklist-item-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  resize: vertical;
}

.work-name-field,
.work-comment-field,
.work-editor-actions,
.repair-work-name,
.repair-work-comment,
.repair-work-actions {
  grid-column: 1 / -1;
}

.repair-works-list,
.repair-checklist-list,
.completion-warnings {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.repair-work-card,
.checklist-item-card {
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.repair-work-summary,
.checklist-item-summary {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
}

.repair-work-summary p,
.checklist-item-summary p {
  margin: 4px 0 0;
  color: var(--muted);
}

.repair-work-status,
.checklist-result {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #edf2f3;
  color: var(--ink);
  font-size: .8rem;
  font-weight: 750;
}

.repair-work-form,
.checklist-item-form {
  margin-top: 12px;
}

.checklist-item-form {
  display: grid;
  grid-template-columns: minmax(180px, 230px) 1fr auto;
  gap: 10px;
  align-items: end;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.checklist-hint {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.completion-readiness {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f9f9;
}

.completion-readiness .parts-list-heading {
  margin-top: 0;
}

.completion-warning,
.completion-ready {
  margin: 0;
  padding: 10px 12px;
  border-radius: 9px;
}

.completion-warning {
  border: 1px solid #e9d19a;
  background: #fff8e6;
  color: #72510b;
}

.completion-ready {
  border: 1px solid #a9d6c0;
  background: #edf8f2;
  color: var(--success);
}

.history-heading {
  margin-top: 0;
}

.repair-note-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) auto;
  gap: 12px;
  align-items: end;
  margin: 16px 0;
  padding: 15px;
  border: 1px solid #cfdadd;
  border-radius: 12px;
  background: #f7f9f9;
}

.repair-note-form label,
.history-filter-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}

.repair-note-form textarea,
.repair-note-form select,
.history-filter-row select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
}

.repair-note-form textarea {
  resize: vertical;
}

.repair-note-body {
  min-width: 0;
}

.history-filter-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 10px;
}

.history-filter-row label {
  width: min(280px, 100%);
}

#repair-history-count,
#repair-audit-count {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}

.repair-history-list,
.repair-audit-list {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.history-event {
  position: relative;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.history-event::before {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: #718087;
  content: "";
}

.history-event.is-manual {
  border-color: #e9d19a;
  background: #fffaf0;
}

.history-event.is-manual::before {
  background: #c08618;
}

.history-event-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
}

.history-event-heading strong {
  color: #344148;
}

.history-event-heading time,
.history-event-author {
  color: var(--muted);
  font-size: .8rem;
}

.history-event-message {
  margin: 7px 0 0;
  white-space: pre-wrap;
}

.repair-audit {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.audit-entry {
  border: 1px solid #dce4e6;
  border-radius: 10px;
  background: #f8fafa;
}

.audit-entry summary {
  padding: 12px 14px;
  color: #344148;
  font-size: .88rem;
  font-weight: 750;
  cursor: pointer;
}

.audit-entry-content {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
  border-top: 1px solid #e2e8e9;
}

.audit-entry-meta {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: .8rem;
}

.audit-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.audit-values section {
  min-width: 0;
}

.audit-values h5 {
  margin: 0 0 5px;
}

.audit-values pre {
  max-height: 280px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  border-radius: 8px;
  background: #263238;
  color: #eef4f5;
  font-size: .75rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.final-report-heading {
  margin-top: 0;
}

.final-report-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.final-report-dates div {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7f9f9;
}

.final-report-dates dt {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}

.final-report-dates dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-weight: 750;
}

.final-report-readiness {
  margin-bottom: 18px;
}

.final-report-readiness h4 {
  margin: 0;
}

.final-report-form {
  display: grid;
  gap: 16px;
}

.final-report-text-block {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.final-report-text-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.final-report-text-heading label {
  color: #344148;
  font-size: .92rem;
  font-weight: 750;
}

.final-report-text-block textarea {
  width: 100%;
  min-height: 190px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfc;
  color: var(--ink);
  line-height: 1.5;
  resize: vertical;
}

.final-report-text-block small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.final-report-warranty {
  display: grid;
  width: min(300px, 100%);
  gap: 6px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}

.final-report-warranty input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
}

.final-report-form.is-read-only textarea,
.final-report-form.is-read-only input {
  background: #edf1f2;
}

.inspection-sections-state {
  margin-top: 16px !important;
  padding: 11px 13px;
  border-radius: 9px;
  background: #edf2f3;
  font-size: .88rem;
}

.inspection-sections-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.inspection-section {
  border: 1px solid #dce4e6;
  border-radius: 11px;
  background: #fff;
}

.inspection-section summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 44px 13px 15px;
  color: #29363b;
  font-size: .92rem;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}

.inspection-section-name {
  min-width: 0;
}

.inspection-section-summary-state {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 650;
}

.inspection-section summary::-webkit-details-marker {
  display: none;
}

.inspection-section summary::after {
  position: absolute;
  top: 50%;
  right: 16px;
  content: "+";
  color: var(--accent-dark);
  font-size: 1.15rem;
  transform: translateY(-50%);
}

.inspection-section[open] summary::after {
  content: "−";
}

.inspection-section summary:focus-visible {
  outline: 3px solid rgb(230 74 44 / 20%);
  outline-offset: -3px;
  border-radius: 9px;
}

.inspection-section-content {
  display: grid;
  gap: 9px;
  padding: 0 15px 14px;
  border-top: 1px solid #edf1f2;
}

.inspection-section-content p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.5;
}

.inspection-section-state {
  justify-self: start;
  margin-top: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e8edef;
  color: #536066;
  font-size: .76rem;
  font-weight: 750;
}

.inspection-item-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.inspection-item-form label {
  display: grid;
  align-content: start;
  gap: 7px;
  color: #344148;
  font-size: .86rem;
  font-weight: 700;
}

.inspection-item-form select,
.inspection-item-form input[type="text"],
.inspection-item-form textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  color: var(--ink);
  background: #fbfcfc;
}

.inspection-item-form select:focus,
.inspection-item-form input[type="text"]:focus,
.inspection-item-form textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgb(224 75 47 / 12%);
}

.inspection-item-comment,
.inspection-condition-fieldset,
.inspection-custom-defects-fieldset,
.inspection-measurements-fieldset,
.inspection-item-message,
.inspection-conflict-actions,
.inspection-item-actions {
  grid-column: 1 / -1;
}

.inspection-condition-fieldset,
.inspection-custom-defects-fieldset,
.inspection-measurements-fieldset {
  min-width: 0;
  margin: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.inspection-condition-fieldset legend,
.inspection-custom-defects-fieldset legend,
.inspection-measurements-fieldset legend {
  padding: 0 5px;
  color: #344148;
  font-size: .86rem;
  font-weight: 750;
}

.inspection-condition-fieldset > p,
.inspection-custom-defects-fieldset > p,
.inspection-measurements-fieldset > p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .78rem;
}

.inspection-condition-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.inspection-item-form .inspection-condition-option {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid #e2e8e9;
  border-radius: 8px;
  background: #f8fafa;
  font-size: .8rem;
  font-weight: 650;
  cursor: pointer;
}

.inspection-condition-option input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--brand);
}

.inspection-condition-option:has(input:checked) {
  border-color: rgb(224 75 47 / 40%);
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.inspection-custom-defect-rows {
  display: grid;
  gap: 9px;
}

.inspection-custom-defect-row {
  display: grid;
  grid-template-columns: minmax(150px, .35fr) minmax(260px, 1fr) auto;
  align-items: end;
  gap: 9px;
  padding: 10px;
  border: 1px solid #e2e8e9;
  border-radius: 9px;
  background: #f8fafa;
}

.inspection-custom-defect-row .button {
  min-height: 39px;
}

.inspection-custom-defect-add {
  margin-top: 10px;
}

.inspection-measurement-rows {
  display: grid;
  gap: 9px;
}

.inspection-measurement-row {
  display: grid;
  grid-template-columns:
    minmax(170px, 1fr)
    minmax(115px, .55fr)
    minmax(80px, .35fr)
    minmax(170px, 1fr)
    auto;
  align-items: end;
  gap: 9px;
  padding: 10px;
  border: 1px solid #e2e8e9;
  border-radius: 9px;
  background: #f8fafa;
}

.inspection-measurement-row .button {
  min-height: 39px;
}

.inspection-measurement-add {
  margin-top: 10px;
}

.inspection-item-form small {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 500;
}

.inspection-item-message {
  min-height: 1.2em;
}

.inspection-item-actions {
  margin-top: 2px;
}

.inspection-item-read-only {
  display: grid;
  gap: 10px;
  margin: 0;
}

.inspection-item-read-only div {
  display: grid;
  grid-template-columns: minmax(120px, .35fr) minmax(0, 1fr);
  gap: 12px;
}

.inspection-item-read-only dt {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
}

.inspection-item-read-only dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: .9rem;
}

.repair-overview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.repair-overview-toolbar h3 {
  margin: 0;
  font-size: 1.08rem;
}

.repair-overview-form,
.repair-status-form,
.repair-assignment-form,
.repair-archive-confirmation {
  margin: 20px 0;
  padding: 18px;
  border: 1px solid #e1e7e9;
  border-radius: 13px;
  background: #f8fafa;
}

.repair-overview-form:not([hidden]),
.repair-status-form:not([hidden]),
.repair-assignment-form:not([hidden]),
.repair-archive-confirmation:not([hidden]) {
  display: grid;
  gap: 16px;
}

.repair-overview-form h3,
.repair-overview-form .muted,
.repair-status-form h3,
.repair-status-form .muted,
.repair-assignment-form h3,
.repair-assignment-form .muted,
.repair-archive-confirmation h3,
.repair-archive-confirmation > p {
  margin: 0;
}

.repair-overview-form label,
.repair-status-form label,
.repair-assignment-form label {
  display: grid;
  gap: 7px;
  font-size: .9rem;
  font-weight: 700;
}

.repair-overview-form small,
.repair-status-form small,
.repair-assignment-form small {
  color: var(--muted);
  font-weight: 400;
}

.repair-overview-form .form-actions,
.repair-status-form .form-actions,
.repair-assignment-form .form-actions {
  grid-column: auto;
}

#repair-overview-conflict-actions {
  margin-top: -4px;
}

#repair-status-conflict-actions {
  margin-top: -4px;
}

#repair-assignment-conflict-actions {
  margin-top: -4px;
}

.repair-archive-confirmation {
  border-color: #e1b7ae;
  background: #fff7f5;
}

.repair-archive-confirmation > p:not(.form-message) {
  color: #653126;
  line-height: 1.5;
}

.status-transition-warning {
  padding: 14px;
  border: 1px solid #e2c57e;
  border-radius: 11px;
  background: #fff8e6;
  color: #654b10;
}

.status-transition-warning p {
  margin: 0 0 12px;
  font-weight: 700;
  line-height: 1.5;
}

.archive-note {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid #d9cdd2;
  border-radius: 10px;
  color: #6c4555;
  background: #f7f1f3;
  font-weight: 700;
}

.repair-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.repair-details > div {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid #e5eaec;
  border-radius: 11px;
  background: #f8fafa;
}

.repair-details dt {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.repair-details dd {
  margin: 6px 0 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.repair-assignee-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.repair-assignee-line .button {
  flex: 0 0 auto;
}

.repair-details .repair-details-wide {
  grid-column: 1 / -1;
}

.stage-panel h2 {
  margin: 6px 0;
}

.stage-panel p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.panel-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: #edf1f2;
  font-size: 1.3rem;
}

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

#loading-view {
  text-align: center;
}

.error-text {
  color: #a52c1b;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(20px, 4vw, 64px);
  color: var(--muted);
  font-size: .8rem;
}

.photo-workspace > h3 {
  margin-bottom: 6px;
}

.attachment-upload-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8faf9;
}

.attachment-files-field,
.attachment-caption-field,
.attachment-upload-actions,
.attachment-upload-message {
  grid-column: 1 / -1;
}

.attachment-upload-form input[type="file"] {
  padding: 10px;
  background: #fff;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  font-weight: 700;
}

.attachment-dropzone {
  display: grid;
  gap: 5px;
  justify-items: center;
  padding: 24px 18px;
  border: 2px dashed #9fb2b9;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  transition:
    border-color .16s ease,
    background .16s ease,
    transform .16s ease;
}

.attachment-dropzone span,
.attachment-dropzone small {
  color: var(--muted);
}

.attachment-dropzone:hover,
.attachment-dropzone:focus-visible,
.attachment-dropzone[data-drag-active="true"] {
  border-color: var(--accent);
  background: #edf7f4;
  outline: none;
}

.attachment-dropzone[data-drag-active="true"] {
  transform: translateY(-2px);
}

.attachment-dropzone[aria-disabled="true"] {
  cursor: wait;
  opacity: .6;
}

.attachment-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0 !important;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.attachment-queue {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.attachment-queue-state {
  margin: 0;
  color: var(--muted);
}

.attachment-queue-list {
  display: grid;
  gap: 7px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.attachment-queue-item {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.attachment-queue-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.attachment-queue-item button,
.attachment-delete-button {
  min-height: 34px;
  padding: 7px 10px;
}

.attachment-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.attachment-gallery-empty {
  grid-column: 1 / -1;
}

.attachment-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgb(20 35 43 / 6%);
}

.attachment-preview-link {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #e8edef;
}

.attachment-preview-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .16s ease;
}

.attachment-preview-missing {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--muted);
}

.attachment-preview-link:hover img {
  transform: scale(1.025);
}

.attachment-card-content {
  display: grid;
  gap: 5px;
  padding: 13px;
}

.attachment-card-content span,
.attachment-card-content p,
.attachment-card-content small {
  overflow-wrap: anywhere;
}

.attachment-card-content p {
  margin: 2px 0;
  color: var(--muted);
}

.attachment-card-content small {
  color: var(--muted);
}

.attachment-card-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 13px 13px;
}

.attachment-delete-button {
  border-color: #c88478;
  color: #8a2819;
  background: #fff8f6;
}

.attachment-delete-button:hover {
  border-color: #a64a3a;
  background: #fff0ec;
}

.settings-panel {
  display: grid;
  gap: 16px;
}

.settings-content {
  display: grid;
  gap: 12px;
}

.settings-content > details {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.settings-content > details > summary {
  padding: 15px 17px;
  cursor: pointer;
  font-weight: 800;
}

.settings-content > details > :not(summary) {
  margin-right: 17px;
  margin-left: 17px;
}

.settings-content > details > :last-child {
  margin-bottom: 17px;
}

.settings-diagnostics {
  display: grid;
  grid-template-columns: minmax(140px, 190px) 1fr;
  gap: 7px 16px;
  padding: 12px;
  border-radius: 10px;
  background: #f6f8f9;
}

.settings-diagnostics dt {
  color: var(--muted);
  font-weight: 700;
}

.settings-diagnostics dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.settings-create-form,
.settings-inline-form,
.settings-record {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-top: 13px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfc;
}

.settings-inline-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.settings-create-form label,
.settings-inline-form label,
.settings-record label,
.settings-role-fields {
  display: grid;
  gap: 6px;
  color: #32444c;
  font-weight: 700;
}

.settings-create-form input,
.settings-create-form select,
.settings-inline-form input,
.settings-record input,
.settings-record select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #b9c5ca;
  border-radius: 9px;
  background: #fff;
}

.settings-role-fields {
  display: block;
  min-width: 0;
  margin: 0;
  padding: 11px 12px 12px;
  border: 0;
  border-radius: 9px;
  background: #f1f5f6;
}

.settings-role-fields legend {
  padding: 0;
  margin-bottom: 7px;
}

.settings-role-options {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 22px;
  min-width: 0;
}

.settings-role-options .settings-check,
.settings-user-header .settings-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 32px;
  cursor: pointer;
  line-height: 1.35;
}

.settings-role-options .settings-check span,
.settings-user-header .settings-check span {
  overflow-wrap: anywhere;
}

.settings-check input,
.settings-role-fields input {
  flex: 0 0 auto;
  width: auto;
  min-height: auto;
}

.settings-user-create-form {
  gap: 16px;
  align-items: start;
  padding: 18px;
}

.settings-user-create-form > label,
.settings-user-fields > label {
  min-width: 0;
}

.settings-user-create-form .settings-role-fields,
.settings-user-create-actions {
  grid-column: 1 / -1;
}

.settings-user-create-actions,
.settings-user-actions {
  display: flex;
  justify-content: flex-end;
}

.settings-user-create-actions .button {
  min-width: 220px;
}

.settings-record.settings-user-record {
  grid-template-columns: minmax(0, 1fr);
  gap: 17px;
  align-items: start;
  padding: 18px;
}

.settings-user-header {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
  min-width: 0;
}

.settings-user-header .settings-record-heading {
  min-width: 0;
}

.settings-user-header .settings-record-heading strong,
.settings-user-header .settings-record-heading span {
  overflow-wrap: anywhere;
}

.settings-user-active {
  flex: 0 1 auto;
  color: #32444c;
  font-weight: 700;
}

.settings-user-fields {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(320px, 2fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.settings-user-fields small {
  color: var(--muted);
  font-weight: 500;
  line-height: 1.4;
}

.settings-user-actions {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.settings-user-actions .button {
  min-width: 160px;
}

.settings-user-create-form input:focus,
.settings-user-record input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgb(224 75 47 / 12%);
  outline: none;
}

.settings-user-create-form input:-webkit-autofill,
.settings-user-record input:-webkit-autofill {
  border-color: #b9c5ca;
  box-shadow: 0 0 0 1000px #fff inset;
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
}

.settings-user-create-form .button:focus-visible,
.settings-user-record .button:focus-visible,
.settings-role-options input:focus-visible,
.settings-user-active input:focus-visible {
  outline: 3px solid rgb(230 74 44 / 23%);
  outline-offset: 2px;
}

.settings-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.settings-record {
  grid-template-columns: minmax(190px, 1.2fr) repeat(3, minmax(120px, 1fr)) auto;
  margin-top: 0;
}

.settings-record-child {
  margin-left: 28px;
  border-left: 4px solid #d9e0e3;
}

.settings-record-heading {
  display: grid;
  gap: 3px;
  align-self: center;
}

.settings-record-heading span,
.settings-backup-record span {
  color: var(--muted);
  font-size: .86rem;
}

.settings-backup-actions,
.settings-backup-record {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 13px;
}

.settings-backup-record {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfc;
}

.settings-backup-record > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.settings-backup-record strong {
  overflow-wrap: anywhere;
}

#settings-message[data-state="success"] {
  color: var(--success);
}

[hidden] {
  display: none !important;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1020px) {
  .settings-user-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .settings-user-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .settings-create-form,
  .settings-inline-form,
  .settings-record,
  .settings-diagnostics {
    grid-template-columns: 1fr;
  }

  .settings-user-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-user-header {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-user-create-actions .button,
  .settings-user-actions .button {
    width: 100%;
  }

  .settings-record-child {
    margin-left: 0;
  }

  .settings-backup-record,
  .settings-backup-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .action-grid {
    grid-template-columns: 1fr;
  }

  .action-card {
    min-height: 160px;
  }

  .welcome-row,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .session-tools {
    font-size: .85rem;
  }

  #current-user {
    display: none;
  }

  .quick-create-form {
    grid-template-columns: 1fr;
  }

  .intake-extra-fields {
    grid-template-columns: 1fr;
  }

  .repair-search-form,
  .repair-details {
    grid-template-columns: 1fr;
  }

  .repair-details .repair-details-wide {
    grid-column: auto;
  }

  .repair-card-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .repair-card-status-tools {
    justify-content: flex-start;
  }

  .repair-overview-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .inspection-section summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .inspection-section-summary-state {
    flex: initial;
  }

  .inspection-item-form {
    grid-template-columns: 1fr;
  }

  .inspection-item-comment,
  .inspection-condition-fieldset,
  .inspection-custom-defects-fieldset,
  .inspection-measurements-fieldset,
  .inspection-item-message,
  .inspection-conflict-actions,
  .inspection-item-actions {
    grid-column: auto;
  }

  .inspection-condition-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inspection-custom-defect-row {
    grid-template-columns: 1fr;
  }

  .inspection-measurement-row {
    grid-template-columns: 1fr;
  }

  .inspection-item-read-only div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .attachment-upload-form {
    grid-template-columns: 1fr;
  }

  .parts-actions,
  .catalog-result-card {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-search-form,
  .part-add-form {
    grid-template-columns: 1fr;
  }

  .part-selection,
  .part-comment-field,
  .part-add-actions,
  #custom-part-name-field {
    grid-column: auto;
  }

  .work-editor,
  .repair-work-form,
  .checklist-item-form,
  .repair-note-form,
  .audit-values {
    grid-template-columns: 1fr;
  }

  .history-filter-row,
  .history-event-heading,
  .final-report-text-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .final-report-dates {
    grid-template-columns: 1fr;
  }

  .work-name-field,
  .work-comment-field,
  .work-editor-actions,
  .repair-work-name,
  .repair-work-comment,
  .repair-work-actions {
    grid-column: auto;
  }

  .repair-work-summary,
  .checklist-item-summary {
    flex-direction: column;
  }

  .attachment-files-field,
  .attachment-caption-field,
  .attachment-upload-actions,
  .attachment-upload-message {
    grid-column: auto;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .form-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .repairs-table {
    min-width: 760px;
  }

  .repair-search-table {
    min-width: 1040px;
  }
}
