/* Correctifs iPhone : aucun champ ne doit imposer sa largeur native. */
.icon-button,
.close {
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 0;
}

.control-icon {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dots-icon {
  fill: currentColor;
  stroke: none;
}

.section-head button,
.attachment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.inline-icon,
.attachment-icon {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.empty-icon {
  display: block;
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

dialog,
dialog form,
.form-row,
.form-row > *,
.vehicle-form label,
dialog label {
  min-width: 0;
}

.vehicle-form input,
.vehicle-form select,
dialog input,
dialog select,
dialog textarea {
  min-width: 0;
  max-width: 100%;
}

dialog {
  max-height: calc(100dvh - 24px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#entryDialog .dialog-head {
  position: relative;
  padding: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

#entryDialog input,
#entryDialog select {
  width: 100%;
  height: 52px;
  min-height: 52px;
  padding: 0 12px;
}

#entryDialog input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  line-height: 52px;
  text-align: left;
}

#entryDialog input[type="date"]::-webkit-date-and-time-value {
  display: flex;
  align-items: center;
  height: 52px;
  min-width: 0;
  margin: 0;
  line-height: normal;
  text-align: left;
}

#entryDialog input[type="date"]::-webkit-datetime-edit {
  padding: 0;
}

.ct-form input,
.ct-form select,
.ct-form .file-picker,
.ct-form .primary,
.ct-form .ct-report-link .attachment {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  border-radius: 14px;
}

.ct-form input,
.ct-form select {
  height: 52px;
  padding: 0 12px;
}

.ct-form input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  line-height: 52px;
  text-align: left;
}

.ct-form input[type="date"]::-webkit-date-and-time-value {
  display: flex;
  align-items: center;
  height: 52px;
  min-width: 0;
  margin: 0;
  line-height: normal;
  text-align: left;
}

.ct-form input[type="date"]::-webkit-datetime-edit {
  padding: 0;
}

.ct-form .file-picker,
.ct-form .primary,
.ct-form .ct-report-link .attachment {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ct-form .ct-report-link .attachment {
  margin: 0;
  padding: 0 12px;
}

html.modal-open,
html.modal-open body {
  overflow: hidden;
  overscroll-behavior: none;
}

html.modal-open body {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
}

#entryDialog textarea {
  width: 100%;
  min-height: 88px;
}

#entryDialog .file-picker,
#entryDialog .primary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
}

.dialog-head h2 {
  min-width: 0;
  padding-right: 10px;
  line-height: 1.15;
}

.dialog-head .close {
  flex: 0 0 42px;
}

dialog .primary,
dialog .secondary,
dialog .file-picker {
  min-height: 50px;
  line-height: 1.2;
  white-space: normal;
}

textarea {
  resize: vertical;
}

button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus {
  outline: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--green) 52%, transparent);
  outline-offset: 2px;
}

dialog:focus {
  outline: none;
}

.toast {
  width: max-content;
  max-width: calc(100% - 32px);
  white-space: normal;
  text-align: center;
}

@media (max-width: 430px) {
  .form-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  #entryDialog .form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  #entryDialog label {
    margin-bottom: 12px;
  }

  dialog {
    width: calc(100% - 20px);
    padding: 20px;
    border-radius: var(--radius-card);
  }

  .dialog-head h2 {
    font-size: 20px;
  }

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

  .color-grid-open {
    max-height: 230px;
  }
}

@media (max-width: 350px) {
  #entryDialog .form-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}
