/* Device tutorial player: the waiver iPad (portrait), a staff iPad (landscape) and the admin preview.
   It follows the iPad app's design system (web/screens/ds.css): the colours are the --ds-* tokens of the `ds`
   element the player sits in, so it takes the app's dark, light or night look, and the fallbacks are the dark look's
   values (the admin preview isn't inside the app). Type and sizes are the waiver screens': the system font (SF Pro on
   the iPad, as on the admin page) throughout, 600 for titles and 400 for the rest, blue only for the action to take.
   The picture area stays dark in every look, as a video does; in the night look everything in it is drawn with no
   red at all (see .tut-stage::after). */
.tut {
  --t-bg: var(--ds-bg, #161618); --t-surface: var(--ds-surface, #232326); --t-raised: var(--ds-raised, #2f2f33); --t-press: var(--ds-press, #3a3a3f);
  --t-sep: var(--ds-sep, rgba(255, 255, 255, .09));
  --t-text: var(--ds-text, #f2f2f4); --t-text-2: var(--ds-text-2, #a1a1a8); --t-text-3: var(--ds-text-3, #98989e);
  --t-accent: var(--ds-accent, #0a72e8); --t-on-accent: var(--ds-on-accent, #ffffff); --t-accent-text: var(--ds-accent-text, #68b1ff);
  --t-good: var(--ds-good, #30d158); --t-good-tint: var(--ds-good-tint, rgba(48, 209, 88, .14));
  --t-font: var(--ds-font, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Archivo", system-ui, sans-serif);
  --t-display: var(--ds-display, var(--t-font));
  /* The picture area, and the labels and notes drawn over it. */
  --t-stage: #0c0c0d; --t-chip: rgba(36, 36, 40, .9); --t-chip-line: rgba(255, 255, 255, .1);
  --t-chip-text: #f2f2f4; --t-chip-text-2: #b4b4ba; --t-mark: #0a84ff;
  position: relative; flex: 1; min-height: 0; width: 100%; height: 100%; display: flex; flex-direction: column; gap: 24px;
  padding: 32px 56px 28px; background: var(--t-bg); color: var(--t-text); box-sizing: border-box;
  font-family: var(--t-font); font-size: calc(17px * var(--ds-ts, 1)); line-height: 1.35; letter-spacing: -.005em;
}
.tut *, .tut *::before, .tut *::after { box-sizing: border-box; }
/* On the waiver iPad the player fills the space under the step bar. */
.tut-mount { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tut .ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tut.tut-wide { flex-direction: row; align-items: stretch; gap: 32px; padding: 24px 32px; }

/* ───────── the picture: 3D view, still pictures and what the eyepiece shows */
.tut-stage { position: relative; isolation: isolate; flex: 1 1 46%; min-height: 240px; border-radius: 14px; overflow: hidden; background: var(--t-stage); }
.tut-wide .tut-stage { flex: 1 1 58%; min-height: 0; }
.tut-gl { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.tut-labels { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.tut-label { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 7px; padding: 6px 12px 6px 10px; border-radius: 999px; background: var(--t-chip); color: var(--t-chip-text); font: 600 calc(15px * var(--ds-ts, 1))/calc(20px * var(--ds-ts, 1)) var(--t-font); white-space: nowrap; transition: opacity .25s; box-shadow: 0 0 0 1px var(--t-chip-line), 0 6px 18px rgba(0, 0, 0, .4); }
.tut-label::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--t-mark); flex: none; }
.tut-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.tut-nopic { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--t-chip-text-2); font-size: calc(17px * var(--ds-ts, 1)); }
.tut .tut-nopic .ic { width: 56px; height: 56px; stroke-width: 1.4; }
.tut-nopic[hidden], .tut-still[hidden] { display: none; }
.tut-badges { position: absolute; z-index: 3; top: 12px; left: 12px; right: 12px; display: flex; flex-wrap: wrap; gap: 8px; pointer-events: none; }
.tut-badge { padding: 5px 11px; border-radius: 999px; background: var(--t-chip); color: var(--t-chip-text-2); font: 600 calc(13px * var(--ds-ts, 1))/calc(18px * var(--ds-ts, 1)) var(--t-font); box-shadow: 0 0 0 1px var(--t-chip-line); }
.tut-badge.draft { color: var(--t-chip-text); box-shadow: 0 0 0 1px rgba(255, 255, 255, .3); }

/* What you see through the eyepiece */
.tut-eye { position: absolute; z-index: 2; right: 16px; bottom: 16px; width: min(36%, 270px); margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tut-eye[hidden] { display: none; }
.tut-eye-lens { position: relative; width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #000; box-shadow: 0 0 0 4px #000, 0 0 0 5px rgba(255, 255, 255, .16), 0 14px 36px rgba(0, 0, 0, .5); touch-action: none; cursor: ew-resize; }
.tut-eye-blur, .tut-eye-blur canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.tut-eye-blur { transform: scale(1.06); }
.tut-eye-flare { position: absolute; left: 58%; top: 42%; width: 140%; height: 140%; transform: translate(-50%, -50%); background: radial-gradient(circle, #fff 0 4%, rgba(235, 242, 255, .85) 10%, rgba(220, 232, 255, .25) 32%, transparent 60%); opacity: 0; pointer-events: none; }
.tut-eye figcaption { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1px; padding: 6px 12px; border-radius: 12px; background: var(--t-chip); box-shadow: 0 0 0 1px var(--t-chip-line); }
.tut-eye-k { color: var(--t-chip-text-2); font: 400 calc(13px * var(--ds-ts, 1))/calc(18px * var(--ds-ts, 1)) var(--t-font); }
.tut-eye-c { color: var(--t-chip-text); font: 600 calc(15px * var(--ds-ts, 1))/calc(20px * var(--ds-ts, 1)) var(--t-font); }
.tut-eye-try { display: flex; gap: 6px; align-items: center; font: 400 calc(13px * var(--ds-ts, 1))/calc(18px * var(--ds-ts, 1)) var(--t-font); color: var(--t-chip-text-2); }
.tut-eye-try[hidden], .tut-eye-ok[hidden] { display: none; }
.tut-eye-ok { color: #30d158; font-weight: 600; }

/* Night look: the screen must show no red near night vision, and the 3D view, the pictures and the eyepiece view are
   drawn in full colour. Multiplying the whole picture by a colour with no red takes every red value to 0. */
.ds.night .tut { --t-stage: #000000; }
.ds.night .tut-stage::after { content: ''; position: absolute; inset: 0; z-index: 4; pointer-events: none; background: rgb(0, 194, 240); mix-blend-mode: multiply; }

/* ───────── the words and the controls */
/* Headings and paragraphs name .tut too, to outrank the app's own rules for every h1, h2 and p (.ds p, .ds h2). */
.tut-panel { flex: 0 0 auto; display: flex; flex-direction: column; gap: 20px; min-height: 0; }
.tut-wide .tut-panel { flex: 1 1 42%; min-width: 0; justify-content: center; overflow-x: hidden; overflow-y: auto; }
.tut .tut-eyebrow { margin: 0; color: var(--t-text-2); font: 600 calc(17px * var(--ds-ts, 1))/calc(22px * var(--ds-ts, 1)) var(--t-font); }
.tut .tut-h1 { margin: 0; font: 600 calc(40px * var(--ds-ts, 1))/calc(46px * var(--ds-ts, 1)) var(--t-display); letter-spacing: -.02em; }
.tut .tut-h2 { margin: 0 0 8px; font: 600 calc(30px * var(--ds-ts, 1))/calc(36px * var(--ds-ts, 1)) var(--t-display); letter-spacing: -.015em; }
.tut .tut-lede { margin: 0; color: var(--t-text-2); font-size: calc(20px * var(--ds-ts, 1)); line-height: 28px; }
.tut .tut-q { margin: 8px 0 0; font: 600 calc(22px * var(--ds-ts, 1))/calc(28px * var(--ds-ts, 1)) var(--t-font); letter-spacing: -.01em; }
.tut-nb { white-space: nowrap; }
.tut-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* Buttons: the app's own (ds.css), so the player looks the same on the admin page's preview. */
.tut .b { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 20px; border: 0; border-radius: 10px; background: var(--t-raised); color: var(--t-text); font: 600 calc(17px * var(--ds-ts, 1))/1.2 var(--t-font); letter-spacing: -.005em; text-align: left; cursor: pointer; touch-action: manipulation; transition: background-color .15s ease, transform .16s cubic-bezier(.23, 1, .32, 1); }
.tut .b:active:not(:disabled) { background: var(--t-press); transform: scale(.97); }
.tut .b-primary { background: var(--t-accent); color: var(--t-on-accent); }
.tut .b-primary:active:not(:disabled) { background: var(--t-accent); filter: brightness(.9); }
.tut .b-ghost { background: var(--t-raised); }
.tut .b:disabled { background: var(--t-raised); color: var(--t-text-3); cursor: not-allowed; }
.tut .b-text { min-height: 44px; padding: 0 10px; background: transparent; color: var(--t-accent-text); font-weight: 500; }
.tut .b-text:active:not(:disabled) { background: var(--t-surface); }
.tut :focus-visible { outline: 3px solid var(--t-accent-text); outline-offset: 2px; }

/* The offer: three answers to "Have you used one before?", the suggested one ringed in blue. */
.tut-choices { display: flex; flex-direction: column; gap: 10px; }
.tut .tut-choice { min-height: 80px; justify-content: space-between; gap: 16px; padding: 14px 18px 14px 20px; border-radius: 14px; background: var(--t-surface); font-weight: 400; }
.tut .tut-choice:active:not(:disabled) { background: var(--t-raised); }
.tut-choice-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tut-choice strong { font-size: calc(20px * var(--ds-ts, 1)); line-height: 26px; font-weight: 600; }
.tut-choice small { font-size: calc(15px * var(--ds-ts, 1)); line-height: 20px; color: var(--t-text-2); }
.tut-choice > .ic { color: var(--t-text-3); }
.tut .tut-choice.primary { box-shadow: inset 0 0 0 2px var(--t-accent); }
.tut-choice.primary > .ic { color: var(--t-accent-text); }
.tut .tut-help .ic { color: var(--t-accent-text); }
.tut .tut-helped { margin: 0; display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 16px; border-radius: 12px; background: var(--t-good-tint); color: var(--t-good); font-weight: 600; font-size: calc(17px * var(--ds-ts, 1)); }
.tut .tut-skip { margin-left: auto; color: var(--t-text-2); font-weight: 400; }

/* A step */
.tut-step-k { display: flex; align-items: center; gap: 8px; color: var(--t-text-2); font: 600 calc(15px * var(--ds-ts, 1))/calc(20px * var(--ds-ts, 1)) var(--t-font); }
.tut-step-k .ic { color: var(--t-accent-text); }
.tut-pics { margin-left: auto; padding: 3px 10px; border-radius: 999px; background: var(--t-raised); font: 600 calc(13px * var(--ds-ts, 1))/calc(18px * var(--ds-ts, 1)) var(--t-font); color: var(--t-text-2); }
.tut-cap { min-height: 150px; }
.tut .tut-caption { margin: 0; font-size: calc(22px * var(--ds-ts, 1)); line-height: 30px; color: var(--t-text); }
.tut .tut-detail { margin: 10px 0 0; font-size: calc(17px * var(--ds-ts, 1)); line-height: 24px; color: var(--t-text-2); }
/* One bar per step: blue up to here, the current one filling as it plays. Each is a tall, thin target. */
.tut-prog { display: flex; gap: 4px; margin: -10px 0; }
.tut-seg { flex: 1; height: 44px; padding: 19px 0; border: 0; background: none; cursor: pointer; }
.tut-seg i { display: block; height: 6px; border-radius: 3px; background: var(--t-raised); position: relative; overflow: hidden; }
.tut-seg.done i { background: var(--t-accent); }
.tut-seg.on { position: relative; }
.tut-seg.on::before { content: ''; position: absolute; left: 0; right: 0; top: 19px; height: 6px; border-radius: 3px; background: var(--t-raised); }
.tut-seg.on i { position: relative; background: var(--t-accent); width: 0; }
.tut-ctrls { display: grid; grid-template-columns: 1fr 1fr 1fr 1.4fr; gap: 10px; }
.tut-ctrls.two { grid-template-columns: 1fr 1fr; width: 100%; }
.tut .tut-ctl { min-height: 56px; min-width: 0; padding: 0 10px; justify-content: center; }
/* Side by side (a staff iPad in landscape) the controls go two by two, so each stays a big target. */
.tut-wide .tut-ctrls:not(.two) { grid-template-columns: 1fr 1fr; }
.tut-ctl svg path { fill: none; }
.tut-ctl[data-t="pause"] svg path:first-child { fill: currentColor; }

/* The end */
.tut-end { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; }
.tut-end .tut-row { justify-content: center; }
.tut-big { width: 112px; height: 112px; margin-bottom: 10px; border-radius: 50%; background: var(--t-good-tint); color: var(--t-good); display: grid; place-items: center; }
.tut .tut-big .ic { width: 56px; height: 56px; stroke-width: 2.6; }

/* A staff iPad shows the tutorial full screen over the staff app while the customer holds it. */
.tut-overlay { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; background: var(--ds-bg, #161618); }
.tut-overlay-bar { flex: none; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 0 32px; border-bottom: 1px solid var(--ds-sep, rgba(255, 255, 255, .09)); }
.tut-overlay-bar strong { font: 600 calc(22px * var(--ds-ts, 1))/1 var(--ds-display, -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif); letter-spacing: -.01em; color: var(--ds-text, #f2f2f4); }
.tut-overlay-bar span { color: var(--ds-text-2, #a1a1a8); font-size: calc(17px * var(--ds-ts, 1)); }
.tut-overlay-bar .b { margin-left: auto; }
