/* Ticket Maker tool styles. Every selector is scoped under #tg-ticket-maker, except .tm-hero
 * (the static hero section that holds the H1, subline and the embed root). Tokens come from the
 * website's semantic.css; every var() has a literal fallback so the tool also works without it. */

/* ---------- hero (static page markup around the embed) ----------
 * --tm-nav-clearance: height of a fixed site nav above the hero (default 76 = the design-system
 * nav's 12px inset + 64px pill). --tm-sticky-top: where the mobile sticky stage pins; it defaults
 * to the same 76 because navHide brings the nav back on any scroll-up, so 0 would be overlapped.
 * Set either on :root (or .tm-hero) to match the live site's nav; set 0 where the nav is not fixed. */
.tm-hero {
  position: relative;
  isolation: isolate;
  padding: calc(var(--tm-nav-clearance, 76px) + 64px) 0 32px;
  background: var(--bg-primary, #FFFFFF);
  font-family: var(--font-body, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
}
.tm-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--border-secondary, #E9EAEB) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-secondary, #E9EAEB) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: center top;
  -webkit-mask-image: linear-gradient(#000, transparent 85%);
  mask-image: linear-gradient(#000, transparent 85%);
}
.tm-hero-head { max-width: 1280px; margin: 0 auto; padding: 0 32px; text-align: center; }
.tm-hero-title {
  margin: 0;
  font-family: var(--font-display, 'Inter', sans-serif);
  font-size: 48px;
  line-height: 60px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary, #181D27);
}
.tm-hero-sub {
  max-width: 720px;
  margin: 16px auto 32px;
  font-size: 18px;
  line-height: 28px;
  font-weight: 400;
  color: var(--text-tertiary, #535862);
}
@media (max-width: 1023px) {
  .tm-hero { padding: calc(var(--tm-nav-clearance, 76px) + 40px) 0 24px; }
  .tm-hero-head { padding: 0 16px; }
  .tm-hero-title { font-size: 30px; line-height: 38px; }
}

/* ---------- root (the Sign Up sheet is a portal on <body>, so it shares the tokens and base rules) ---------- */
#tg-ticket-maker, .tm-sheet {
  --tm-t1: var(--text-primary, #181D27);
  --tm-t2: var(--text-secondary, #414651);
  --tm-t3: var(--text-tertiary, #535862);
  --tm-t4: var(--text-quaternary, #717680);
  --tm-ph: var(--text-placeholder, #A4A7AE);
  --tm-brand: var(--text-brand, #1570EF);
  --tm-brand-strong: var(--text-brand-strong, #175CD3);
  --tm-bg1: var(--bg-primary, #FFFFFF);
  --tm-bg2: var(--bg-secondary, #FAFAFA);
  --tm-bg3: var(--bg-tertiary, #F5F5F5);
  --tm-bgb: var(--bg-brand, #EFF8FF);
  --tm-solid: var(--bg-brand-solid, #1570EF);
  --tm-solid-hover: var(--bg-brand-solid-hover, #175CD3);
  --tm-ring: var(--bg-brand-ring, #D1E9FF);
  --tm-b1: var(--border-primary, #D5D7DA);
  --tm-b2: var(--border-secondary, #E9EAEB);
  --tm-bb: var(--border-brand, #1570EF);
  --tm-err: var(--text-error-primary, #D92D20);
  --tm-sh-xs: var(--shadow-xs, 0 1px 2px 0 rgb(10 13 18 / 0.05));
  --tm-sh-lg: var(--shadow-lg, 0 12px 16px -4px rgb(10 13 18 / 0.08), 0 4px 6px -2px rgb(10 13 18 / 0.03));
  --tm-grid: linear-gradient(var(--tm-b2) 1px, transparent 1px), linear-gradient(90deg, var(--tm-b2) 1px, transparent 1px);
  --tm-success: var(--success-600, #079455);
  font-family: var(--font-body, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  font-size: 16px;
  line-height: 24px;
  color: var(--tm-t1);
  text-align: left;
}
#tg-ticket-maker { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
#tg-ticket-maker *, #tg-ticket-maker *::before, #tg-ticket-maker *::after { box-sizing: border-box; }
.tm-sheet, .tm-sheet *, .tm-sheet *::before, .tm-sheet *::after { box-sizing: border-box; }
:is(#tg-ticket-maker, .tm-sheet) [hidden] { display: none !important; }
:is(#tg-ticket-maker, .tm-sheet) :is(button, input) { margin: 0; font-family: inherit; }
:is(#tg-ticket-maker, .tm-sheet) button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:is(#tg-ticket-maker, .tm-sheet) :focus-visible { outline: 2px solid var(--tm-bb); outline-offset: 2px; }
:is(#tg-ticket-maker, .tm-sheet) .tm-ic { display: block; flex: none; }
:is(#tg-ticket-maker, .tm-sheet) .tm-ic * { vector-effect: non-scaling-stroke; }
:is(#tg-ticket-maker, .tm-sheet) .tm-vh {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- segmented controls (template switch, text colour) ---------- */
:is(#tg-ticket-maker, .tm-sheet) .tm-seg-group {
  display: inline-flex;
  gap: 4px;
  height: 40px;
  padding: 4px;
  border-radius: 10px;
  background: var(--tm-bg3);
}
:is(#tg-ticket-maker, .tm-sheet) .tm-seg {
  flex: 1 1 0;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--tm-t3);
  white-space: nowrap;
}
:is(#tg-ticket-maker, .tm-sheet) .tm-seg:hover { color: var(--tm-t1); }
:is(#tg-ticket-maker, .tm-sheet) .tm-seg[aria-checked="true"] { background: var(--tm-bg1); color: var(--tm-t1); box-shadow: var(--tm-sh-xs); }
:is(#tg-ticket-maker, .tm-sheet) .tm-seg-full { display: flex; width: 100%; height: 36px; }

/* ---------- card ---------- */
:is(#tg-ticket-maker, .tm-sheet) .tm-card {
  background: var(--tm-bg1);
  border: 1px solid var(--tm-b2);
  border-radius: 16px;
  box-shadow: var(--tm-sh-lg);
  overflow: hidden;
  overflow: clip; /* clip, not hidden: keeps the mobile sticky stage and action bar working */
}
:is(#tg-ticket-maker, .tm-sheet) .tm-stage-col { min-width: 0; }

/* ---------- editor ---------- */
:is(#tg-ticket-maker, .tm-sheet) .tm-editor { padding: 24px; margin: 0; }
:is(#tg-ticket-maker, .tm-sheet) .tm-group { margin: 0; padding: 0; border: 0; min-width: 0; }
:is(#tg-ticket-maker, .tm-sheet) .tm-group + .tm-group { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--tm-b2); }
:is(#tg-ticket-maker, .tm-sheet) .tm-legend {
  float: left; /* lets the legend take a normal margin */
  width: 100%;
  padding: 0;
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--tm-t1);
}
:is(#tg-ticket-maker, .tm-sheet) .tm-group > :not(.tm-legend) { clear: both; }
:is(#tg-ticket-maker, .tm-sheet) .tm-stack { display: flex; flex-direction: column; gap: 16px; }
:is(#tg-ticket-maker, .tm-sheet) .tm-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
:is(#tg-ticket-maker, .tm-sheet) .tm-field { min-width: 0; }
:is(#tg-ticket-maker, .tm-sheet) .tm-label {
  display: block;
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--tm-t2);
}
:is(#tg-ticket-maker, .tm-sheet) .tm-input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--tm-b1);
  border-radius: 8px;
  background: var(--tm-bg1);
  font-size: 16px; /* 16px stops iOS zooming on focus */
  line-height: 24px;
  color: var(--tm-t1);
  -webkit-appearance: none;
  appearance: none;
  text-align: left;
}
/* date/time: Chrome's native segments plus the picker icon need ~8px more than the 14px padding leaves at 2 columns */
:is(#tg-ticket-maker, .tm-sheet) .tm-input[type="date"], :is(#tg-ticket-maker, .tm-sheet) .tm-input[type="time"] { padding: 0 8px 0 12px; }
:is(#tg-ticket-maker, .tm-sheet) .tm-input::-webkit-calendar-picker-indicator { margin: 0; padding: 0; }
:is(#tg-ticket-maker, .tm-sheet) .tm-input::placeholder { color: var(--tm-ph); opacity: 1; }
:is(#tg-ticket-maker, .tm-sheet) .tm-input::-webkit-date-and-time-value { text-align: left; }
:is(#tg-ticket-maker, .tm-sheet) .tm-input:focus { outline: none; border-color: var(--tm-bb); box-shadow: 0 0 0 4px var(--tm-ring); }
:is(#tg-ticket-maker, .tm-sheet) .tm-counter { margin: 6px 0 0; font-size: 12px; line-height: 18px; color: var(--tm-t4); text-align: right; }
:is(#tg-ticket-maker, .tm-sheet) .tm-counter:empty { margin: 0; }

/* swatches */
:is(#tg-ticket-maker, .tm-sheet) .tm-swatches { display: flex; flex-wrap: nowrap; gap: 10px; } /* one row (SPEC §12.7) */
:is(#tg-ticket-maker, .tm-sheet) .tm-swatch-wrap { position: relative; display: block; }
:is(#tg-ticket-maker, .tm-sheet) .tm-swatch {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--tm-sw, #FFFFFF);
  color: var(--tm-sw-fg, #181D27);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
:is(#tg-ticket-maker, .tm-sheet) .tm-swatch .tm-ic { visibility: hidden; }
:is(#tg-ticket-maker, .tm-sheet) .tm-swatch[aria-checked="true"] {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), 0 0 0 2px var(--tm-bg1), 0 0 0 4px var(--tm-bb);
}
:is(#tg-ticket-maker, .tm-sheet) .tm-swatch[aria-checked="true"] .tm-ic { visibility: visible; }
:is(#tg-ticket-maker, .tm-sheet) .tm-swatch:focus-visible { outline-offset: 6px; }
:is(#tg-ticket-maker, .tm-sheet) .tm-swatch-custom {
  position: relative;
  background: conic-gradient(#FF4D4D, #FFC34D, #7CE04D, #4DD8E0, #4D6BFF, #C44DFF, #FF4D4D);
}
/* once a colour is picked: 3px rainbow ring, a 1px white gap, then the colour as a disc inset 4px */
:is(#tg-ticket-maker, .tm-sheet) .tm-swatch-custom.tm-has-color::before,
:is(#tg-ticket-maker, .tm-sheet) .tm-swatch-custom.tm-has-color::after { content: ''; position: absolute; border-radius: 50%; }
:is(#tg-ticket-maker, .tm-sheet) .tm-swatch-custom.tm-has-color::before { inset: 3px; background: var(--tm-bg1); }
:is(#tg-ticket-maker, .tm-sheet) .tm-swatch-custom.tm-has-color::after { inset: 4px; background: var(--tm-sw); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
:is(#tg-ticket-maker, .tm-sheet) .tm-swatch-custom .tm-ic { position: relative; z-index: 1; }
@media (max-width: 359px) { /* 7 swatches still fit one row in a 238px editor */
  :is(#tg-ticket-maker, .tm-sheet) .tm-swatches { gap: 6px; }
  :is(#tg-ticket-maker, .tm-sheet) .tm-swatch { width: 28px; height: 28px; }
}
:is(#tg-ticket-maker, .tm-sheet) .tm-swatch-wrap .tm-vh { left: 50%; top: 100%; }

/* theme chips */
:is(#tg-ticket-maker, .tm-sheet) .tm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
:is(#tg-ticket-maker, .tm-sheet) .tm-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--tm-b1);
  border-radius: 9999px;
  background: var(--tm-bg1);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--tm-t2);
  white-space: nowrap;
}
:is(#tg-ticket-maker, .tm-sheet) .tm-chip:hover { background: var(--tm-bg2); }
:is(#tg-ticket-maker, .tm-sheet) .tm-chip[aria-checked="true"] { background: var(--tm-bgb); border-color: var(--tm-bb); color: var(--tm-brand-strong); }

/* logo */
:is(#tg-ticket-maker, .tm-sheet) .tm-drop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  border: 1.5px dashed var(--tm-b1);
  border-radius: 10px;
  font-size: 14px;
  line-height: 20px;
  color: var(--tm-t3);
  text-align: center;
}
:is(#tg-ticket-maker, .tm-sheet) .tm-drop .tm-logo-restore { flex-basis: 100%; } /* own line under the drop prompt */
:is(#tg-ticket-maker, .tm-sheet) .tm-drop.tm-over { border-color: var(--tm-bb); background: var(--tm-bgb); }
:is(#tg-ticket-maker, .tm-sheet) .tm-btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--tm-b1);
  border-radius: 8px;
  background: var(--tm-bg1);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--tm-t2);
  box-shadow: var(--tm-sh-xs);
}
:is(#tg-ticket-maker, .tm-sheet) .tm-btn-sm:hover { background: var(--tm-bg2); color: var(--tm-t1); }
:is(#tg-ticket-maker, .tm-sheet) .tm-hint { margin: 6px 0 0; font-size: 12px; line-height: 18px; color: var(--tm-t4); }
:is(#tg-ticket-maker, .tm-sheet) .tm-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--tm-b2);
  border-radius: 10px;
}
:is(#tg-ticket-maker, .tm-sheet) .tm-logo-thumb {
  width: 40px;
  height: 40px;
  flex: none;
  object-fit: contain;
  border-radius: 6px;
  background: var(--tm-bg2);
}
/* the white default logo needs a dark chip to be seen */
:is(#tg-ticket-maker, .tm-sheet) .tm-logo-thumb.tm-thumb-dark { padding: 4px; background: var(--tm-t1); }
:is(#tg-ticket-maker, .tm-sheet) .tm-logo-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--tm-t2);
}
:is(#tg-ticket-maker, .tm-sheet) .tm-text-btn {
  padding: 4px 0;
  border: 0;
  background: none;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--tm-brand);
}
:is(#tg-ticket-maker, .tm-sheet) .tm-text-btn:hover { color: var(--tm-brand-strong); }
:is(#tg-ticket-maker, .tm-sheet) .tm-error { margin: 6px 0 0; font-size: 14px; line-height: 20px; color: var(--tm-err); }
:is(#tg-ticket-maker, .tm-sheet) .tm-error:empty { margin: 0; }

/* own design row */
:is(#tg-ticket-maker, .tm-sheet) .tm-own {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--tm-b1);
  border-radius: 10px;
  background: var(--tm-bg1);
  text-align: left;
  color: var(--tm-t1);
}
:is(#tg-ticket-maker, .tm-sheet) .tm-own:hover { background: var(--tm-bg2); }
:is(#tg-ticket-maker, .tm-sheet) .tm-own-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
:is(#tg-ticket-maker, .tm-sheet) .tm-own-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}
:is(#tg-ticket-maker, .tm-sheet) .tm-own-hint {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; /* one line; ellipsis on the narrowest screens rather than wrapping */
  font-size: 12px;
  line-height: 18px;
  color: var(--tm-t3);
}
:is(#tg-ticket-maker, .tm-sheet) .tm-own-chev { color: var(--tm-t4); }
:is(#tg-ticket-maker, .tm-sheet) .tm-badge {
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--tm-bgb);
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  color: var(--tm-brand-strong);
  white-space: nowrap;
}

/* ---------- stage ---------- */
:is(#tg-ticket-maker, .tm-sheet) .tm-fit {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  aspect-ratio: 960 / 384; /* reserves the scaled height before and after JS: no layout jump */
}
#tg-ticket-maker.tm-t-raffle .tm-fit { aspect-ratio: 960 / 480; }
:is(#tg-ticket-maker, .tm-sheet) .tm-ticket {
  position: absolute;
  top: 0;
  left: 0;
  width: 960px;
  height: 384px;
  transform-origin: 0 0;
}
:is(#tg-ticket-maker, .tm-sheet) .tm-hit { display: none; }

/* ---------- artboard (SPEC §6), fixed 960x384; raffle 960x480 (SPEC §12.6) ---------- */
:is(#tg-ticket-maker.tm-t-raffle, .tm-sheet.tm-t-raffle) .tm-ticket,
:is(#tg-ticket-maker.tm-t-raffle, .tm-sheet.tm-t-raffle) .tm-export-host { height: 480px; }
:is(#tg-ticket-maker, .tm-sheet) .tm-art {
  position: absolute;
  inset: 0;
  display: flex;
  border-radius: 24px;
  overflow: hidden;
  background: var(--tm-a-bg);
  color: var(--tm-a-fg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 24px;
  text-align: left;
  /* two 24px notches at the top and bottom of the perforation */
  -webkit-mask:
    radial-gradient(circle at 720px 0, transparent 12px, #000 12.5px) top / 100% 51% no-repeat,
    radial-gradient(circle at 720px 100%, transparent 12px, #000 12.5px) bottom / 100% 51% no-repeat;
  mask:
    radial-gradient(circle at 720px 0, transparent 12px, #000 12.5px) top / 100% 51% no-repeat,
    radial-gradient(circle at 720px 100%, transparent 12px, #000 12.5px) bottom / 100% 51% no-repeat;
}
:is(#tg-ticket-maker, .tm-sheet) .tm-art p { margin: 0; }
:is(#tg-ticket-maker, .tm-sheet) .tm-main { position: relative; flex: none; width: 720px; height: 100%; padding: 40px; }
:is(#tg-ticket-maker, .tm-sheet) .tm-pattern { position: absolute; top: 0; left: 0; width: 720px; height: 100%; opacity: 0.14; }
:is(#tg-ticket-maker, .tm-sheet) .tm-main-in { position: relative; display: flex; flex-direction: column; height: 100%; min-width: 0; }
:is(#tg-ticket-maker, .tm-sheet) .tm-logo {
  display: block;
  flex: none;
  width: 120px;
  height: 48px;
  margin-bottom: 16px;
  object-fit: contain;
  object-position: left center;
}
:is(#tg-ticket-maker, .tm-sheet) .tm-kicker {
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.7;
}
:is(#tg-ticket-maker, .tm-sheet) .tm-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 48px;
  line-height: 52px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
:is(#tg-ticket-maker, .tm-sheet) .tm-name.tm-s1 { font-size: 40px; line-height: 44px; }
:is(#tg-ticket-maker, .tm-sheet) .tm-name.tm-s2 { font-size: 34px; line-height: 38px; }
:is(#tg-ticket-maker, .tm-sheet) .tm-spacer { flex: 1; min-height: 12px; }
:is(#tg-ticket-maker, .tm-sheet) .tm-meta { display: flex; gap: 32px; min-width: 0; margin-bottom: 16px; }
:is(#tg-ticket-maker, .tm-sheet) .tm-meta:empty { display: none; }
:is(#tg-ticket-maker, .tm-sheet) .tm-meta-col { display: flex; flex-direction: column; flex: 0 1 auto; min-width: 0; }
:is(#tg-ticket-maker, .tm-sheet) .tm-meta-label { font-size: 12px; line-height: 18px; font-weight: 500; opacity: 0.6; }
:is(#tg-ticket-maker, .tm-sheet) .tm-meta-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
  line-height: 26px;
  font-weight: 600;
}
/* SPEC §12.5: Ticket Generator mark bottom-left, text colour at 75%, on screen and in every export */
:is(#tg-ticket-maker, .tm-sheet) .tm-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  opacity: 0.75;
}
:is(#tg-ticket-maker, .tm-sheet) .tm-brand-mark { display: block; flex: none; }

/* ---------- raffle (SPEC §12.6): counterfoil left, round-hole perforation, prize headline ---------- */
:is(#tg-ticket-maker, .tm-sheet) .tm-art-raffle {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='960' height='480' viewBox='0 0 960 480'%3E%3Cpath fill-rule='evenodd' d='M0 0H960V480H0ZM228 0a12 12 0 1 0 24 0a12 12 0 1 0 -24 0ZM228 480a12 12 0 1 0 24 0a12 12 0 1 0 -24 0ZM237 21a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 35a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 49a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 63a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 77a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 91a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 105a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 119a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 133a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 147a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 161a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 175a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 189a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 203a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 217a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 231a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 245a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 259a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 273a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 287a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 301a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 315a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 329a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 343a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 357a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 371a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 385a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 399a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 413a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 427a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 441a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 455a3 3 0 1 0 6 0a3 3 0 1 0 -6 0Z'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='960' height='480' viewBox='0 0 960 480'%3E%3Cpath fill-rule='evenodd' d='M0 0H960V480H0ZM228 0a12 12 0 1 0 24 0a12 12 0 1 0 -24 0ZM228 480a12 12 0 1 0 24 0a12 12 0 1 0 -24 0ZM237 21a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 35a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 49a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 63a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 77a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 91a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 105a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 119a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 133a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 147a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 161a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 175a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 189a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 203a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 217a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 231a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 245a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 259a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 273a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 287a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 301a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 315a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 329a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 343a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 357a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 371a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 385a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 399a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 413a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 427a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 441a3 3 0 1 0 6 0a3 3 0 1 0 -6 0ZM237 455a3 3 0 1 0 6 0a3 3 0 1 0 -6 0Z'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
}
:is(#tg-ticket-maker, .tm-sheet) .tm-art-raffle .tm-name { font-size: 44px; line-height: 48px; }
:is(#tg-ticket-maker, .tm-sheet) .tm-art-raffle .tm-name.tm-ghost { opacity: 0.45; }
/* the bottom-right corner belongs to the QR tile (screen) or the big No. field (export) */
:is(#tg-ticket-maker, .tm-sheet) .tm-art-raffle .tm-meta,
:is(#tg-ticket-maker, .tm-sheet) .tm-art-raffle .tm-brand { margin-right: 216px; }
:is(#tg-ticket-maker, .tm-sheet) .tm-stub.tm-cf { padding: 40px 24px 40px 56px; align-items: stretch; }
:is(#tg-ticket-maker, .tm-sheet) .tm-cf-lines { display: flex; flex-direction: column; gap: 28px; width: 100%; }
:is(#tg-ticket-maker, .tm-sheet) .tm-art-raffle .tm-stub-name { right: auto; left: 16px; transform: rotate(180deg); }
:is(#tg-ticket-maker, .tm-sheet) .tm-xno { position: absolute; right: 40px; bottom: 40px; width: 200px; }
:is(#tg-ticket-maker, .tm-sheet) .tm-xno .tm-x-line { font-size: 20px; line-height: 28px; gap: 10px; }
:is(#tg-ticket-maker, .tm-sheet) .tm-xno .tm-x-rule { height: 22px; border-bottom-width: 2px; }
:is(#tg-ticket-maker, .tm-sheet) .tm-face.tm-face-corner {
  left: auto;
  top: auto;
  right: 40px;
  bottom: 40px;
  width: 96px;
  height: 96px;
  padding: 0;
  border-radius: 8px;
}
:is(#tg-ticket-maker, .tm-sheet) .tm-face-corner .tm-tile { width: 96px; height: 96px; }

:is(#tg-ticket-maker, .tm-sheet) .tm-stub {
  position: relative;
  flex: none;
  width: 240px;
  height: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--tm-a-stub);
}
:is(#tg-ticket-maker, .tm-sheet) .tm-stub-name {
  position: absolute;
  top: 24px;
  bottom: 24px;
  right: 12px;
  width: 20px;
  writing-mode: vertical-rl;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  opacity: 0.7;
}
:is(#tg-ticket-maker, .tm-sheet) .tm-perf { position: absolute; top: 0; left: 719px; width: 2px; height: 384px; }
:is(#tg-ticket-maker, .tm-sheet) .tm-perf svg { display: block; }

/* stub face on screen: sample QR Code tile (a button on the stage, decorative in the viewer) */
:is(#tg-ticket-maker, .tm-sheet) .tm-face {
  position: absolute;
  top: 0;
  left: 720px;
  width: 240px;
  height: 384px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0 24px 24px 0;
  background: transparent;
  color: var(--tm-a-fg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
:is(#tg-ticket-maker, .tm-sheet) .tm-tile {
  position: relative;
  display: block;
  width: 128px;
  height: 128px;
  padding: 8px;
  border-radius: 8px;
  background: #FFFFFF;
  overflow: hidden;
}
:is(#tg-ticket-maker, .tm-sheet) .tm-tile svg { display: block; }
:is(#tg-ticket-maker, .tm-sheet) .tm-tid {
  display: block;
  margin-top: 12px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

/* event stub, on screen and in exports (WYSIWYG): fill-in fields */
:is(#tg-ticket-maker, .tm-sheet) .tm-x { width: 160px; }
:is(#tg-ticket-maker, .tm-sheet) .tm-x-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 12px 12px;
  border: 1.5px solid currentColor;
  border-radius: 8px;
}
:is(#tg-ticket-maker, .tm-sheet) .tm-x-line { display: flex; align-items: flex-end; gap: 6px; font-size: 14px; line-height: 20px; font-weight: 600; }
:is(#tg-ticket-maker, .tm-sheet) .tm-x-rule { flex: 1; height: 15px; border-bottom: 1.5px solid currentColor; opacity: 0.7; }
:is(#tg-ticket-maker, .tm-sheet) .tm-x-admit {
  margin-top: 12px;
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}
:is(#tg-ticket-maker, .tm-sheet) .tm-export-host {
  position: fixed;
  top: 0;
  left: -10000px;
  width: 960px;
  height: 384px;
  pointer-events: none;
}

/* ---------- actions ---------- */
:is(#tg-ticket-maker, .tm-sheet) .tm-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  margin-top: 24px;
}
:is(#tg-ticket-maker, .tm-sheet) .tm-dl { position: relative; display: inline-flex; }
:is(#tg-ticket-maker, .tm-sheet) .tm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--tm-solid);
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  color: #FFFFFF;
  box-shadow: var(--tm-sh-xs);
  white-space: nowrap;
}
:is(#tg-ticket-maker, .tm-sheet) .tm-btn:hover { background: var(--tm-solid-hover); }
:is(#tg-ticket-maker, .tm-sheet) .tm-btn[aria-disabled="true"] { cursor: default; }
:is(#tg-ticket-maker, .tm-sheet) .tm-btn[aria-disabled="true"]:hover { background: var(--tm-solid); }
:is(#tg-ticket-maker, .tm-sheet) .tm-menu-item[aria-disabled="true"] { opacity: 0.5; cursor: default; }
:is(#tg-ticket-maker, .tm-sheet) .tm-dl .tm-dl-main { border-radius: 8px 0 0 8px; }
:is(#tg-ticket-maker, .tm-sheet) .tm-dl-more {
  width: 44px;
  padding: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 0 8px 8px 0;
}
:is(#tg-ticket-maker, .tm-sheet) .tm-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 5;
  min-width: 220px;
  padding: 4px;
  border: 1px solid var(--tm-b2);
  border-radius: 8px;
  background: var(--tm-bg1);
  box-shadow: var(--tm-sh-lg);
}
:is(#tg-ticket-maker, .tm-sheet) .tm-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--tm-t2);
  text-align: left;
  white-space: nowrap;
}
:is(#tg-ticket-maker, .tm-sheet) .tm-menu-item:hover, :is(#tg-ticket-maker, .tm-sheet) .tm-menu-item:focus { background: var(--tm-bg2); color: var(--tm-t1); outline: none; }
:is(#tg-ticket-maker, .tm-sheet) .tm-menu-item .tm-ic { color: var(--tm-brand); visibility: hidden; }
:is(#tg-ticket-maker, .tm-sheet) .tm-menu-item[aria-checked="true"] .tm-ic { visibility: visible; }
:is(#tg-ticket-maker, .tm-sheet) .tm-cross {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--tm-brand);
  text-decoration: none;
}
:is(#tg-ticket-maker, .tm-sheet) .tm-cross:hover { color: var(--tm-brand-strong); text-decoration: underline; }
:is(#tg-ticket-maker, .tm-sheet) .tm-dl-error { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; flex-basis: 100%; }
:is(#tg-ticket-maker, .tm-sheet) .tm-dl-error .tm-error { margin: 0; }
:is(#tg-ticket-maker, .tm-sheet) .tm-more { display: flex; flex-wrap: wrap; gap: 8px 28px; } /* same row as Download, wraps when narrow */
:is(#tg-ticket-maker, .tm-sheet) .tm-cross-row { display: flex; justify-content: flex-end; margin-top: 16px; }
:is(#tg-ticket-maker, .tm-sheet) .tm-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border: 0;
  background: none;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--tm-brand);
}
:is(#tg-ticket-maker, .tm-sheet) .tm-link:hover { color: var(--tm-brand-strong); }
:is(#tg-ticket-maker, .tm-sheet) .tm-spin { animation: tm-spin 0.8s linear infinite; }
@keyframes tm-spin { to { transform: rotate(360deg); } }

/* ---------- mobile viewer ---------- */
:is(#tg-ticket-maker, .tm-sheet) .tm-viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 16px;
  border: 0;
  background-color: var(--tm-bg2);
  background-image: var(--tm-grid);
  background-size: 24px 24px;
  color: var(--tm-t1);
}
:is(#tg-ticket-maker, .tm-sheet) .tm-viewer[open] { display: flex; flex-direction: column; gap: 16px; }
:is(#tg-ticket-maker, .tm-sheet) .tm-viewer::backdrop { background: rgb(10 13 18 / 0.6); }
:is(#tg-ticket-maker, .tm-sheet) .tm-viewer-bar { display: flex; justify-content: flex-end; }
:is(#tg-ticket-maker, .tm-sheet) .tm-viewer-stage { position: relative; flex: 1; min-height: 0; }
:is(#tg-ticket-maker, .tm-sheet) .tm-viewer-stage .tm-ticket { top: 50%; left: 50%; transform-origin: 50% 50%; }
:is(#tg-ticket-maker, .tm-sheet) .tm-viewer-actions .tm-btn { width: 100%; }

/* ---------- desktop ---------- */
@media (min-width: 1024px) {
  :is(#tg-ticket-maker, .tm-sheet) .tm-card { display: grid; grid-template-columns: 360px minmax(0, 1fr); min-height: 560px; }
  :is(#tg-ticket-maker, .tm-sheet) .tm-editor {
    contain: size; /* the stage sets the row height; the editor scrolls inside it */
    overflow-y: auto;
    border-right: 1px solid var(--tm-b2);
  }
  :is(#tg-ticket-maker, .tm-sheet) .tm-stage-col {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px 32px 64px; /* the bottom keeps the corner cross-link clear of the action row */
    background-color: var(--tm-bg2);
    background-image: var(--tm-grid);
    background-size: 24px 24px;
  }
  /* cross-link pinned to the stage's bottom-right corner */
  :is(#tg-ticket-maker, .tm-sheet) .tm-cross-row { position: absolute; right: 24px; bottom: 20px; margin: 0; }
}

/* ---------- mobile and tablet ---------- */
@media (max-width: 1023px) {
  #tg-ticket-maker { padding: 0 16px; }
  :is(#tg-ticket-maker, .tm-sheet) .tm-card { display: flex; flex-direction: column; }
  :is(#tg-ticket-maker, .tm-sheet) .tm-stage-col { display: contents; }
  :is(#tg-ticket-maker, .tm-sheet) .tm-stage {
    order: -1;
    position: sticky;
    top: var(--tm-sticky-top, 76px);
    z-index: 2;
    padding: 12px;
    border-bottom: 1px solid var(--tm-b2);
    background-color: var(--tm-bg2);
    background-image: var(--tm-grid);
    background-size: 24px 24px;
  }
  :is(#tg-ticket-maker, .tm-sheet) .tm-hit {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 960px;
    height: 384px;
    padding: 0;
    border: 0;
    border-radius: 24px;
    background: transparent;
    cursor: zoom-in;
  }
  #tg-ticket-maker.tm-t-raffle .tm-hit { height: 480px; }
  :is(#tg-ticket-maker, .tm-sheet) .tm-hit:focus-visible { outline: 6px solid var(--tm-bb); outline-offset: -12px; }
  :is(#tg-ticket-maker, .tm-sheet) .tm-actions { order: -1; margin: 0; padding: 16px 16px 0; }
  :is(#tg-ticket-maker, .tm-sheet) .tm-cross-row { order: -1; margin: 0; padding: 12px 16px 16px; border-bottom: 1px solid var(--tm-b2); }
  :is(#tg-ticket-maker, .tm-sheet) .tm-dl { display: flex; flex: 1 1 100%; }
  :is(#tg-ticket-maker, .tm-sheet) .tm-dl .tm-dl-main { flex: 1; }
  :is(#tg-ticket-maker, .tm-sheet) .tm-more { flex: 1 1 100%; gap: 8px 20px; } /* one row under the full-width Download button */
  :is(#tg-ticket-maker, .tm-sheet) .tm-link { padding: 8px 0; }
  :is(#tg-ticket-maker, .tm-sheet) .tm-sticky-bar {
    order: 1;
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding: 12px 16px;
    border-top: 1px solid var(--tm-b2);
    background: var(--tm-bg1);
  }
  :is(#tg-ticket-maker, .tm-sheet) .tm-sticky-bar .tm-btn { width: 100%; }
}

@media (min-width: 1024px) {
  #tg-ticket-maker .tm-sticky-bar { display: none !important; }
}

/* ---------- Sign Up sheet (portal) ---------- */
.tm-sheet { position: fixed; inset: 0; z-index: 1000; }
.tm-sheet[hidden] { display: none !important; }
.tm-sheet .tm-sheet-backdrop { position: absolute; inset: 0; background: rgba(10, 13, 18, 0.5); }
.tm-sheet .tm-sheet-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: 100%;
  padding: 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--tm-bg1);
  box-shadow: var(--tm-sh-lg);
}
.tm-sheet .tm-sheet-handle { display: none; }
.tm-sheet .tm-sheet-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--tm-bg1);
  color: var(--tm-t4);
}
.tm-sheet .tm-sheet-close:hover { background: var(--tm-bg2); color: var(--tm-t2); }
.tm-sheet .tm-sheet-ticket {
  position: relative;
  width: 100%;
  margin: 24px 0 24px;
  aspect-ratio: 960 / 384;
  transform: rotate(-2deg);
  box-shadow: var(--tm-sh-lg);
}
.tm-sheet.tm-t-raffle .tm-sheet-ticket { aspect-ratio: 960 / 480; }
/* after-download only: success row above the pitch */
.tm-sheet .tm-sheet-status {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 20px;
  padding: 0 44px 20px 0;
  border-bottom: 1px solid var(--tm-b2);
}
.tm-sheet .tm-sheet-status .tm-ic { color: var(--tm-success); margin-top: 2px; }
.tm-sheet .tm-sheet-status-title { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; color: var(--tm-t1); }
.tm-sheet .tm-sheet-status-line { margin: 0; font-size: 14px; line-height: 20px; color: var(--tm-t3); }
.tm-sheet .tm-sheet-status:not([hidden]) + .tm-sheet-ticket { margin-top: 0; }
.tm-sheet .tm-sheet-title { margin: 0; font-size: 24px; line-height: 32px; font-weight: 700; color: var(--tm-t1); }
/* the heading only receives focus programmatically on open (tabindex -1), so it shows no ring */
:is(#tg-ticket-maker, .tm-sheet) .tm-sheet-title:focus { outline: none; }
.tm-sheet .tm-sheet-line { margin: 8px 0 0; font-size: 16px; line-height: 24px; color: var(--tm-t3); }
.tm-sheet .tm-sheet-benefits { display: flex; flex-direction: column; gap: 12px; margin: 24px 0; padding: 0; list-style: none; }
.tm-sheet .tm-sheet-benefits li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  color: var(--tm-t2);
}
.tm-sheet .tm-sheet-benefits .tm-ic { margin-top: 2px; color: var(--tm-brand); }
:is(#tg-ticket-maker, .tm-sheet) .tm-sheet-cta { display: flex; width: 100%; height: 48px; text-decoration: none; }
.tm-sheet .tm-sheet-note { margin: 12px 0 0; font-size: 14px; line-height: 20px; color: var(--tm-t3); text-align: center; }
.tm-sheet .tm-sheet-login { margin: 16px 0 0; font-size: 14px; line-height: 20px; color: var(--tm-t3); text-align: center; }
.tm-sheet .tm-sheet-login-link { font-weight: 600; color: var(--tm-brand); text-decoration: none; }
.tm-sheet .tm-sheet-login-link:hover { color: var(--tm-brand-strong); text-decoration: underline; }
@media (max-width: 767px) {
  .tm-sheet .tm-sheet-panel {
    top: auto;
    left: 0;
    width: 100%;
    max-height: 88vh;
    padding: 28px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    border-radius: 20px 20px 0 0;
  }
  .tm-sheet .tm-sheet-handle {
    display: block;
    position: absolute;
    top: 8px;
    left: 50%;
    width: 36px;
    height: 4px;
    margin-left: -18px;
    border-radius: 2px;
    background: var(--tm-b1);
  }
  .tm-sheet .tm-sheet-close { top: 8px; right: 8px; }
}

/* below ~400px two date/time columns are too narrow for the native controls: stack them */
@media (max-width: 399px) {
  :is(#tg-ticket-maker, .tm-sheet) .tm-row2 { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}

/* ---------- drawer scenes (Revision 5) ----------
 * Drawn at 376x200 and scaled into the box by JS. Only transform / opacity (plus stroke-dashoffset and
 * clip-path) are animated. Base styles = the final meaningful frame, which is what reduced motion shows. */
.tm-sheet .tm-scene { position: relative; height: 200px; margin: 0; overflow: hidden; }
.tm-sheet .tm-scene-art { position: absolute; inset: 0; }
.tm-sheet .tm-sc { position: absolute; top: 0; left: 50%; width: 376px; height: 200px; transform: translateX(-50%); transform-origin: 50% 0; color: var(--tm-t1); font-size: 12px; line-height: 16px; }
.tm-sheet .tm-sc-wrap { position: absolute; inset: 0; }
.tm-sheet .tm-sc p { margin: 0; }
.tm-sheet .tm-sc-draw { stroke-dasharray: 1; stroke-dashoffset: 0; }
@media (max-width: 767px) { .tm-sheet .tm-scene { height: 168px; } }

/* simplified ticket */
.tm-sheet .tm-mt {
  position: absolute;
  display: flex;
  width: 220px;
  height: 88px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--mt-bg);
  color: var(--mt-fg);
  box-shadow: var(--tm-sh-lg);
  -webkit-mask:
    radial-gradient(circle at 165px 0, transparent 5px, #000 5.5px) top / 100% 51% no-repeat,
    radial-gradient(circle at 165px 100%, transparent 5px, #000 5.5px) bottom / 100% 51% no-repeat;
  mask:
    radial-gradient(circle at 165px 0, transparent 5px, #000 5.5px) top / 100% 51% no-repeat,
    radial-gradient(circle at 165px 100%, transparent 5px, #000 5.5px) bottom / 100% 51% no-repeat;
}
.tm-sheet .tm-mt-raffle {
  width: 200px;
  height: 100px;
  -webkit-mask:
    radial-gradient(circle at 50px 0, transparent 5px, #000 5.5px) top / 100% 51% no-repeat,
    radial-gradient(circle at 50px 100%, transparent 5px, #000 5.5px) bottom / 100% 51% no-repeat;
  mask:
    radial-gradient(circle at 50px 0, transparent 5px, #000 5.5px) top / 100% 51% no-repeat,
    radial-gradient(circle at 50px 100%, transparent 5px, #000 5.5px) bottom / 100% 51% no-repeat;
}
.tm-sheet .tm-mt-main { position: relative; z-index: 1; flex: 1; min-width: 0; padding: 10px 10px 0 12px; }
.tm-sheet .tm-mt-logo { display: block; width: auto; max-width: 48px; height: 14px; margin-bottom: 6px; object-fit: contain; object-position: left center; }
.tm-sheet .tm-mt-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 13px;
  line-height: 16px;
  font-weight: 600;
}
.tm-sheet .tm-mt-stub { position: relative; z-index: 1; flex: none; width: 55px; background: var(--mt-stub); }
.tm-sheet .tm-mt-stub::before { content: ''; position: absolute; top: 6px; bottom: 6px; left: 0; border-left: 1.5px dashed currentColor; opacity: 0.35; }
.tm-sheet .tm-mt-raffle .tm-mt-stub { width: 50px; }
.tm-sheet .tm-mt-raffle .tm-mt-stub::before { left: auto; right: 0; border-left: 0; border-right: 2px dotted currentColor; }
.tm-sheet .tm-mt-slot { position: absolute; z-index: 2; left: 174px; top: 16px; width: 36px; height: 36px; display: grid; place-items: center; }
.tm-sheet .tm-mt-raffle .tm-mt-slot { left: 156px; top: 56px; width: 32px; height: 32px; }
.tm-sheet .tm-mt-slot svg { display: block; border-radius: 2px; }
.tm-sheet .tm-mt-art { background: #F7F3EA; color: #181D27; }
.tm-sheet .tm-mt-art .tm-mt-stub { background: transparent; }
.tm-sheet .tm-mt-artwork { position: absolute; inset: 0; }
.tm-sheet .tm-mt-artwork svg { display: block; width: 100%; height: 100%; }
.tm-sheet .tm-mt-art .tm-mt-name { color: #181D27; }

/* --- A) qr: a cursor drops a QR Code onto the stub, the ID types in, then two scans: Verified, then Duplicate ---
 * 8s loop: 0.4s 5% · 0.7s 8.75% · 2.1s 26.25% · 2.3s 28.75% · 2.4s 30% · 2.8s 35% · 2.9s 36.25% · 3.4s 42.5% ·
 * 4.1s 51.25% · 5.3s 66.25% · 5.9s 73.75% · 7.1s 88.75% · 7.7s 96.25%. Base styles = QR on the stub + Verified. */
.tm-sheet .tm-sc-qr .tm-sc-wrap { animation: tm-sc-fade-q 8s linear infinite both; }
/* ticket + tile + cursor + ID start 1.35x, centred on their bounding box (event 30..250 x 50..162, raffle
 * 30..230 x 44..168), and shrink to the base layout in step with the phone's entrance */
.tm-sheet .tm-sc-q-grp { position: absolute; inset: 0; transform-origin: 140px 106px; --q-big: translate(48px, -6px) scale(1.35); animation: tm-sc-q-grp 8s linear infinite both; }
.tm-sheet.tm-t-raffle .tm-sc-q-grp { transform-origin: 130px 106px; --q-big: translate(58px, -6px) scale(1.35); }
.tm-sheet .tm-sc-qr .tm-mt { left: 30px; top: 50px; animation: tm-sc-q-ticket 8s ease-out infinite both; }
.tm-sheet .tm-sc-qr .tm-mt-raffle { top: 44px; }
.tm-sheet .tm-sc-q-blank { position: absolute; font-size: 12px; line-height: 14px; font-weight: 600; white-space: nowrap; opacity: 0; animation: tm-sc-q-blank 8s linear infinite both; }
.tm-sheet .tm-sc-qr .tm-sc-tile { left: 204px; top: 66px; animation: tm-sc-q-tile 8s ease-out infinite both; }
.tm-sheet.tm-t-raffle .tm-sc-qr .tm-sc-tile { left: 186px; top: 100px; }
.tm-sheet .tm-sc-qr .tm-sc-cursor { left: 228px; top: 90px; animation: tm-sc-q-cursor 8s ease-out infinite both; }
.tm-sheet.tm-t-raffle .tm-sc-qr .tm-sc-cursor { left: 208px; top: 122px; }
.tm-sheet .tm-sc-q-id { /* the ticket ID types in under the ticket, right-aligned to the QR side */
  position: absolute;
  right: 132px; /* shrink-wrapped so the typing clip reveals the glyphs, not empty box */
  top: 146px;
  white-space: nowrap;
  color: var(--tm-t2);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  animation: tm-sc-q-type 8s linear infinite both;
}
.tm-sheet.tm-t-raffle .tm-sc-q-id { top: 152px; right: 152px; }
.tm-sheet .tm-sc-phone { position: absolute; left: 262px; top: 26px; width: 76px; height: 148px; animation: tm-sc-q-phone 8s ease-out infinite both; }
.tm-sheet .tm-sc-phone-svg { display: block; font-family: inherit; }
.tm-sheet .tm-sc-vf { opacity: 0; animation: tm-sc-q-vf 8s linear infinite both; }
.tm-sheet .tm-sc-scan { opacity: 0; animation: tm-sc-q-scan 8s linear infinite both; }
.tm-sheet .tm-sc-ok { animation: tm-sc-q-ok 8s linear infinite both; }
.tm-sheet .tm-sc-okd { animation: tm-sc-q-okd 8s ease-out infinite both; }
.tm-sheet .tm-sc-bad { opacity: 0; animation: tm-sc-q-bad 8s linear infinite both; }
.tm-sheet .tm-sc-badd { animation: tm-sc-q-badd 8s ease-out infinite both; }

@keyframes tm-sc-fade-q { 0%, 96.25% { opacity: 1; } 100% { opacity: 0; } }
@keyframes tm-sc-q-ticket { 0% { opacity: 0; transform: translateX(-14px); } 5%, 100% { opacity: 1; transform: none; } }
@keyframes tm-sc-q-blank { 0%, 28.75% { opacity: 1; } 30%, 100% { opacity: 0; } }
@keyframes tm-sc-q-tile {
  0%, 8.75% { opacity: 0; transform: translate(44px, 30px); }
  10% { opacity: 1; transform: translate(44px, 30px); }
  26.25% { opacity: 1; transform: scale(1.08); }
  28.75%, 100% { opacity: 1; transform: none; }
}
@keyframes tm-sc-q-cursor {
  0%, 8.75% { opacity: 0; transform: translate(44px, 30px); }
  10% { opacity: 1; transform: translate(44px, 30px); }
  26.25%, 30% { opacity: 1; transform: none; }
  33%, 100% { opacity: 0; transform: none; }
}
@keyframes tm-sc-q-type {
  0%, 30% { clip-path: inset(0 100% 0 0); animation-timing-function: steps(12, end); }
  35%, 100% { clip-path: inset(0 0 0 0); }
}
@keyframes tm-sc-q-grp {
  0%, 36.25% { transform: var(--q-big); animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
  42.5%, 100% { transform: none; }
}
@keyframes tm-sc-q-phone {
  0%, 36.25% { opacity: 0; transform: translateX(110px); animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
  37% { opacity: 1; }
  42.5%, 75% { opacity: 1; transform: none; }
  76.25% { transform: translateX(4px); }
  77.5% { transform: translateX(-4px); }
  78.75% { transform: translateX(4px); }
  80% { transform: translateX(-4px); }
  81.25%, 100% { opacity: 1; transform: none; }
}
@keyframes tm-sc-q-vf { 0%, 51.25% { opacity: 1; } 52%, 66.25% { opacity: 0; } 67%, 73.75% { opacity: 1; } 74.5%, 100% { opacity: 0; } }
@keyframes tm-sc-q-scan {
  0%, 42.5% { opacity: 0; transform: translateY(0); }
  43% { opacity: 1; transform: translateY(0); }
  51% { opacity: 1; transform: translateY(36px); }
  51.25%, 66.25% { opacity: 0; transform: translateY(0); }
  67% { opacity: 1; transform: translateY(0); }
  73.5% { opacity: 1; transform: translateY(36px); }
  73.75%, 100% { opacity: 0; transform: translateY(36px); }
}
@keyframes tm-sc-q-ok { 0%, 51.25% { opacity: 0; } 52%, 66.25% { opacity: 1; } 67%, 100% { opacity: 0; } }
@keyframes tm-sc-q-okd { 0%, 52% { stroke-dashoffset: 1; } 57%, 100% { stroke-dashoffset: 0; } }
@keyframes tm-sc-q-bad { 0%, 73.75% { opacity: 0; } 74.5%, 100% { opacity: 1; } }
@keyframes tm-sc-q-badd { 0%, 74.5% { stroke-dashoffset: 1; } 79%, 100% { stroke-dashoffset: 0; } }

/* --- B) send: the ticket folds into an envelope that lands as an email; SMS and WhatsApp follow; guests tick Sent ---
 * End state (and reduced motion): chips lit; left column = email card + SMS bubble; right column = guest list, all Sent. */
.tm-sheet .tm-sc-send .tm-sc-wrap { animation: tm-sc-fade-s 6.4s linear infinite both; }
.tm-sheet .tm-sc-chips { position: absolute; top: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; }
.tm-sheet .tm-sc-chip { position: relative; display: block; height: 24px; border-radius: 12px; font-size: 12px; line-height: 16px; font-weight: 600; }
.tm-sheet .tm-sc-chip-base, .tm-sheet .tm-sc-chip-lit {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 10px;
  border-radius: 12px;
  white-space: nowrap;
}
.tm-sheet .tm-sc-chip-base { border: 1px solid var(--tm-b2); color: var(--tm-t3); background: var(--tm-bg1); }
.tm-sheet .tm-sc-chip-lit { position: absolute; inset: 0; border: 1px solid var(--tm-ring); background: var(--tm-bgb); color: var(--tm-brand-strong); }
.tm-sheet .tm-sc-c1 .tm-sc-chip-lit { animation: tm-sc-s-c1 6.4s linear infinite both; }
.tm-sheet .tm-sc-c2 .tm-sc-chip-lit { animation: tm-sc-s-c2 6.4s linear infinite both; }
.tm-sheet .tm-sc-c3 .tm-sc-chip-lit { animation: tm-sc-s-c3 6.4s linear infinite both; }
.tm-sheet .tm-sc-s-hold { position: absolute; left: 30px; top: 62px; transform: scale(0.68); transform-origin: 0 0; }
.tm-sheet .tm-sc-s-hold .tm-mt { position: relative; opacity: 0; animation: tm-sc-s-ticket 6.4s ease-out infinite both; }
.tm-sheet .tm-sc-env { position: absolute; left: 73px; top: 70px; opacity: 0; animation: tm-sc-s-env 6.4s ease-in-out infinite both; }
.tm-sheet .tm-sc-env svg { display: block; overflow: visible; }
.tm-sheet .tm-sc-flap { transform-origin: 50% 0; transform-box: fill-box; animation: tm-sc-s-flap 6.4s ease-in-out infinite both; }
.tm-sheet .tm-sc-mail {
  position: absolute;
  left: 12px;
  top: 44px;
  width: 184px;
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--tm-b2);
  border-radius: 8px;
  background: var(--tm-bg1);
  box-shadow: var(--tm-sh-xs);
  color: var(--tm-brand);
  animation: tm-sc-s-mail 6.4s ease-out infinite both;
}
.tm-sheet .tm-sc-mail > div { flex: 1; min-width: 0; }
.tm-sheet .tm-sc-mail-subj { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: var(--tm-t1); font-weight: 600; }
.tm-sheet .tm-sc-mail i { display: block; height: 4px; margin-top: 5px; border-radius: 2px; background: var(--tm-b2); }
.tm-sheet .tm-sc-mail i:last-child { width: 60%; }
.tm-sheet .tm-sc-sms {
  position: absolute;
  left: 26px;
  top: 116px;
  width: 170px;
  padding: 8px 10px;
  border-radius: 12px 12px 12px 4px;
  background: var(--tm-bg3);
  color: var(--tm-t1);
  animation: tm-sc-s-sms 6.4s cubic-bezier(.34, 1.56, .64, 1) infinite both;
  transform-origin: 0 100%;
}
.tm-sheet .tm-sc-sms p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.tm-sheet .tm-sc-list { position: absolute; left: 208px; top: 44px; width: 156px; }
.tm-sheet .tm-sc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  padding: 0 4px;
  border-bottom: 1px solid var(--tm-b2);
  font-size: 13px;
  font-weight: 500;
}
.tm-sheet .tm-sc-sent { display: flex; align-items: center; gap: 4px; color: #079455; font-size: 12px; font-weight: 600; }
.tm-sheet .tm-sc-sent svg { display: block; }
.tm-sheet .tm-sc-r1 .tm-sc-sent > span { animation: tm-sc-s-t1 6.4s linear infinite both; }
.tm-sheet .tm-sc-r2 .tm-sc-sent > span { animation: tm-sc-s-t2 6.4s linear infinite both; }
.tm-sheet .tm-sc-r3 .tm-sc-sent > span { animation: tm-sc-s-t3 6.4s linear infinite both; }
.tm-sheet .tm-sc-r1 .tm-sc-draw { animation: tm-sc-s-k1 6.4s ease-out infinite both; }
.tm-sheet .tm-sc-r2 .tm-sc-draw { animation: tm-sc-s-k2 6.4s ease-out infinite both; }
.tm-sheet .tm-sc-r3 .tm-sc-draw { animation: tm-sc-s-k3 6.4s ease-out infinite both; }

/* 6.4s loop: 0.7s 10.87% · 1.25s 19.57% · 1.8s 28.26% · 2.35s 36.96% · 2.8s 43.48% · 3.35s 52.17% · 3.95s 61.96% · 4.6s 71.74% · 5.85s 91.3% */
@keyframes tm-sc-fade-s { 0%, 91.3% { opacity: 1; } 100% { opacity: 0; } }
@keyframes tm-sc-s-ticket {
  0% { opacity: 0; transform: translateX(-14px); }
  10.87% { opacity: 1; transform: none; }
  19.57%, 100% { opacity: 0; transform: scale(0.4); }
}
@keyframes tm-sc-s-env {
  0%, 13% { opacity: 0; transform: none; }
  17% { opacity: 1; transform: none; }
  19.57% { opacity: 1; transform: none; }
  24% { opacity: 1; transform: translate(-20px, -30px) rotate(-8deg); }
  28.26%, 100% { opacity: 0; transform: translate(-50px, -22px) scale(0.35); }
}
@keyframes tm-sc-s-flap { 0%, 15% { transform: scaleY(-1); } 19%, 100% { transform: scaleY(1); } }
@keyframes tm-sc-s-mail { 0%, 26% { opacity: 0; transform: translateY(-8px) scale(0.96); } 28.26%, 100% { opacity: 1; transform: none; } }
@keyframes tm-sc-s-sms { 0%, 36.96% { opacity: 0; transform: scale(0.6); } 41%, 100% { opacity: 1; transform: none; } }
@keyframes tm-sc-s-c1 { 0%, 28.26% { opacity: 0; } 30%, 100% { opacity: 1; } }
@keyframes tm-sc-s-c2 { 0%, 36.96% { opacity: 0; } 38.7%, 100% { opacity: 1; } }
@keyframes tm-sc-s-c3 { 0%, 43.48% { opacity: 0; } 45.2%, 100% { opacity: 1; } }
@keyframes tm-sc-s-t1 { 0%, 52.17% { opacity: 0; } 54%, 100% { opacity: 1; } }
@keyframes tm-sc-s-t2 { 0%, 61.96% { opacity: 0; } 63.8%, 100% { opacity: 1; } }
@keyframes tm-sc-s-t3 { 0%, 71.74% { opacity: 0; } 73.6%, 100% { opacity: 1; } }
@keyframes tm-sc-s-k1 { 0%, 52.17% { stroke-dashoffset: 1; } 58.7%, 100% { stroke-dashoffset: 0; } }
@keyframes tm-sc-s-k2 { 0%, 61.96% { stroke-dashoffset: 1; } 68.5%, 100% { stroke-dashoffset: 0; } }
@keyframes tm-sc-s-k3 { 0%, 71.74% { stroke-dashoffset: 1; } 78.3%, 100% { stroke-dashoffset: 0; } }

/* --- C) own-design: an uploaded design becomes the ticket, a QR Code is dragged onto its stub, copies get IDs ---
 * End state (and reduced motion): one front ticket, two plain copies peeking behind, three ID chips below. */
.tm-sheet .tm-sc-own-design .tm-sc-wrap { animation: tm-sc-fade-o 5s linear infinite both; }
.tm-sheet .tm-sc-zone {
  position: absolute;
  left: 68px;
  top: 22px;
  width: 240px;
  height: 156px;
  border: 1.5px dashed var(--tm-b1);
  border-radius: 12px;
  background: var(--tm-bg2);
  opacity: 0;
  animation: tm-sc-o-zone 5s linear infinite both;
}
.tm-sheet .tm-sc-file {
  position: absolute;
  left: 88px;
  top: 62px;
  width: 200px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 1px solid var(--tm-b2);
  border-radius: 8px;
  background: var(--tm-bg1);
  box-shadow: var(--tm-sh-xs);
  opacity: 0;
  animation: tm-sc-o-file 5s ease-out infinite both;
}
.tm-sheet .tm-sc-thumb { display: block; flex: none; width: 48px; height: 36px; border-radius: 4px; overflow: hidden; }
.tm-sheet .tm-sc-thumb svg { display: block; width: 100%; height: 100%; }
.tm-sheet .tm-sc-fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tm-sheet .tm-sc-up { position: absolute; left: 88px; top: 120px; width: 200px; color: var(--tm-t3); opacity: 0; animation: tm-sc-o-up 5s linear infinite both; }
.tm-sheet .tm-sc-bar { display: block; height: 4px; margin-top: 6px; border-radius: 2px; background: var(--tm-b2); overflow: hidden; }
.tm-sheet .tm-sc-bar i { display: block; height: 100%; background: var(--tm-solid); transform-origin: 0 50%; animation: tm-sc-o-bar 5s linear infinite both; }
/* the front ticket, centred; raffle is 200x100 */
.tm-sheet .tm-sc-own-design .tm-mt { left: 78px; top: 36px; }
.tm-sheet .tm-sc-own-design .tm-mt-raffle { left: 88px; top: 30px; }
.tm-sheet .tm-sc-o-main { animation: tm-sc-o-morph 5s ease-out infinite both; }
/* the visitor's name on a light band so it reads over any artwork */
.tm-sheet .tm-mt-art .tm-mt-name {
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* plain copies peeking out behind the front ticket */
.tm-sheet .tm-sc-o-back { box-shadow: var(--tm-sh-xs); }
.tm-sheet .tm-sc-o-b1 { background: #E5DCCB; transform: translate(8px, -8px); animation: tm-sc-o-b1 5s ease-out infinite both; }
.tm-sheet .tm-sc-o-b2 { background: #D6CBB6; transform: translate(16px, -16px); animation: tm-sc-o-b2 5s ease-out infinite both; }
.tm-sheet .tm-sc-tile { position: absolute; z-index: 3; width: 36px; height: 36px; border-radius: 3px; box-shadow: var(--tm-sh-lg); }
.tm-sheet.tm-t-raffle .tm-sc-tile { width: 32px; height: 32px; }
.tm-sheet .tm-sc-tile svg { display: block; border-radius: 3px; }
.tm-sheet .tm-sc-cursor { position: absolute; z-index: 4; opacity: 0; }
.tm-sheet .tm-sc-cursor svg { display: block; }
.tm-sheet .tm-sc-own-design .tm-sc-tile { left: 252px; top: 52px; animation: tm-sc-o-tile 5s ease-out infinite both; }
.tm-sheet.tm-t-raffle .tm-sc-own-design .tm-sc-tile { left: 244px; top: 86px; }
.tm-sheet .tm-sc-own-design .tm-sc-cursor { left: 276px; top: 76px; animation: tm-sc-o-cursor 5s ease-out infinite both; }
.tm-sheet.tm-t-raffle .tm-sc-own-design .tm-sc-cursor { left: 266px; top: 108px; }
.tm-sheet .tm-sc-ids { position: absolute; left: 0; right: 0; top: 150px; display: flex; justify-content: center; gap: 8px; }
.tm-sheet.tm-t-raffle .tm-sc-ids { top: 156px; }
.tm-sheet .tm-sc-id {
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--tm-ring);
  background: var(--tm-bgb);
  color: var(--tm-brand-strong);
  font-variant-numeric: tabular-nums;
  line-height: 22px;
}
.tm-sheet .tm-sc-id1 { animation: tm-sc-o-id1 5s ease-out infinite both; }
.tm-sheet .tm-sc-id2 { animation: tm-sc-o-id2 5s ease-out infinite both; }
.tm-sheet .tm-sc-id3 { animation: tm-sc-o-id3 5s ease-out infinite both; }

/* 5s loop: 0.6s 12% · 1.4s 28% · 2.0s 40% · 3.0s 60% · 3.2s 64% · 3.4s 68% · 3.6s 72% · 4.2s 84% */
@keyframes tm-sc-fade-o { 0%, 84% { opacity: 1; } 100% { opacity: 0; } }
@keyframes tm-sc-o-zone { 0%, 28% { opacity: 1; } 34%, 100% { opacity: 0; } }
@keyframes tm-sc-o-file { 0% { opacity: 0; transform: translateY(-36px); } 10% { opacity: 1; transform: translateY(3px); } 12%, 27% { opacity: 1; transform: none; } 31%, 100% { opacity: 0; transform: none; } }
@keyframes tm-sc-o-up { 0%, 12% { opacity: 0; } 14%, 28% { opacity: 1; } 31%, 100% { opacity: 0; } }
@keyframes tm-sc-o-bar { 0%, 14% { transform: scaleX(0); } 28%, 100% { transform: scaleX(1); } }
@keyframes tm-sc-o-morph {
  0%, 27% { opacity: 0; transform: translate(-70px, 8px) scale(0.22); }
  30% { opacity: 1; transform: translate(-70px, 8px) scale(0.22); }
  40%, 100% { opacity: 1; transform: none; }
}
@keyframes tm-sc-o-tile {
  0%, 40% { opacity: 0; transform: translate(110px, 70px); }
  42% { opacity: 1; transform: translate(110px, 70px); }
  56% { opacity: 1; transform: scale(1.08); }
  60%, 100% { opacity: 1; transform: none; }
}
@keyframes tm-sc-o-cursor {
  0%, 40% { opacity: 0; transform: translate(110px, 70px); }
  42% { opacity: 1; transform: translate(110px, 70px); }
  56%, 61% { opacity: 1; transform: none; }
  65%, 100% { opacity: 0; transform: none; }
}
@keyframes tm-sc-o-b1 { 0%, 60% { opacity: 0; transform: none; } 66%, 100% { opacity: 1; transform: translate(8px, -8px); } }
@keyframes tm-sc-o-b2 { 0%, 62% { opacity: 0; transform: none; } 68%, 100% { opacity: 1; transform: translate(16px, -16px); } }
@keyframes tm-sc-o-id1 { 0%, 64% { opacity: 0; transform: translateY(6px); } 67%, 100% { opacity: 1; transform: none; } }
@keyframes tm-sc-o-id2 { 0%, 68% { opacity: 0; transform: translateY(6px); } 71%, 100% { opacity: 1; transform: none; } }
@keyframes tm-sc-o-id3 { 0%, 72% { opacity: 0; transform: translateY(6px); } 75%, 100% { opacity: 1; transform: none; } }

/* ---------- motion (task 5). Everything here is switched off by .tm-rm, which the JS sets from a live
 * prefers-reduced-motion matchMedia, and again by the media query below for no-JS safety. ---------- */
/* sticky (mobile) is already a containing block; only desktop needs relative here */
@media (min-width: 1024px) { :is(#tg-ticket-maker, .tm-sheet) .tm-stage { position: relative; } }
:is(#tg-ticket-maker, .tm-sheet) .tm-fit { transform-origin: 50% 50%; }
/* colour, theme and text-colour changes crossfade on the on-screen stage only (exports must paint final values) */
#tg-ticket-maker .tm-stage .tm-art { transition: background-color 240ms ease-out, color 240ms ease-out; }
#tg-ticket-maker .tm-stage .tm-stub { transition: background-color 240ms ease-out; }
:is(#tg-ticket-maker, .tm-sheet) .tm-logo { transform-origin: left center; }
/* ghost values: sample text for empty fields, on screen only, at 45% of the normal opacity */
:is(#tg-ticket-maker, .tm-sheet) .tm-meta-value.tm-ghost { opacity: 0.45; }
/* pointer highlight for the tilt */
#tg-ticket-maker .tm-glare {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: soft-light;
  background: radial-gradient(360px circle at var(--tm-gx, 50%) var(--tm-gy, 50%), rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
}
/* sliding pill under the selected segment */
:is(#tg-ticket-maker, .tm-sheet) .tm-seg-group { position: relative; }
:is(#tg-ticket-maker, .tm-sheet) .tm-has-pill .tm-seg { position: relative; z-index: 1; }
:is(#tg-ticket-maker, .tm-sheet) .tm-has-pill .tm-seg[aria-checked="true"] { background: transparent; box-shadow: none; }
:is(#tg-ticket-maker, .tm-sheet) .tm-seg-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  border-radius: 6px;
  background: var(--tm-bg1);
  box-shadow: var(--tm-sh-xs);
}
:is(#tg-ticket-maker, .tm-sheet) .tm-pill-ready .tm-seg-pill {
  transition: transform 240ms cubic-bezier(.2, .8, .2, 1), width 240ms cubic-bezier(.2, .8, .2, 1);
}
/* the Downloaded check draws itself in */
:is(#tg-ticket-maker, .tm-sheet) .tm-draw path { vector-effect: none; stroke-dasharray: 1; stroke-dashoffset: 0; animation: tm-draw 300ms ease-out backwards; }
@keyframes tm-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
/* reduced motion: every transition and keyframe animation becomes an instant state change */
#tg-ticket-maker.tm-rm *, #tg-ticket-maker.tm-rm *::before, #tg-ticket-maker.tm-rm *::after,
.tm-sheet.tm-rm *, .tm-sheet.tm-rm *::before, .tm-sheet.tm-rm *::after {
  transition: none !important;
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  :is(#tg-ticket-maker, .tm-sheet) * { transition: none !important; animation: none !important; }
  :is(#tg-ticket-maker, .tm-sheet) .tm-spin { animation: none; }
}
