/* Sugarbot UI kit: containers (decisions C1-C5). Needs tokens.css and base.css. */

/* C1 Card. The heading band is the guide's list title on Plum, over a 2px Molasses rule. */
.sb-card {
  background: var(--sb-surface);
  border: 1px solid var(--sb-card-border);
  border-radius: var(--sb-radius-card);
  box-shadow: var(--sb-shadow-card);
  overflow: hidden;
}
.sb-card__heading {
  margin: 0;
  padding: 11px 16px;
  background: var(--sb-color-plumb);
  color: var(--sb-color-sweet-tooth);
  border-bottom: 2px solid var(--sb-color-molasses);
  font-family: var(--sb-list-title-font);
  font-weight: var(--sb-list-title-weight);
  font-style: var(--sb-list-title-style);
  letter-spacing: var(--sb-list-title-tracking);
  text-transform: var(--sb-list-title-case);
  font-size: 13.5px;
  line-height: 1.3;
}
.sb-card__body { padding: 16px; display: grid; gap: 16px; }
.sb-card__body > * { margin: 0; }
/* Fact lists and field rows run to the card edge and pad themselves. */
.sb-card__body--flush { padding: 0; gap: 0; }

/* Cards in a grid. auto-fill, not auto-fit, so a lone card does not stretch across the row. */
.sb-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 16px; align-items: start; }

/* C2 Fact list: <dl class="sb-facts"><dt>Email</dt><dd>…</dd>…</dl> */
.sb-facts { display: grid; grid-template-columns: auto 1fr; margin: 0; padding: 0 16px; }
.sb-facts > dt, .sb-facts > dd { border-bottom: 1px solid var(--sb-hairline); align-self: stretch; }
.sb-facts > dt {
  padding: 11px 14px 11px 0;
  font-family: var(--sb-list-title-font);
  font-weight: var(--sb-list-title-weight);
  font-style: var(--sb-list-title-style);
  letter-spacing: var(--sb-list-title-tracking);
  text-transform: var(--sb-list-title-case);
  font-size: 12.5px;
  color: var(--sb-muted);
}
.sb-facts > dd {
  margin: 0;
  padding: 11px 0 11px 14px;
  font-size: 14.5px;
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere; /* a long email wraps instead of being clipped by the card */
}
.sb-facts > :nth-last-child(-n + 2) { border-bottom: 0; }

/* C3 Notice. The variant colours only the dot; the heading text always names the state, so colour
   is never the only signal. No side stripe. No display rule on .sb-notice itself, so `hidden`
   needs no help to win. */
.sb-notice {
  --sb-notice-dot: var(--sb-color-molasses);
  background: var(--sb-surface);
  border: 1px solid var(--sb-hairline);
  border-radius: var(--sb-radius-control);
  padding: 12px 16px;
}
.sb-notice__row { display: flex; gap: 16px; align-items: flex-start; }
.sb-notice__copy { flex: 1; min-width: 0; }
.sb-notice__heading { margin: 0 0 2px; font-size: 15px; font-weight: 600; color: var(--sb-color-plumb); }
.sb-notice__heading::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sb-notice-dot);
  margin-right: 8px;
  vertical-align: 1px;
}
.sb-notice__text { margin: 0; font-size: 14px; line-height: 1.5; color: var(--sb-body-muted); }
/* A one-line notice: the message carries the dot itself, at body weight, with no
   heading. For flashes and toasts whose whole text is one sentence. */
.sb-notice__message { margin: 0; font-size: 15px; line-height: 1.5; color: var(--sb-color-plumb); }
.sb-notice__message::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sb-notice-dot);
  margin-right: 8px;
  vertical-align: 1px;
}
.sb-notice--success { --sb-notice-dot: var(--sb-color-spearmint); }
.sb-notice--info { --sb-notice-dot: var(--sb-color-peppermint); }
.sb-notice--warning { --sb-notice-dot: var(--sb-color-molasses); }
.sb-notice--error { --sb-notice-dot: var(--sb-destructive); }
.sb-notice--error .sb-notice__heading,
.sb-notice--error .sb-notice__message { color: var(--sb-error-text); }

/* C4 Toast: a notice that floats bottom-right. Put it in a role="status" region.
   Rule: errors and regulated text NEVER auto-dismiss; a message that disappears before it is read
   was not shown. Only routine confirmations may time out, and not under 5 seconds. */
.sb-toasts {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 900;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
}
.sb-toast { box-shadow: var(--sb-shadow-modal); animation: sb-toast-in var(--sb-duration) var(--sb-ease); }
@keyframes sb-toast-in { from { opacity: 0; transform: translateY(8px); } }

/* C5 Dialog: native <dialog> opened with showModal(), which gives Escape, a focus trap and inert
   background with no script. Title is the card heading band; set aria-labelledby on the dialog. */
.sb-dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: 90vh;
  margin: auto; /* the UA centres a modal this way; a product's * { margin: 0 } reset undoes it */
  padding: 0;
  border: 1px solid var(--sb-card-border);
  border-radius: var(--sb-radius-card);
  background: var(--sb-surface);
  color: var(--sb-color-plumb);
  box-shadow: var(--sb-shadow-modal);
  overflow: auto;
}
.sb-dialog::backdrop { background: var(--sb-scrim); }
.sb-dialog--wide { width: min(600px, calc(100vw - 32px)); }
.sb-dialog--xl { width: min(1000px, calc(100vw - 32px)); }
.sb-dialog__body { padding: 18px 16px 8px; font-size: 15px; line-height: 1.55; color: var(--sb-body-muted); }
.sb-dialog__body > * { margin: 0 0 10px; }
.sb-dialog__actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 8px 16px 16px; }
