/* The Diamond Reports v3.6.7 — Apple-style report form spacing.
   Presentation only: editor-specific, no PDF stage, data, or logic overrides.
   Loaded after layout-fixes.css to resolve the older grouped-field cascade. */

/* Consistent breathing room for report details. */
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .meta-card > .ios-primary-meta > .field {
  padding:21px 20px 22px!important;
  min-width:0!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .meta-card .field > label {
  display:block!important;
  margin-bottom:10px!important;
  line-height:1.4!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .meta-card .fixed-author {
  min-height:53px!important;
  padding:13px 16px!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .prepared-by-stack {
  gap:11px!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .co-author-add {
  margin:2px 0 0!important;
  padding:12px 16px!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .meta-card .help {
  margin-top:9px!important;
}

/* Give the expandable PDF options their own inset content spacing rather
   than running the logo toggle and filename fields into the card edges. */
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .ios-advanced-options > summary {
  min-height:59px!important;
  padding:17px 42px 17px 20px!important;
  line-height:1.4!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .ios-advanced-body {
  padding:10px 19px 20px!important;
  border-color:var(--ai-line)!important;
  box-sizing:border-box!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .ios-advanced-body > .meta-grid {
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  gap:8px!important;
  min-width:0!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .ios-advanced-body > .meta-grid > .field {
  min-width:0!important;
  padding:10px 0!important;
  border:0!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .ios-advanced-body .pdf-logo-option {
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:14px!important;
  margin:10px 0 0!important;
  padding:16px!important;
  border:1px solid var(--ai-line)!important;
  border-radius:16px!important;
  background:var(--ai-field)!important;
  box-sizing:border-box!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .pdf-logo-option-copy {
  min-width:0!important;
  flex:1 1 auto!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .pdf-logo-control {
  flex:0 0 auto!important;
  gap:9px!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .legend-preview {
  margin:0 20px 19px!important;
  padding:16px 0 0!important;
  border:0!important;
  border-top:1px solid var(--ai-line)!important;
  border-radius:0!important;
  background:transparent!important;
  gap:8px!important;
  overflow:visible!important;
  flex-wrap:wrap!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .legend-item {
  padding:8px 11px!important;
  min-height:32px!important;
  box-sizing:border-box!important;
}

/* Nested client reports: inset the rows and create separation between cards.
   The parent keeps the section title and Add Client action; no overflow. */
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .clients-head {
  padding:18px 20px!important;
  min-height:66px!important;
  gap:12px!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page #clients {
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  gap:12px!important;
  padding:16px 15px 19px!important;
  min-width:0!important;
  box-sizing:border-box!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page #clients > .client-row {
  min-width:0!important;
  width:100%!important;
  margin:0!important;
  padding:0!important;
  border:1px solid var(--ai-line)!important;
  border-radius:18px!important;
  background:var(--ai-raised)!important;
  box-shadow:none!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .client-row-title {
  min-height:65px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  padding:15px 17px!important;
  margin:0!important;
  box-sizing:border-box!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .client-row.is-collapsed .client-row-title {
  min-height:65px!important;
  margin:0!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .client-row-body {
  padding:2px 17px 20px!important;
  min-width:0!important;
  box-sizing:border-box!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .client-toolbar {
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  gap:12px!important;
  margin:0 0 20px!important;
  min-width:0!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .client-row-body .field {
  min-width:0!important;
  padding:0!important;
  margin:0!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .client-row-body .field > label,
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .client-row-body .report-label-row {
  margin-bottom:9px!important;
  line-height:1.4!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .client-row-body .report-label-row label {
  margin:0!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .client-row-body :is(input[type="text"],select,textarea) {
  padding:12px 14px!important;
  min-height:50px!important;
  border-radius:13px!important;
  box-sizing:border-box!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .client-row-body textarea {
  min-height:160px!important;
  padding:14px 15px!important;
  line-height:1.65!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .clients-add-footer {
  padding:18px 20px 20px!important;
  border-top:1px solid var(--ai-line)!important;
}

/* Notes and excursion sections need more generous content insets too. */
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .report-note-card,
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .excursion-card {
  padding:20px!important;
  box-sizing:border-box!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page :is(.report-note-head,.excursion-head) {
  padding:0!important;
  margin:0 0 12px!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .report-note-card textarea {
  padding:15px 16px!important;
  line-height:1.7!important;
}
html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .excursion-card :is(.field,.excursion-outcome-wrap) {
  min-width:0!important;
}

/* iPhone SE / narrow widths: two side-by-side status fields lose readability.
   Stack only when space is genuinely insufficient. */
@media (max-width:375px) {
  html[data-design="apple"] body.ios-editor-mode #app.ios-report-page #clients {
    padding:13px 12px 16px!important;
    gap:10px!important;
  }
  html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .client-row-title {
    padding:13px 14px!important;
  }
  html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .client-row-body {
    padding:2px 14px 17px!important;
  }
  html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .client-toolbar {
    grid-template-columns:minmax(0,1fr)!important;
    gap:14px!important;
  }
  html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .meta-card > .ios-primary-meta > .field {
    padding:19px 17px!important;
  }
  html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .ios-advanced-body {
    padding:8px 16px 17px!important;
  }
  html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .legend-preview {
    margin-left:17px!important;
    margin-right:17px!important;
  }
  html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .report-note-card,
  html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .excursion-card {
    padding:17px!important;
  }
}

/* Keep the original two-column metadata field layout comfortable on desktop. */
@media (min-width:720px) {
  html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .ios-advanced-body > .meta-grid {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:18px!important;
  }
  html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .ios-advanced-body {
    padding:14px 22px 22px!important;
  }
  html[data-design="apple"] body.ios-editor-mode #app.ios-report-page #clients {
    padding:19px 20px 22px!important;
    gap:14px!important;
  }
  html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .client-row-title {
    padding:17px 21px!important;
  }
  html[data-design="apple"] body.ios-editor-mode #app.ios-report-page .client-row-body {
    padding:2px 21px 22px!important;
  }
}
