/* delivery.css — Studio's delivery review, which delivery.js builds.

   Every colour, type size and control size is a role `styles.css` declares on
   `:root` and again under `[data-theme="dark"]`, so there is no dark block here.
   The one literal is the dialog's backdrop, because a custom property does not
   reach `::backdrop` in every browser this page supports. Spacing follows
   Studio's scale (4, 8, 12, 16, 24), and the form takes Studio's wide width,
   560 points (`StudioFormWidth.wide`).

   Nothing here is written from script. The shell's CSP (`style-src 'self'`)
   refuses style attributes, so state arrives as `hidden` or `disabled`, and
   these rules draw it. */

/* `styles.css` already hides `[hidden]`; repeated for the elements below that set
   a display of their own, so this file does not lean on another's rule. */
.dlv-dialog [hidden] { display: none !important; }

/* ---------------------------------------------------------------- the card */

/* A native modal `<dialog>` in the top layer: a card on the panel surface with a
   hairline and Studio's 12-point radius, cross-faded in over a 40% black scrim,
   with no blur and no shadow. The header and footer stay put; the body scrolls. */
.dlv-dialog {
  width: min(560px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
.dlv-dialog[open] { display: flex; animation: dlv-in .3s ease-in-out; }
.dlv-dialog::backdrop { background: rgba(0, 0, 0, .4); }
@keyframes dlv-in { from { opacity: 0; } }
.dlv-frame { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; }

/* `StudioFormView`'s header: the title, the "Working" indicator while the form
   confirms, and the close button, which waits while it does. */
.dlv-head { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 24px 24px 0; }
.dlv-title { flex: 1 1 auto; min-width: 0; margin: 0; font: var(--type-h1); overflow-wrap: anywhere; }
.dlv-close { width: var(--icon-button); height: var(--icon-button); flex: 0 0 var(--icon-button); display: grid; place-items: center; padding: 0; color: var(--ink); background: transparent; border: 0; border-radius: var(--radius-icon); font-size: 17px; line-height: 1; cursor: pointer; }
.dlv-close:hover:not(:disabled) { background: var(--hover); }
.dlv-close:disabled { color: var(--muted); cursor: progress; }

/* Studio's small loading indicator. Neutral, as Studio's is: orange is kept for a
   chat turn at work. */
.dlv-spinner { width: 12px; height: 12px; flex: 0 0 12px; display: inline-block; border: 1.5px solid var(--line-strong); border-top-color: var(--loading); border-radius: 50%; animation: dlv-spin .8s linear infinite; }
@keyframes dlv-spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------- the review */

/* `StudioDeliveryReviewView`: the summary in secondary ink, then the rows, 12 apart. */
.dlv-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 12px; padding: 16px 24px; }
.dlv-summary { margin: 0; color: var(--ink-soft); font: var(--type-body); }

/* `StudioDeliveryRowView`: the name on the leading edge, its note on the trailing
   one, baselines aligned, 8 above and below, with a soft hairline under each. A
   long name wraps beside its note; a note wraps only past half the row. */
.dlv-rows { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.dlv-row { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.dlv-name { flex: 1 1 auto; min-width: 0; color: var(--ink); font: var(--type-small-strong); overflow-wrap: anywhere; }
.dlv-note { flex: 0 0 auto; max-width: 50%; color: var(--muted); font: var(--type-caption); text-align: right; overflow-wrap: anywhere; }

/* What stands in for the uploaded build's features when the backend reports none. */
.dlv-caption { padding: 8px 0; color: var(--muted); font: var(--type-small); }

/* ------------------------------------------------------------- the footer */

/* Messages sit directly above the actions they are about and scroll within Studio's
   180 points (`formMessageMaximumHeight`), so the actions never leave. */
.dlv-foot { flex: 0 0 auto; display: flex; flex-direction: column; gap: 12px; padding: 0 24px 24px; }
.dlv-messages { max-height: 180px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }

/* `StudioDeliveryNoticeView`: the warning family's muted fill under its own ink,
   for the refusal and for the App Store's standing notice. `StudioFormErrorView`:
   the danger family's, for a confirmation that failed. */
.dlv-notice { margin: 0; padding: 12px; color: var(--warn-ink); background: var(--warn-bg); border-radius: var(--radius-button); font: var(--type-small); overflow-wrap: anywhere; }
.dlv-error { margin: 0; padding: 12px; color: var(--bad-ink); background: var(--bad-bg); border-radius: var(--radius-button); font: var(--type-small); overflow-wrap: anywhere; }

/* Studio's dialog buttons: equal shares of the row, 28 points, body type — the
   dismissal in the Cancel role and the answer in the primary orange. */
.dlv-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.dlv-button { height: var(--control-height); min-width: 0; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; border: 1px solid transparent; border-radius: var(--radius-button); font: var(--type-body); white-space: nowrap; text-overflow: ellipsis; cursor: pointer; transition: background-color .16s ease, border-color .16s ease, color .16s ease; }
.dlv-button.cancel { color: var(--ink); background-color: var(--panel-muted); border-color: var(--line); }
.dlv-button.cancel:hover:not(:disabled) { background-image: linear-gradient(var(--hover), var(--hover)); }
.dlv-button.primary { color: var(--on-primary); background: var(--primary); }
.dlv-button.primary:hover:not(:disabled) { background: var(--primary-hover); }
.dlv-button.primary:active:not(:disabled) { background: var(--primary-pressed); }
.dlv-button:disabled { color: var(--muted); background: var(--chip); background-image: none; border-color: transparent; cursor: not-allowed; }

@media (prefers-reduced-motion: reduce) {
  .dlv-dialog[open] { animation: none; }
  .dlv-spinner { animation: none; border-top-color: var(--loading); }
}

@media (max-width: 560px) {
  .dlv-head { padding: 20px 16px 0; }
  .dlv-body { padding: 12px 16px; }
  .dlv-foot { padding: 0 16px 20px; }
}
