.dialog-open { overflow: hidden; }
.brief-dialog {
  width: min(580px, calc(100vw - 32px));
  max-width: none;
  max-height: min(760px, calc(100dvh - 32px));
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 0;
  border-radius: 15px;
  box-shadow: 0 24px 80px #16132242;
  overflow: hidden;
}
.brief-dialog::backdrop { background: #15152494; }
.brief-shell { max-height: min(760px, calc(100dvh - 32px)); overflow: auto; overscroll-behavior: contain; }
.brief-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 8px 24px; border-bottom: 1px solid var(--line); }
.close-brief { position: relative; width: 44px; height: 44px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); }
.close-brief::before, .close-brief::after { content: ''; position: absolute; top: 21px; left: 14px; width: 16px; border-top: 2px solid currentColor; transform: rotate(45deg); }
.close-brief::after { transform: rotate(-45deg); }
.close-brief:hover { background: var(--panel); }
.brief-content { padding: 22px 28px 29px; }
.preview-label, .step-meter, .field-hint { color: var(--muted); font-size: .875rem; }
.step-meter { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 15px 0 21px; }
.meter-track { display: block; width: 108px; height: 4px; background: var(--line); }
[data-meter] { display: block; width: 25%; height: 100%; background: var(--action); transition: width 180ms ease; }
.brief-content h2 { font-family: var(--body); font-size: clamp(1.65rem, 5.2vw, 2.2rem); font-weight: 650; letter-spacing: -.035em; }
.brief-intro { margin: 11px 0 20px; color: var(--muted); }
.brief-intro:empty { margin-top: 0; }
.brief-content fieldset { display: grid; gap: 17px; min-width: 0; margin: 0; padding: 0; border: 0; }
.brief-content label { display: block; font-size: .94rem; font-weight: 600; }
.brief-content label small { margin-left: 5px; color: var(--muted); font-size: .8rem; font-weight: 400; }
.brief-content input:not([type='checkbox']), .brief-content select, .brief-content textarea {
  display: block;
  width: 100%;
  min-height: 46px;
  margin-top: 5px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #8d8e94;
  border-radius: 5px;
  caret-color: var(--action);
  font-size: 1rem;
  font-weight: 400;
}
.brief-content textarea { min-height: 80px; resize: vertical; }
.brief-content input::placeholder { color: #636672; }
.brief-content input[type='file'] { border-style: dashed; }
.brief-content ::file-selector-button { min-height: 44px; margin-right: 10px; padding-inline: 10px; color: var(--ink); background: var(--panel); border: 0; border-radius: 3px; cursor: pointer; }
.brief-content [aria-invalid='true'] { border: 2px solid #ae2437 !important; }
.field-hint { margin-top: 7px; }
.field-error, .wizard-error { margin-top: 6px; color: #a62637; font-size: .9rem; }
.field-error:empty, .wizard-error:empty { display: none; }
.upload-preview { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.upload-preview img { width: 48px; height: 48px; object-fit: contain; background: #fff; }
.upload-preview b { overflow-wrap: anywhere; }
.upload-preview button, .back-step, .result-edit { min-height: 44px; padding: 7px 9px; color: var(--action); background: transparent; border: 0; text-decoration: underline; text-underline-offset: 3px; }
.goals { display: grid; gap: 8px; margin-top: 6px; }
.goals label { display: flex; gap: 10px; align-items: center; min-height: 44px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.goals input { width: 17px; height: 17px; margin: 0; accent-color: var(--action); }
.goals label:has(:checked) { background: var(--panel); border-color: var(--action); }
.wizard-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 9px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.wizard-actions .btn { min-height: 48px; gap: 8px; }
.brief-summary, .result-summary { padding: 15px; overflow-wrap: anywhere; background: var(--panel); }
.brief-summary h3, .result-summary h3 { margin-bottom: 7px; font: 650 1.15rem/1.2 var(--body); }
.brief-summary dl > div { display: grid; grid-template-columns: minmax(84px, 27%) 1fr; gap: 9px; padding-block: 5px; border-bottom: 1px solid var(--line); font-size: .88rem; }
.brief-summary dt { color: var(--muted); }
.brief-summary > p { margin-top: 10px; font-size: .88rem; }
.proposal-result > h2 { margin-block: 16px; }

@media (max-width: 530px) {
  .brief-dialog, .brief-shell { max-height: calc(100dvh - 16px); }
  .brief-dialog { width: calc(100vw - 16px); border-radius: 10px; }
  .brief-top { padding-inline: 17px; }
  .brief-content { padding: 16px 17px max(20px, env(safe-area-inset-bottom)); }
}
