/* The demo follows the same editing and review rhythm as the demand board. */
.gr-demand-demo {
  --demand-flow-red: #a4272d;
  --demand-flow-ink: #342527;
  --demand-flow-muted: #6c5655;
  --demand-flow-line: #e9dbd5;
  --demand-flow-paper: #fffcf9;
  --demand-flow-ground: #f7f3ef;
  min-width: 0;
  min-height: 100dvh;
  background: var(--demand-flow-ground);
  color: var(--demand-flow-ink);
}

.gr-demand-demo-header {
  display: grid;
  grid-template-columns: max(68px, 3.75rem) minmax(0, 1fr) max(68px, 3.75rem);
  align-items: center;
  min-height: calc(52px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 10px 0;
  background: linear-gradient(115deg, #8d212b, #aa2f31 68%, #b94236);
  color: #fff8f1;
}

.gr-demand-demo-header h1 {
  margin: 0;
  color: inherit;
  font-size: 1.0625rem;
  font-weight: 740;
  line-height: 1.4;
  text-align: center;
}

.gr-demand-demo-back {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
}

.gr-demand-demo-back span {
  width: 10px;
  height: 10px;
  border-block-end: 2px solid currentColor;
  border-inline-start: 2px solid currentColor;
  transform: rotate(45deg);
}

.gr-demand-demo-badge {
  display: inline-flex;
  width: fit-content;
  padding: 3px 7px;
  border-radius: 6px;
  background: #f5e3e6;
  color: #833041;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.45;
  white-space: nowrap;
}

.gr-demand-demo-header > .gr-demand-demo-badge {
  justify-self: end;
  border: 1px solid rgb(255 237 225 / 48%);
  background: rgb(84 18 24 / 28%);
  color: #fff5ea;
}

.gr-demand-demo-badge[data-kind="DEMAND"] {
  background: #fbebd7;
  color: #824c24;
}

.gr-demand-demo-content {
  display: grid;
  gap: 10px;
  padding: 12px 13px calc(20px + env(safe-area-inset-bottom, 0px));
}

.gr-demand-demo-form {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.gr-demand-demo-context,
.gr-demand-demo-empty {
  margin: 0;
  color: var(--demand-flow-muted);
  font-size: 0.8125rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.gr-demand-demo-form > .gr-demand-demo-context,
.gr-demand-demo-content > .gr-demand-demo-context {
  padding: 0 3px;
}

.gr-demand-demo-card {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--demand-flow-line);
  border-radius: 13px;
  background: var(--demand-flow-paper);
  overflow-wrap: anywhere;
}

.gr-demand-demo-card h2 {
  margin: 0 0 8px;
  color: var(--demand-flow-ink);
  font-size: 1rem;
  font-weight: 740;
  line-height: 1.4;
}

.gr-demand-demo-field {
  display: grid;
  grid-template-columns: 5.1em minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--demand-flow-ink);
  font-size: 0.875rem;
  font-weight: 650;
}

.gr-demand-demo-fields > :not(:first-child) {
  margin-block-start: 8px;
}

.gr-demand-demo-field.is-long {
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
}

.gr-demand-demo-field :is(input, textarea, select) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--demand-flow-line);
  border-radius: 8px;
  background: #faf5f1;
  color: var(--demand-flow-ink);
  font-size: 1rem;
  font-weight: 450;
  line-height: 1.42;
}

.gr-demand-demo-field textarea {
  min-height: 106px;
  resize: vertical;
}

.gr-demand-demo-field :is(input, textarea)::placeholder {
  color: var(--demand-flow-muted);
  font-size: 0.875rem;
}

.gr-demand-demo-choices {
  min-width: 0;
  padding: 0 0 11px;
  border-bottom: 1px solid var(--demand-flow-line);
}

.gr-demand-demo-choices legend {
  margin-bottom: 7px;
  color: var(--demand-flow-ink);
  font-size: 0.875rem;
  font-weight: 700;
}

.gr-demand-demo-choices > div,
.gr-demand-demo-roles,
.gr-demand-demo-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 7px;
}

.gr-demand-demo-choices label,
.gr-demand-demo-roles button {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--demand-flow-line);
  border-radius: 8px;
  background: #faf5f1;
  color: var(--demand-flow-ink);
  font-size: 0.875rem;
  font-weight: 600;
}

.gr-demand-demo-choices input {
  accent-color: var(--demand-flow-red);
}

.gr-demand-demo-choices label:has(input:checked),
.gr-demand-demo-roles button[aria-pressed="true"] {
  border-color: #b64c50;
  background: #f8e6e5;
  color: #8b2733;
}

.gr-demand-demo-action {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 6px 9px;
  border: 1px solid var(--demand-flow-red);
  border-radius: 9px;
  background: var(--demand-flow-red);
  color: #fff8f2;
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1.42;
  text-align: center;
  text-decoration: none;
}

.gr-demand-demo-action.is-secondary {
  border-color: #dfc5c3;
  background: var(--demand-flow-paper);
  color: #823139;
}

.gr-demand-demo-action:active {
  filter: brightness(.93);
}

.gr-demand-demo-action:disabled {
  opacity: .72;
}

.gr-demand-demo :is(a, button, input, select, textarea):focus-visible {
  outline: 2px solid #9b2932;
  outline-offset: 2px;
}

.gr-demand-demo-header .gr-demand-demo-back:focus-visible {
  outline-color: #fff3e7;
  outline-offset: -3px;
}

.gr-demand-demo-confirm {
  border-color: #ddc5ba;
}

.gr-demand-demo-confirm h2 {
  color: #793238;
}

.gr-demand-demo-confirm p,
.gr-demand-demo-summary p {
  margin: 0;
  color: var(--demand-flow-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.gr-demand-demo-confirm .gr-demand-demo-actions {
  margin-block-start: 13px;
}

.gr-demand-demo-summary h2 {
  margin-block: 7px 9px;
  font-size: 1.3125rem;
}

.gr-demand-demo-summary dl {
  display: grid;
  gap: 4px;
  margin: 0 0 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--demand-flow-line);
}

.gr-demand-demo-summary dl > div {
  display: grid;
  grid-template-columns: 5em minmax(0, 1fr);
  gap: 6px;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.gr-demand-demo-summary dt {
  color: var(--demand-flow-muted);
}

.gr-demand-demo-summary dd {
  margin: 0;
  color: var(--demand-flow-ink);
  font-weight: 650;
}

.gr-demand-demo-prose {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.gr-demand-demo-roles {
  margin-bottom: 7px;
}

.gr-demand-demo-bridge form {
  display: grid;
  gap: 8px;
  margin-top: 11px;
}

.gr-demand-demo-receipt {
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid #ead9c5;
  border-radius: 8px;
  background: #faf0e4;
  color: #6c452b;
  font-size: 0.8125rem;
  line-height: 1.55;
}

.gr-demand-demo-receipt p {
  margin: 3px 0 0;
  white-space: pre-wrap;
}

.gr-demand-demo-error {
  margin: 0;
  padding: 8px 10px;
  border-radius: 7px;
  background: #f8e5e5;
  color: #8f2732;
  font-size: 0.8125rem;
}

.gr-demand-demo-history ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gr-demand-demo-history li {
  padding: 9px 0 0;
  border-top: 1px solid var(--demand-flow-line);
}

.gr-demand-demo-record-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 5px;
}

.gr-demand-demo-record-heading h3 {
  margin: 0;
  color: var(--demand-flow-ink);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.gr-demand-demo-history li p {
  margin: 5px 0;
  color: var(--demand-flow-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.gr-demand-demo-images {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  list-style: none;
}

.gr-demand-demo-images img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 4px;
  object-fit: cover;
}
