.flow-dialog {
  width: min(700px, calc(100% - 32px));
  max-height: min(90dvh, 920px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--rule);
  border-radius: 18px;
  box-shadow: 0 24px 90px #0c22443d;
}

.flow-dialog::backdrop { background: #0c224499; }
.flow-dialog .flow-panel { padding: 0; }
.flow-dialog .flow-header {
  position: sticky;
  top: 0;
  z-index: 1;
  align-items: center;
  margin: 0;
  padding: 18px clamp(18px, 5vw, 32px);
  background: #0c2244;
  color: #fff;
}

.flow-dialog .flow-header h2 { font-size: clamp(1.65rem, 5vw, 2.25rem); }
.flow-dialog .flow-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: #ffffff14;
  border-color: #ffffff42;
  color: #fff;
  font-size: 1.45rem;
}

.flow-dialog .flow-close:hover { background: #ffffff29; }
.flow-dialog .flow-close:focus-visible { outline-color: #fff; }
.flow-body { padding: clamp(18px, 5vw, 32px); }
.flow-body > p { color: var(--muted); }
.flow-body > p + p { margin-top: 10px; }
.flow-body > p + :is(.flow-form, .flow-actions) { margin-top: 18px; }
.flow-body .flow-form { gap: 16px; }
.flow-body .flow-field { gap: 6px; font-size: .91rem; }
.flow-body .flow-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.flow-body .flow-notice {
  padding: 12px 14px;
  border-inline-start: 3px solid #174fb4;
  background: #edf4ff;
  color: #0c2244;
  line-height: 1.55;
}

.flow-body :is(input:not([type=checkbox]), select, textarea) {
  min-height: 46px;
  padding: 9px 11px;
  border-color: #9bb1cd;
  font-size: 1rem;
  scroll-margin-top: 92px;
}

.flow-body textarea { min-height: 108px; }
.flow-body input[type=checkbox] { width: 20px; min-height: 20px; }
.flow-body :is(.flow-link, .flow-terms label) { min-height: 44px; }
.flow-body .flow-terms label { display: flex; align-items: center; cursor: pointer; }
.flow-body .flow-actions { gap: 10px; }
.flow-body .flow-actions .btn { min-height: 44px; }
.flow-body .flow-evidence {
  padding: 12px 14px;
  border: 1px dashed #9bb1cd;
  border-radius: 10px;
  background: #f1f5fb;
}

.flow-body .flow-evidence input { padding: 6px; color: var(--ink); }
.flow-evidence ::file-selector-button {
  padding: 6px 9px;
  margin-inline-end: 8px;
  color: #0c2244;
  background: #e4eefc;
  border: 0;
  border-radius: 5px;
  font: inherit;
  cursor: pointer;
}

.flow-report-extras, .flow-disclosure-body > fieldset {
  min-inline-size: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.flow-disclosure {
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: #f1f5fb;
}

.flow-disclosure > summary {
  padding: 11px 14px;
  min-height: 44px;
  font-weight: 720;
  color: #174fb4;
  cursor: pointer;
}

.flow-disclosure-body {
  display: grid;
  gap: 18px;
  padding: 0 14px 14px;
}

.flow-disclosure-body > fieldset {
  padding-block-start: 8px;
  border-block-start: 1px solid var(--rule);
}

.flow-disclosure-body legend {
  max-inline-size: 100%;
  padding-inline-end: 8px;
  font-size: .9rem;
  font-weight: 720;
}

.flow-submit {
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}

:root[data-theme=dark] .flow-dialog {
  background: var(--white);
  box-shadow: 0 24px 90px #0008;
}

:root[data-theme=dark] .flow-dialog::backdrop { background: #040b16b8; }
:root[data-theme=dark] .flow-dialog .flow-header { background: var(--dark); color: var(--ink); }

:root[data-theme=dark] .flow-body .flow-notice {
  border-inline-start-color: var(--blue);
  background: var(--mist);
  color: var(--ink);
}

:root[data-theme=dark] .flow-body :is(input:not([type=checkbox]), select, textarea, .flow-evidence) {
  border-color: #637895;
  background: var(--paper);
}

:root[data-theme=dark] .flow-body :is(input, textarea)::placeholder { color: var(--muted); opacity: 1; }
:root[data-theme=dark] .flow-evidence ::file-selector-button { color: var(--ink); background: var(--mist); }
:root[data-theme=dark] .flow-disclosure { background: var(--paper); }
:root[data-theme=dark] .flow-disclosure > summary { color: var(--blue); }

@media (max-width: 540px) {
  .flow-dialog { width: calc(100% - 20px); max-height: 94dvh; }
  .flow-dialog .flow-header { padding-block: 12px; }
  .flow-body .flow-row { grid-template-columns: minmax(0, 1fr); }
  .flow-body .flow-submit > button { width: 100%; }
}
