/* ---------------------------------------------------
   Duration builder
--------------------------------------------------- */

.duration-container {
  margin-top: 10px;
  overflow-x: auto;
}

.duration-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Compact ISO 8601 duration editor:
   P [Y] [M] [D] T [H] [M] [S]
*/
.duration-builder {
  display: grid;
  grid-template-columns:
    18px
    92px
    92px
    92px
    18px
    92px
    92px
    92px;
  align-items: end;
  justify-content: start;
  gap: 8px 10px;
  width: max-content;
  max-width: 100%;
}

.duration-builder label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #1f2937;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
}

.duration-builder input[type="number"] {
  width: 92px;
  min-height: 34px;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #cfd6df;
  border-radius: 6px;
  background: #fff;
  color: #111827;
  font-size: 14px;
}

.duration-builder input[type="number"]:focus {
  border-color: var(--ui-accent, #388E3C);
  outline: none;
  box-shadow: 0 0 0 3px rgba(56, 142, 60, 0.12);
}

/* P and T separators */
.duration-prefix {
  display: inline-grid;
  place-items: center;
  align-self: end;
  width: 18px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #111827;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  opacity: 0.75;
}

/* Help block */
.duration-help {
  margin-top: 10px;
  padding-top: 18px;
  border-top: 1px dashed #d5dbe3;
  color: #374151;
  font-size: 13px;
  line-height: 1.55;
}

.duration-help strong {
  display: block;
  margin-bottom: 8px;
  color: #111827;
  font-size: 14px;
}

.duration-help code {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  background: #eef2f6;
  color: #334155;
  font-family: Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
}

/* Medium screens: keep compact, but slightly smaller */
@media (max-width: 900px) {
  .duration-builder {
    grid-template-columns:
      18px
      78px
      78px
      78px
      18px
      78px
      78px
      78px;
    gap: 8px 8px;
  }

  .duration-builder input[type="number"] {
    width: 78px;
  }
}

/* Small screens: wrap into two logical rows */
@media (max-width: 680px) {
  .duration-builder {
    grid-template-columns:
      18px
      78px
      78px
      78px;
    width: max-content;
  }

  .duration-builder .duration-prefix:nth-of-type(2) {
    grid-column: 1;
  }
}