/* Keep native form controls inside their card, including on iOS Safari. */
.file-field,
.tool-panel .file-field {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 14px;
  margin: 14px 0 10px;
  overflow: visible;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.file-field input[type="file"] {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #31545f;
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 44px;
}

.file-field input::file-selector-button {
  min-height: 44px;
  max-width: 100%;
  margin: 0 10px 0 0;
  padding: 9px 12px;
  border: 1px solid #9fbcc4;
  border-radius: 8px;
  background: #fff;
  color: #194e5b;
  font: inherit;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
}

input[type="date"] {
  display: block;
  box-sizing: border-box;
  min-width: 0;
  min-inline-size: 0;
  max-width: 100%;
  max-inline-size: 100%;
  min-height: 46px;
  -webkit-appearance: none;
  appearance: none;
  background-color: #fff;
  color: #173e48;
}

input[type="date"]::-webkit-date-and-time-value {
  min-height: 1.5em;
  text-align: left;
}

.detail .photo-section h3 {
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 22px 0 12px;
  line-height: 1.6;
}

.photo-section h3 .small { white-space: nowrap; }
.photo-section > .small { margin: 10px 0 18px; line-height: 1.7; }
.photo-grid > * { min-width: 0; }

@media screen and (max-width: 760px) {
  .progress-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px 16px;
  }
  .progress-copy {
    grid-column: 1 / -1;
    flex-wrap: wrap;
    gap: 6px 12px;
    white-space: normal;
    line-height: 1.6;
  }
  .progress-footer progress { width: 100%; min-width: 0; }
  .progress-footer .text-button { min-height: 44px; margin: 0; }
}

@media screen and (max-width: 370px) {
  .file-field, .tool-panel .file-field { padding: 12px; }
  .photo-grid { grid-template-columns: minmax(0, 1fr); }
}
