/* Give the reader a definite height. A body that can shrink to zero inside an
   intrinsically sized native dialog otherwise leaves only its padding visible. */
@media screen {
  body.premium-ui #dialog:is(.report-flow-dialog,.report-dialog)[open] {
    --report-inset:32px;
    box-sizing:border-box; display:grid; grid-template-rows:auto minmax(0,1fr) auto;
    width:min(880px,calc(100vw - var(--report-inset))); max-width:calc(100vw - var(--report-inset));
    max-height:calc(100vh - var(--report-inset)); max-height:calc(100dvh - var(--report-inset));
    padding:0; overflow:hidden; border:1px solid #d4d8d6; border-radius:22px;
    background:#f3f3f0; box-shadow:0 26px 74px -28px #22292765,0 3px 9px #252e2712;
  }
  body.premium-ui #dialog.report-dialog[open] {
    height:min(960px,calc(100vh - var(--report-inset))); height:min(960px,calc(100dvh - var(--report-inset)));
  }
  body.premium-ui #dialog:is(.report-flow-dialog,.report-dialog) :is(.dialog-header,.dialog-footer) {
    position:static; padding:16px 24px; background:#fff;
  }
  body.premium-ui #dialog:is(.report-flow-dialog,.report-dialog) .dialog-header { border:0; border-bottom:1px solid #dce0dc; }
  body.premium-ui #dialog:is(.report-flow-dialog,.report-dialog) .dialog-footer { border-top:1px solid #dce0dc; display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
  body.premium-ui #dialog:is(.report-flow-dialog,.report-dialog) .dialog-footer:empty { display:none; }
  body.premium-ui #dialog:is(.report-flow-dialog,.report-dialog) .dialog-body {
    min-height:0; min-width:0; overflow:auto; padding:16px 20px; scrollbar-gutter:stable;
    overscroll-behavior:contain;
  }
}
.report-flow-dialog .flow-status { max-width:794px; margin:0 auto; padding:16px 20px; border:1px solid #dddfd9; border-radius:13px; background:#fff; color:#273137; }
.report-flow-dialog .flow-status-line { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.report-flow-dialog .flow-status-line strong { font-size:17px; line-height:1.5; font-weight:600; }
.report-flow-dialog .flow-status-line span { color:#51605d; font-size:15px; font-variant-numeric:tabular-nums; }
.flow-steps { display:flex; gap:8px; list-style:none; margin:13px 0 0; padding:0; }
.flow-steps li { position:relative; flex:1; min-width:0; list-style:none; padding:11px 0 0; color:#586365; font-size:15px; line-height:1.5; }
.flow-steps li::before { content:""; position:absolute; top:0; left:0; right:0; height:3px; border-radius:3px; background:#e1e4e3; }
.flow-steps li[data-step-state="done"]::before { background:#6588b2; }
.flow-steps li[data-step-state="current"] { color:#174aba; font-weight:600; }
.flow-steps li[data-step-state="current"]::before { background:#1752c8; }
[data-flow-state="working"] .flow-steps li[data-step-state="current"]::before { animation:flow-activity 1.6s ease-in-out infinite alternate; }
[data-flow-state="error"] .flow-steps li[data-step-state="current"] { color:#8c5124; }
[data-flow-state="error"] .flow-steps li[data-step-state="current"]::before { background:#ac7138; }
@keyframes flow-activity { to {opacity:.45} }
.flow-result { max-width:794px; margin:0 auto; }
[data-flow-state="error"] .flow-result:not(:empty) { padding-top:16px; }
.flow-result .flow-error { margin:0; padding:12px 16px; font-size:16px; line-height:1.65; overflow-wrap:anywhere; color:#733e20; border-left:3px solid #b98042; background:#fffbf4; }
/* Once the report arrives, let it occupy the first line of the scroll area.
   The final save announcement remains available to assistive technology. */
.report-flow-dialog[data-flow-state="ready"] .flow-status {
  position:absolute; width:1px; height:1px; padding:0; border:0; overflow:hidden;
  clip-path:inset(50%); white-space:nowrap;
}
body.premium-ui #dialog.report-dialog .report-paper > header > .report-status { font-size:16px; line-height:1.5; }
body.premium-ui #dialog.report-dialog .report-edit-paper [data-report-field] {
  display:block; box-sizing:border-box; width:100%; min-width:0; min-height:52px; max-height:none;
  margin:0; padding:10px 12px; resize:vertical; overflow:hidden;
  border:1px solid #d8dee5; border-radius:8px; box-shadow:none;
  background:#fff; color:#27384a; font:inherit; line-height:1.8; letter-spacing:normal;
  cursor:text; transition:border-color .15s ease;
}
body.premium-ui #dialog.report-dialog .report-edit-paper [data-report-field]:hover { border-color:#9ab3d3; }
body.premium-ui #dialog.report-dialog .report-edit-paper [data-report-field]:focus {
  outline:2px solid #2261cf; outline-offset:1px; border-color:#2261cf; background:#fff;
}
body.premium-ui #dialog.report-dialog .report-edit-paper [data-report-field]::placeholder { color:#77818c; }
body.premium-ui #dialog.report-dialog .report-edit-paper .report-section > dl > div { align-items:start; }
body.premium-ui #dialog.report-dialog .report-edit-paper .report-section dt label { display:block; padding-top:10px; }
@media(prefers-reduced-motion:reduce) {
  body.premium-ui #dialog.report-dialog .report-edit-paper [data-report-field] { transition:none; }
}
@media screen {
  body.premium-ui #dialog.report-dialog .report-paper {
    width:min(100%,794px); margin:0 auto; background:#fff; border:1px solid #d9dcd6;
    border-radius:4px; box-shadow:0 3px 16px -10px #29312740;
  }
}
@media screen and (prefers-reduced-motion:no-preference) {
  .report-flow-dialog .flow-result > .report-paper { animation:report-appear 800ms ease-in-out; }
}
@keyframes report-appear { from { opacity:0; } to { opacity:1; } }
@media screen and (max-width:620px),screen and (max-height:500px) {
  body.premium-ui #dialog:is(.report-flow-dialog,.report-dialog)[open] { --report-inset:16px; border-radius:16px; }
  body.premium-ui #dialog:is(.report-flow-dialog,.report-dialog) :is(.dialog-header,.dialog-footer) { padding:8px 12px; }
  body.premium-ui #dialog:is(.report-flow-dialog,.report-dialog) .dialog-body { padding:8px; scrollbar-gutter:auto; }
  .report-flow-dialog .flow-status { padding:12px; }
}
@media (prefers-reduced-motion:reduce) {
  [data-flow-state="working"] .flow-steps li[data-step-state="current"]::before { animation:none; }
}
@media screen and (min-width:720px) and (max-height:520px) {
  #dialog.report-dialog .report-paper { padding:16px 24px; }
  #dialog.report-dialog .report-paper > header { display:flex; flex-wrap:wrap; align-items:center; gap:8px 16px; margin:0 0 12px; text-align:start; }
  #dialog.report-dialog .report-paper > header h1 { margin:0; font-size:22px; line-height:1.4; }
  #dialog.report-dialog .report-meta { padding-bottom:8px; margin-bottom:8px; }
  #dialog.report-dialog .report-meta > dl { display:flex; flex-wrap:wrap; gap:4px 24px; }
  #dialog.report-dialog .report-meta > dl > div { display:flex; flex-wrap:wrap; gap:4px 8px; max-width:100%; }
  #dialog.report-dialog .report-section > h2 { margin:0 0 4px; }
  #dialog.report-dialog .report-section > dl > div { padding:8px 0; }
}
@media print {
  body:has(> #dialog.report-dialog[open]) { height:auto; overflow:visible; background:white; }
  body:has(> #dialog.report-dialog[open]) > :is(.clinic-frame,#notice) { display:none!important; }
  #dialog.report-dialog::backdrop { background:transparent; backdrop-filter:none; }
  #dialog.report-dialog :is(.flow-status,.dialog-header,.dialog-footer) { display:none!important; }
  body.premium-ui #dialog.report-dialog[open],body.premium-ui #dialog.report-dialog .dialog-body,
  body.premium-ui #dialog.report-dialog .report-paper {
    position:static; inset:auto; display:block; width:auto; height:auto; max-height:none; min-height:0;
    overflow:visible; border:0; box-shadow:none; margin:0; padding:0;
  }
}
