:root {
  --ink: #1b2420;
  --muted: #5d6b65;
  --line: #d9e2dd;
  --bg: #f6f8f7;
  --card: #fff;
  --green: #2f7d5b;
  --green-dark: #24634a;
  --green-soft: #dff3ea;
  --red: #b3261e;
  --focus: #1f6feb;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
header.site { background: var(--card); border-bottom: 1px solid var(--line); padding: 12px 16px; text-align: center; }
header.site .logo { height: 26px; width: auto; }
main { max-width: 860px; margin: 0 auto; padding: 18px 16px 64px; }
h1 { font-size: 26px; margin: 4px 0 2px; }
h2 { font-size: 20px; margin: 0; }
h3 { font-size: 16px; margin: 0; }
.intro p { margin: 0 0 16px; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.message h1, .message h2 { margin-bottom: 8px; }
.head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button { border-radius: 999px; padding: 6px 14px; }
.tabs button.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.kind { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.kind button { border: 0; border-radius: 0; padding: 6px 16px; }
.kind button.on { background: var(--green); color: #fff; }

.preview { margin: 0 0 16px; }
.preview svg { width: 100%; height: auto; display: block; border-radius: 6px; box-shadow: 0 1px 4px #0002; }
.preview:empty { aspect-ratio: 1125 / 400; background: #e8f3ee; border-radius: 6px; }

fieldset { border: 0; padding: 0; margin: 0 0 8px; }
legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 3px; }
input[type="text"], input:not([type]), input[type="date"], input[type="time"] {
  font: inherit;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #b9c6c0;
  border-radius: 8px;
  background: #fff;
  text-transform: uppercase; /* tickets print in capitals */
}
input[aria-invalid="true"] { border-color: var(--red); }
.note { font-size: 13px; color: var(--muted); margin: 3px 0 0; min-height: 0; }
.note.error, .errors { color: var(--red); }
.errors { margin: 4px 0 0; padding-left: 20px; font-size: 14px; }

button {
  font: inherit;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
button.primary { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--green-dark); }
button:disabled { opacity: .55; cursor: not-allowed; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 8px; }

.review-ticket { padding: 12px 0; border-top: 1px solid var(--line); }
.review-ticket:first-of-type { border-top: 0; }
.confirm { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 4px; font-weight: 600; }
.confirm input { margin-top: 5px; width: 18px; height: 18px; flex: none; }

.status { font-size: 14px; color: var(--muted); margin: 10px 0 0; min-height: 1.5em; }
.status.bad { color: var(--red); }

@media (max-width: 520px) {
  h1 { font-size: 22px; }
  .actions button { flex: 1 1 100%; }
  /* Keep the ticket in view while typing in the fields below it. */
  .card > .preview { position: sticky; top: 0; z-index: 1; background: var(--card); padding: 8px 0; margin: 0 0 8px; }
}
