/* Shared look of the small demos (/demo/<name>/). Uses the site's tokens and
   fonts from assets/css/site.css: paper, ink, the visitor's accent (--cell). */
.dm-bar { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; align-items: center;
  padding: 10px var(--gutter); background: var(--ink); color: var(--paper); font-size: 0.95rem; }
.dm-bar a { color: var(--paper); font-weight: 700; }
.dm { max-width: 72rem; margin: 0 auto; padding: 2.5rem var(--gutter) 4rem; }
.dm-head { max-width: 46rem; margin-bottom: 2rem; }
.dm-head h1 { font-size: var(--t-xl); margin: 0 0 0.5rem; }
.dm-head p { margin: 0; color: var(--ink-2); font-size: 1.15rem; line-height: 1.5; }

.dm-steps { display: grid; gap: 1.25rem; counter-reset: step; }
.dm-step { background: #fffdf9; border: 1px solid var(--grid); padding: 1.25rem 1.25rem 1.5rem; min-width: 0; }
.dm-step[aria-disabled="true"] { opacity: 0.45; }
.dm-step > h2 { display: flex; gap: 0.75rem; align-items: center; font-size: var(--t-md); margin: 0 0 0.35rem; }
.dm-step > h2::before { counter-increment: step; content: counter(step); display: inline-grid; place-items: center;
  width: 1.9rem; height: 1.9rem; flex: none; border: 2px solid var(--cell); color: var(--cell); font: 700 1rem var(--f-body); }
.dm-step > p { margin: 0 0 1rem; color: var(--ink-2); }
.dm-row { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; }
.dm-note { color: var(--ink-2); font-size: 0.95rem; }
.dm-code { font: 500 0.85rem/1.5 ui-monospace, "SFMono-Regular", Menlo, monospace; background: var(--paper-2);
  padding: 0.5rem 0.75rem; overflow-x: auto; white-space: pre; margin: 0 0 1rem; }

.dm button.btn { cursor: pointer; font: inherit; }
.dm .btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.dm-table-wrap { overflow-x: auto; margin: 0 0 1rem; }
.dm-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.dm-table th, .dm-table td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--grid); vertical-align: top; }
.dm-table th { font-weight: 700; color: var(--ink-2); font-size: 0.85rem; }
.dm-table .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dm-table tfoot td { border-bottom: 0; font-weight: 700; }
.dm-table input, .dm-table select, .dm textarea { font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--ink-2); padding: 0.3rem 0.4rem; max-width: 100%; }
.dm-table input[type="number"] { width: 5.5rem; text-align: right; }
.dm-table .dm-unit { display: block; font-size: 0.85rem; color: var(--ink-2); }
.dm-table tr.is-new td { animation: dm-in 0.5s ease both; }
@keyframes dm-in { from { background: color-mix(in srgb, var(--cell) 14%, transparent); } }
@media (prefers-reduced-motion: reduce) { .dm-table tr.is-new td { animation: none; } }

.dm-flag { display: inline-block; padding: 0.05rem 0.45rem; font-size: 0.8rem; font-weight: 700; border: 1px solid currentColor; white-space: nowrap; }
.dm-flag--ok { color: #1f7a4d; }
.dm-flag--warn { color: #9a5b00; }
.dm-flag--bad { color: #b3261e; }

.dm-paper { background: #fff; border: 1px solid var(--grid); padding: 1.5rem; box-shadow: 0 1px 0 var(--grid), 0 12px 30px -18px rgba(30, 26, 22, 0.35); }
.dm-paper h3 { margin: 0 0 0.25rem; font-size: var(--t-md); }
.dm-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.25rem 2rem; margin: 0 0 1.25rem; color: var(--ink-2); font-size: 0.95rem; }

.dm-cta { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 2px solid var(--ink); }
.dm-cta h2 { font-size: var(--t-lg); margin: 0 0 0.5rem; }
.dm-cta p { margin: 0 0 1rem; color: var(--ink-2); }

@media (min-width: 900px) {
  .dm-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
}
@media print {
  .dm-bar, .dm-head, .dm-step:not(.dm-step--print), .dm-step--print > h2, .dm-step--print > p, .dm-step--print .dm-row, .dm-cta { display: none !important; }
  .dm, .dm-step { padding: 0; border: 0; background: #fff; }
  .dm-paper { box-shadow: none; border: 0; }
}

/* Order demo: mail picker, mail fields, the confirmation text */
.dm-tabs { margin-bottom: 1rem; }
.dm-tab { font: inherit; font-weight: 700; padding: 0.4rem 0.8rem; background: transparent; color: var(--ink); border: 1px solid var(--ink-2); cursor: pointer; }
.dm-tab[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.dm-mail { display: grid; gap: 0.75rem; margin-bottom: 1rem; max-width: 46rem; }
.dm-field { display: grid; gap: 0.3rem; font-weight: 700; font-size: 0.95rem; }
.dm-field input, .dm-field select { font: inherit; font-weight: 400; color: var(--ink); background: var(--paper); border: 1px solid var(--ink-2); padding: 0.4rem 0.5rem; }
.dm textarea { width: 100%; font-weight: 400; line-height: 1.5; resize: vertical; }
.dm q { quotes: "“" "”"; color: var(--ink-2); }
.dm-link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; text-decoration: underline; }
.dm-mailout { white-space: pre-wrap; font-family: var(--f-body); font-size: 0.95rem; }
.dm-tab:focus-visible, .dm-link:focus-visible, .dm textarea:focus-visible, .dm input:focus-visible, .dm select:focus-visible { outline: 3px solid var(--mark); outline-offset: 2px; }

/* Schedule demo: the week grid and the stand-in lists */
.dm-roster th, .dm-roster td { padding: 0.3rem 0.5rem; }
.dm-roster .dm-s { text-align: center; font-size: 0.85rem; white-space: nowrap; min-width: 4.5rem; }
.dm-roster td.dm-s--lunch { background: color-mix(in srgb, var(--cell) 14%, transparent); }
.dm-roster td.dm-s--dinner { background: var(--cell); color: var(--cell-ink); font-weight: 700; }
.dm-roster td.dm-s--off { color: var(--ink-2); }
.dm-roster td.dm-s--sick { color: #b3261e; font-weight: 700; text-decoration: line-through; }
.dm-roster tr.dm-group th { background: var(--paper-2); font-size: 0.85rem; color: var(--ink); padding-top: 0.5rem; }
.dm-roster td.dm-s.is-new { animation: dm-in 1.2s ease both; outline: 3px solid var(--mark); outline-offset: -3px; }
.dm-gaps { display: grid; gap: 1rem; margin-bottom: 1rem; }
.dm-gap p { margin: 0 0 0.4rem; }
.dm-cands { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.dm-cands li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; }
.dm-needs { min-width: 44rem; }
.dm-roster th[scope="row"] { position: sticky; left: 0; z-index: 1; background: #fffdf9; }
