/* The v1 booking form, copied by make_booking.py. Edit v1, then re-run it. */
.tg {
  --tg-title: "Oswald";
  --tg-script: "Script";
  --tg-serif: "Serif";
  --tg-mono: "TG Mono";
  --font-type: "TG Mono";
  --font-dmsans: "Sans";
  --font-heavy: "Gilroy", "Sans", sans-serif;
  --ease-out-quart: cubic-bezier(0.165, 0.84, 0.44, 1);
  --margin: 12px;
}
/* ---------- appointment form: "What is your disability?" ---------- */
.hurt {
  min-width: 0;
  padding: 14px 14px 10px;
  border: 1px solid rgba(43, 41, 38, 0.35);
  background:
    url("grain.webp") 0 0 / 300px,
    #f3ead4;
  box-shadow: inset 0 0 30px rgba(150, 110, 40, 0.12);
}
.hurt__title {
  float: left;
  width: 100%;
  margin-bottom: 6px;
  text-align: center;
  font-family: var(--font-heavy);
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  -webkit-mask: url("ink.webp") 0 0 / 160px 160px;
  mask: url("ink.webp") 0 0 / 160px 160px;
}
/* the head chart: label tag above, the drawing, zones that glow */
.hh {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  clear: both;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}
@media (max-width: 799px) {
  .hh {
    max-width: 260px;
  }
}
.hh__label {
  min-height: 1.6em;
  visibility: hidden;
  padding: 4px 10px 3px;
  font-family: var(--font-heavy);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(43, 38, 31, 0.55);
  transition:
    color 0.2s,
    background-color 0.2s,
    translate 0.25s var(--ease-out-quart);
}
.hh__label[data-on] {
  visibility: visible;
  color: #f3ead4;
  background: #2b2926;
  translate: 0 -2px;
}
.hh__svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.hh__fill {
  fill: url(#hh-glow);
  opacity: 0;
  transition: opacity 0.35s ease-out;
}
.hh__fill[data-on] {
  opacity: 0.7;
}
.hh__fill[data-picked] {
  fill: #e98d7a;
  opacity: 0.5;
}
.hh__fill[data-picked][data-on] {
  opacity: 0.72;
}
.hh__iris {
  fill: #f3ead4;
  stroke: #2b261f;
  stroke-width: 3.4;
}
/* a ring of halftone dots inside the iris, like the drawing's */
.hh__stipple {
  fill: none;
  stroke: #2b261f;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 0.1 4.2;
  opacity: 0.75;
}
.hh__pupil {
  fill: #1f1b16;
}
.hh__hit {
  fill: transparent;
  cursor: pointer;
  outline: none;
}
.hh__hit:focus-visible {
  stroke: #2b261f;
  stroke-width: 3;
  stroke-dasharray: 6 5;
}
/* room for the longest line (all six ticked) so the form never changes height */
.hurt__picked {
  min-height: calc(3 * 1.45em);
  line-height: 1.45;
  text-align: center;
  margin-top: 8px;
  font-family: var(--font-type), monospace;
  font-size: 12.5px;
  color: #7a2a20;
}


/* =========================================================================
 * The appointment form, printed like an old telegram form: two inks (blue
 * and red) on pale paper, ruled cells, dotted lines to write on.
 * ====================================================================== */
.tg {
  --tg-blue: #3c6db3;
  --tg-red: #c2483a;
  --tg-ink: #1f2430;
  --tg-paper: #eeeee6;
  position: relative;
  width: min(1180px, 100%);
  max-height: calc(100svh - var(--ticker-h) - 24px);
  overflow-y: auto;
  padding: clamp(14px, 2vw, 26px) clamp(14px, 2.2vw, 30px) clamp(12px, 1.6vw, 20px);
  color: var(--tg-blue);
  /* cool, pale form paper: the fibre tile multiplied in faintly, soft ageing */
  background:
    radial-gradient(ellipse 120% 100% at 50% 40%, transparent 62%, rgba(110, 110, 90, 0.1) 100%),
    url("grain.webp") 0 0 / 420px 420px,
    var(--tg-paper);
  background-blend-mode: normal, soft-light, normal;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}
/* masthead */
.tg__mast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(10px, 1.6vw, 24px);
}
.tg__script {
  font-family: var(--tg-script), cursive;
  font-size: clamp(18px, 2vw, 28px);
  line-height: 1;
  white-space: nowrap;
}
.tg__title {
  font-family: var(--tg-title), "Arial Narrow", sans-serif;
  font-weight: 500;
  font-size: clamp(18px, 2.1vw, 30px);
  line-height: 1;
  letter-spacing: 0.28em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}
.tg__close {
  flex: none;
  margin-left: clamp(4px, 1vw, 14px);
  font-family: var(--tg-title), sans-serif;
  font-size: 30px;
  line-height: 1;
  color: var(--tg-blue);
}
/* the terms row */
.tg__terms {
  display: flex;
  align-items: stretch;
  margin-top: clamp(12px, 1.6vw, 20px);
  border: 1.5px solid var(--tg-blue);
  border-bottom: 0;
}
.tg__code {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px 16px;
  border-right: 1.5px solid var(--tg-blue);
  font-family: var(--tg-mono), monospace;
  font-size: 12px;
  line-height: 1.25;
  text-transform: uppercase;
}
.tg__code i {
  font-family: var(--tg-serif), serif;
  font-size: 12.5px;
  text-transform: none;
}
.tg__terms p {
  align-self: center;
  padding: 8px 120px 8px 16px;
  font-family: var(--tg-mono), monospace;
  font-size: clamp(10.5px, 0.95vw, 13px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
/* the red postmark over the top-right corner */
.tg__postmark {
  position: absolute;
  top: clamp(26px, 4.2vw, 54px);
  right: clamp(18px, 3vw, 46px);
  width: clamp(92px, 10.5vw, 132px);
  rotate: -14deg;
  fill: none;
  stroke: var(--tg-red);
  opacity: 0.72;
  mix-blend-mode: multiply;
  pointer-events: none;
  -webkit-mask: var(--grime) 0 0 / 140px 140px, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: var(--grime) 0 0 / 140px 140px exclude, linear-gradient(#000 0 0);
}
.tg__postmark circle {
  stroke-width: 2.6;
}
.tg__postmark .tg__postmark-inner {
  stroke-width: 0;
}
.tg__postmark text {
  stroke: none;
  fill: var(--tg-red);
  font-family: var(--tg-mono), monospace;
}
.tg__postmark-top {
  font-size: 13px;
  letter-spacing: 0.18em;
}
.tg__postmark-date {
  font-size: 15px;
  letter-spacing: 0.05em;
}
.tg__postmark-star {
  font-size: 11px;
}
/* the ruled table */
.tg__table {
  border: 1.5px solid var(--tg-blue);
}
.tg__patient {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 8px 18px 6px;
  border-bottom: 1.5px solid var(--tg-blue);
  color: var(--tg-red);
}
.tg__patient span {
  font-family: var(--tg-serif), serif;
  font-size: clamp(16px, 1.5vw, 20px);
}
.tg__patient b {
  font-family: var(--tg-mono), monospace;
  font-weight: 400;
  font-size: clamp(18px, 1.7vw, 22px);
  letter-spacing: 0.18em;
}
.tg__grid {
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 800px) {
  .tg__grid {
    grid-template-columns: 45% 1fr;
  }
}
.tg__cell {
  padding: 14px 20px;
}
.tg__cell--chart {
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1.5px solid var(--tg-blue);
}
@media (min-width: 800px) {
  .tg__cell--chart {
    border-bottom: 0;
    border-right: 1.5px solid var(--tg-blue);
  }
}
.tg__fields {
  display: flex;
  flex-direction: column;
}
.tg__fields > .tg__cell + .tg__cell {
  border-top: 1.5px solid var(--tg-blue);
}
.tg__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tg__label {
  font-family: var(--tg-serif), serif;
  font-size: 15px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
/* writing on dotted lines */
.tg__field input,
.tg__field textarea {
  appearance: none;
  box-shadow: none;
  width: 100%;
  padding: 0 2px;
  border: 0;
  outline: none;
  background: transparent;
  font-family: var(--tg-mono), monospace;
  font-size: 17px;
  color: var(--tg-ink);
}
.tg__field input {
  height: 38px;
  background: radial-gradient(circle, var(--tg-blue) 0 0.9px, transparent 1.3px) 0 100% / 5px 4px repeat-x;
}
.tg__field textarea {
  --line: 37px;
  height: calc(var(--line) * 5);
  /* one dotted line at the bottom of every row of text */
  line-height: var(--line);
  padding: 0 2px;
  resize: none;
  background: radial-gradient(circle at 50% calc(100% - 3px), var(--tg-blue) 0 0.9px, transparent 1.3px) 0 0 / 5px var(--line) repeat;
  background-attachment: local;
}
/* focus: the dotted line darkens, no box */
.tg__field:focus-within .tg__label {
  color: var(--tg-red);
}
/* red rubber stamp buttons */
.tg__send {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding-block: 22px;
}
.tg__stamp {
  display: inline-block;
  padding: 9px 22px 7px;
  border: 2px solid var(--tg-red);
  font-family: var(--tg-mono), monospace;
  font-size: 22px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--tg-red);
  background: transparent;
  mix-blend-mode: multiply;
  -webkit-mask: var(--grime) 0 0 / 120px 120px, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: var(--grime) 0 0 / 120px 120px exclude, linear-gradient(#000 0 0);
  transition:
    background-color 0.15s,
    color 0.15s;
}
.tg__stamp:hover:not(:disabled) {
  background: var(--tg-red);
  color: var(--tg-paper);
}
.tg__stamp:disabled {
  opacity: 0.55;
}
.tg__stamp--blue {
  border-color: var(--tg-blue);
  color: var(--tg-blue);
}
.tg__stamp--blue:hover {
  background: var(--tg-blue) !important;
}
.tg__error {
  font-family: var(--tg-mono), monospace;
  font-size: 14px;
  color: var(--tg-red);
}
.tg__foot {
  margin-top: clamp(12px, 1.6vw, 20px);
  font-family: var(--tg-title), sans-serif;
  font-size: clamp(12px, 1.1vw, 15px);
  letter-spacing: 0.42em;
  text-align: center;
  text-transform: uppercase;
}
/* the head chart, in the form's inks */
.tg .hurt {
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
.tg .hurt__title {
  margin-bottom: 4px;
  font-family: var(--tg-title), sans-serif;
  font-weight: 500;
  font-size: clamp(15px, 1.5vw, 20px);
  letter-spacing: 0.32em;
  color: var(--tg-blue);
  -webkit-mask: none;
  mask: none;
}
.tg .hh {
  max-width: 400px;
}
.tg .hh__label {
  font-family: var(--tg-mono), monospace;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.14em;
  color: var(--tg-red);
}
.tg .hh__label[data-on] {
  color: var(--tg-red);
  background: none;
}
.tg .hurt__picked {
  font-family: var(--tg-serif), serif;
  font-style: italic;
  font-size: clamp(14px, 1.3vw, 17px);
  color: var(--tg-blue);
}
/* after booking */
.tg__done {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 22px 26px;
}
.tg__done-title {
  font-family: var(--tg-title), sans-serif;
  font-weight: 500;
  font-size: clamp(20px, 2.2vw, 28px);
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.tg__done-text {
  max-width: 60ch;
  font-family: var(--tg-mono), monospace;
  font-size: 17px;
  line-height: 1.5;
  color: var(--tg-ink);
}
.tg__done-card {
  width: 100%;
  max-width: 560px;
  height: auto;
  border: 1.5px solid var(--tg-blue);
}
.tg__done-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.tg__done-actions .tg__stamp {
  font-size: 16px;
}
/* phones */
@media (max-width: 799px) {
  .tg__mast {
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 10px;
  }
  .tg__close {
    position: absolute;
    top: 10px;
    right: 12px;
  }
  .tg__title {
    font-size: 17px;
    letter-spacing: 0.2em;
    white-space: normal;
  }
  .tg__script {
    font-size: 20px;
  }
  .tg__terms p {
    padding-right: 12px;
  }
  .tg__postmark {
    display: none;
  }
}

/* =========================================================================
 * Booking form on blue card stock (mockups, ?paper=a|b|c|d). Grain and flecks
 * are cut from a photo of an old card; the warmth, wear and inks vary.
 * ====================================================================== */
html[data-paper] .tg {
  --card: #c9d0dd;
  --wear: rgba(246, 240, 226, 0.5);
  --tg-blue: #2b4f86;
  --tg-red: #b83d2f;
  --tg-ink: #1c2230;
  background:
    /* rubbed patch, top left */
    radial-gradient(ellipse 22% 14% at 18% 8%, var(--wear), transparent 70%),
    /* scuffed corners */
    radial-gradient(circle at 0 0, var(--wear), transparent 6%),
    radial-gradient(circle at 100% 0, var(--wear), transparent 5%),
    radial-gradient(circle at 0 100%, var(--wear), transparent 6%),
    radial-gradient(circle at 100% 100%, var(--wear), transparent 5%),
    /* fibre grain, then the card colour */
    url("card-grain.webp") 0 0 / 320px 320px,
    var(--card);
  background-blend-mode: screen, screen, screen, screen, screen, overlay, normal;
  /* the card's edge: slightly lighter, worn, with its thickness showing */
  box-shadow:
    inset 0 0 0 1.5px rgba(250, 246, 236, 0.5),
    inset 0 0 18px rgba(255, 250, 238, 0.18),
    0 1px 0 rgba(0, 0, 0, 0.25),
    0 30px 60px rgba(0, 0, 0, 0.45);
}
/* a: lightly warmed, close to the photo */
html[data-paper="a"] .tg {
  --card: #c9d0dd;
}
/* b: warmer, dustier grey-blue, as if it's sat under the lamp */
html[data-paper="b"] .tg {
  --card: #cdd0d6;
  --wear: rgba(248, 238, 214, 0.55);
  --tg-blue: #33507a;
}
/* c: lightly warmed but well handled: heavier rubbing and darker flecks */
html[data-paper="c"] .tg {
  --card: #c6cedc;
  --wear: rgba(248, 242, 226, 0.75);
}
html[data-paper="c"] .tg::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    url("card-specks.webp") 240px 380px / 520px 520px,
    radial-gradient(ellipse 30% 18% at 82% 92%, rgba(120, 100, 70, 0.08), transparent 70%);
  mix-blend-mode: multiply;
}
/* d: paler and warmer, almost a faded blue: telegraph-blue ink stays */
html[data-paper="d"] .tg {
  /* about 11% lighter than the first draft (#d5d8dd), still faintly blue */
  --card: var(--house-paper, #eaeef5);
  --wear: rgba(250, 244, 230, 0.55);
  --tg-blue: #3a62a0;
}

/* =========================================================================
 * Booking form type mixes (mockups, ?type=1|2|3): Gilroy for the printed
 * headings, the typewriter for the rest, and a faint printed-ink texture.
 * ====================================================================== */
html[data-type] .tg {
  --gil: "Gilroy", var(--font-dmsans), sans-serif;
  --tw: var(--tg-mono), "Courier New", monospace;
  /* fine, faint ink texture: the same speckle used on the site's headings */
  --print: url("ink.webp") 0 0 / 110px 110px;
}
/* every printed bit of text gets the faint texture (typed answers stay clean) */
html[data-type] :is(.tg__script, .tg__title, .tg__terms, .tg__patient, .tg__label, .tg__foot, .tg .hurt__title, .tg .hurt__picked, .tg__done-title, .tg__done-text, .tg__close) {
  -webkit-mask: var(--print);
  mask: var(--print);
}
/* the red items get the heavier stamped texture, like SEND */
html[data-type] .tg__patient {
  -webkit-mask: var(--grime) 0 0 / 120px 120px, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: var(--grime) 0 0 / 120px 120px exclude, linear-gradient(#000 0 0);
}

/* 1: Gilroy headings, everything else typewritten */
html[data-type="1"] .tg__title,
html[data-type="1"] .tg .hurt__title,
html[data-type="1"] .tg__done-title,
html[data-type="1"] .tg__foot {
  font-family: var(--gil);
  font-weight: 900;
  letter-spacing: 0.26em;
}
html[data-type="1"] :is(.tg__terms p, .tg__code, .tg__code i, .tg__patient span, .tg__label, .tg .hurt__picked, .tg__done-text) {
  font-family: var(--tw);
  font-style: normal;
}
html[data-type="1"] .tg__label {
  font-size: 14px;
  letter-spacing: 0.16em;
}
html[data-type="1"] .tg .hurt__picked {
  font-size: 14px;
}

/* 2: everything typewritten, Gilroy only for the main title */
html[data-type="2"] .tg__title {
  font-family: var(--gil);
  font-weight: 900;
  letter-spacing: 0.26em;
}
html[data-type="2"] :is(.tg .hurt__title, .tg__done-title, .tg__foot, .tg__terms p, .tg__code, .tg__code i, .tg__patient span, .tg__label, .tg .hurt__picked, .tg__done-text) {
  font-family: var(--tw);
  font-weight: 400;
  font-style: normal;
}
html[data-type="2"] .tg .hurt__title {
  font-size: clamp(16px, 1.5vw, 20px);
  letter-spacing: 0.24em;
}
html[data-type="2"] .tg__label {
  font-size: 14px;
  letter-spacing: 0.16em;
}
html[data-type="2"] .tg__foot {
  letter-spacing: 0.3em;
}

/* 3: Gilroy for titles and the printed labels; typewriter for anything filled in */
html[data-type="3"] :is(.tg__title, .tg .hurt__title, .tg__done-title, .tg__foot, .tg__label) {
  font-family: var(--gil);
  font-weight: 900;
  letter-spacing: 0.24em;
}
html[data-type="3"] .tg__label {
  font-size: 12px;
  letter-spacing: 0.2em;
}
html[data-type="3"] .tg__foot {
  font-weight: 700;
}
html[data-type="3"] :is(.tg__terms p, .tg__code, .tg__patient span, .tg .hurt__picked, .tg__done-text) {
  font-family: var(--tw);
  font-style: normal;
}
html[data-type="3"] .tg__code i {
  font-family: var(--gil);
  font-style: normal;
  font-weight: 700;
  font-size: 11px;
}

/* =========================================================================
 * Inked rules for the booking form (mockups, ?rule=a|b|c). <FormRules> draws
 * every ruled line once, at one width, on an SVG layer; the boxes' own borders
 * stay for layout but are hidden. The layer's filter blurs the ink only in
 * scattered patches: a noise pattern is the mask between a sharp copy and a
 * blurred copy.
 * ====================================================================== */
.tg__rules {
  display: none;
}
html[data-rule] .tg__rules {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;
  overflow: visible;
  stroke: var(--tg-blue);
}
html[data-rule] .tg :is(.tg__terms, .tg__code, .tg__table, .tg__patient, .tg__cell--chart, .tg__fields > .tg__cell + .tg__cell, .tg__receipt) {
  border-color: transparent;
}
html[data-rule="a"] .tg__rules {
  filter: url("#rule-a");
}
html[data-rule="b"] .tg__rules {
  filter: url("#rule-b");
}
html[data-rule="c"] .tg__rules {
  filter: url("#rule-c");
}

/* the field labels in bold, and the sample sentence in grey italics */
.tg .tg__label {
  font-weight: 700;
  color: var(--tg-red);
}
.tg__field input::placeholder,
.tg__field textarea::placeholder {
  color: rgba(70, 76, 92, 0.5);
  font-style: italic;
  opacity: 1;
}

/* =========================================================================
 * Inked text mockups for the booking form (?inktext=a|b|c): the outlines'
 * ink filter on the text too.
 * ====================================================================== */
html[data-inktext="a"] .tg :is(.tg__script, .tg__title, .tg__terms, .tg__patient, .tg__label, .tg__foot, .hurt__title, .hurt__picked, .hh__label, .tg__stamp, .tg__done-title, .tg__done-text) {
  filter: url("#ink-text-a");
}
html[data-inktext="b"] .tg :is(.tg__title, .tg__foot, .hurt__title, .tg__done-title) {
  filter: url("#ink-text-a");
}
html[data-inktext="b"] .tg :is(.tg__script, .tg__terms, .tg__patient, .tg__label, .hurt__picked, .hh__label, .tg__stamp, .tg__done-text) {
  filter: url("#ink-text-b");
}
html[data-inktext="c"] .tg :is(.tg__mast, .tg__terms, .tg__patient, .tg__field, .tg .hurt__title, .tg .hurt__picked, .hh__label, .tg__send, .tg__foot, .tg__done) {
  filter: url("#ink-text-a");
}

/* SEND: red ink; on hover it fills red (the stamp inked in) */
.tg__send .tg__stamp {
  border-color: var(--tg-red);
  color: var(--tg-red);
  transition:
    border-color 0.35s ease,
    color 0.35s ease,
    background-color 0.35s ease;
}
.tg__send .tg__stamp:hover:not(:disabled),
.tg__send .tg__stamp:focus-visible {
  background: var(--tg-red);
  color: var(--tg-paper);
}

/* colour swap: title in red, patient number in blue */
.tg .tg__title {
  color: var(--tg-red);
}
.tg .tg__patient {
  color: var(--tg-blue);
}

/* =========================================================================
 * Booking form, round 2: status under the head, fading sample text, black
 * hover on the stamps, and the receipt.
 * ====================================================================== */
/* zone name and ticked list sit under the head in a box of fixed height,
   so hovering or ticking never changes the form's size */
.tg .hh__status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  height: calc(1.6em + 3 * 1.4em + 6px);
  overflow: hidden;
  text-align: center;
}
.tg .hh__status .hh__label {
  min-height: 0;
  height: 1.6em;
  line-height: 1.6em;
  padding: 0;
  translate: none;
  white-space: nowrap;
}
.tg .hh__status .hurt__picked {
  min-height: 0;
  height: calc(3 * 1.4em);
  margin: 0;
  line-height: 1.4;
  font-size: clamp(13px, 1.15vw, 15.5px);
  overflow: hidden;
}

/* sample text: drawn under the field, fading slowly once typing starts */
.tg__write {
  position: relative;
  display: block;
}
.tg__ghost {
  position: absolute;
  left: 2px;
  right: 2px;
  top: 0;
  pointer-events: none;
  font-family: var(--tg-mono), monospace;
  font-size: 17px;
  font-style: italic;
  line-height: 38px;
  white-space: nowrap;
  overflow: hidden;
  color: rgba(70, 76, 92, 0.5);
  transition: opacity 1.6s ease-out;
}
.tg__ghost--long {
  line-height: 37px;
  white-space: normal;
}
.tg__write :is(input, textarea):not(:placeholder-shown) ~ .tg__ghost {
  opacity: 0;
}
/* the real placeholder is a blank space; keep it invisible */
.tg__write :is(input, textarea)::placeholder {
  color: transparent;
}

/* SEND and the receipt buttons: red ink at rest; on hover the stamp fills
   flat black with white lettering */
.tg__send .tg__stamp,
.tg__done-actions .tg__stamp {
  border-color: var(--tg-red);
  color: var(--tg-red);
  background-color: transparent;
  transition:
    border-color 0.35s ease,
    color 0.35s ease,
    background-color 0.35s ease;
}
.tg__send .tg__stamp:hover:not(:disabled),
.tg__send .tg__stamp:focus-visible,
.tg__done-actions .tg__stamp:hover,
.tg__done-actions .tg__stamp:focus-visible {
  border-color: #141414;
  background-color: #141414;
  color: #fff;
  -webkit-mask: none;
  mask: none;
}

/* the receipt: same form, everything centred, the head as the centrepiece */
.tg__mast--receipt {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  /* room for the close button, so it never sits on the script */
  padding-right: clamp(30px, 3vw, 44px);
}
.tg__mast--receipt .tg__script:first-child {
  justify-self: start;
}
.tg__mast--receipt .tg__script:nth-of-type(2) {
  justify-self: end;
}
.tg__mast--receipt .tg__title {
  text-align: center;
}
.tg__mast--receipt .tg__close {
  position: absolute;
  top: clamp(12px, 1.8vw, 22px);
  right: clamp(12px, 1.8vw, 24px);
}
.tg .tg__done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 22px 22px 26px;
  text-align: center;
}
.tg .tg__done-text {
  max-width: 54ch;
  margin: 0 auto;
  font-family: var(--tg-mono), monospace;
  font-size: 17px;
  line-height: 1.5;
  color: var(--tg-ink);
}
.dx-head {
  display: block;
  width: min(400px, 80%, 46vh);
  height: auto;
}
.dx-head__zone {
  fill: var(--tg-red, #c2483a);
  opacity: 0;
}
.dx-head__zone[data-on] {
  opacity: 0.55;
}
.tg__done-dx {
  font-family: var(--tg-serif), serif;
  font-style: italic;
  font-size: clamp(15px, 1.4vw, 18px);
  color: var(--tg-red);
}
.tg .tg__done-actions {
  justify-content: center;
}
@media (max-width: 799px) {
  .tg__mast--receipt {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .tg__mast--receipt .tg__script {
    justify-self: center !important;
  }
}
/* flat black on hover: drop the ink texture while it's filled */
html[data-inktext] .tg .tg__stamp:is(:hover, :focus-visible) {
  filter: none;
}

/* =========================================================================
 * Booking form, round 3: status above the head, sample text that fades on
 * click, the trimmed receipt and its copyable picture.
 * ====================================================================== */
/* above the head: the zone's name while hovering, the ticked list once
   something is ticked. Fixed height, so the form never changes size; the
   head simply sits lower to make room. */
.tg .hh__status {
  justify-content: flex-start;
  gap: 6px;
  margin-bottom: 6px;
}
.tg .hh__status .hurt__picked {
  order: -1;
  height: auto;
  max-height: calc(3 * 1.4em);
  visibility: hidden;
}
.tg .hh__status .hurt__picked[data-on] {
  visibility: visible;
}
/* the form itself takes focus on open; no ring round the whole sheet */
.tg:focus {
  outline: none;
}
/* sample text starts fading the moment the field is clicked */
.tg__write :is(input, textarea):focus ~ .tg__ghost {
  opacity: 0;
}

/* buttons: on hover a plain flat black, no ink texture or grain at all */
.tg .tg__send .tg__stamp:is(:hover:not(:disabled), :focus-visible),
.tg .tg__done-actions .tg__stamp:is(:hover, :focus-visible) {
  filter: none !important;
  -webkit-mask: none !important;
  mask: none !important;
  mix-blend-mode: normal;
  background-image: none;
}

/* the receipt: only the blue frame, centred */
.tg__receipt {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 1.6vh, 16px);
  padding: clamp(22px, 3.4vh, 38px) clamp(18px, 3vw, 48px) clamp(20px, 3vh, 32px);
  border: 1.5px solid var(--tg-blue);
  text-align: center;
}
.tg__receipt .tg__close {
  position: absolute;
  top: 10px;
  right: 14px;
  margin: 0;
}
.tg__receipt .tg__title {
  white-space: normal;
}
.tg__receipt .tg__done-text {
  max-width: 54ch;
  margin: 0 auto;
  font-family: var(--tg-mono), monospace;
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.5;
  color: var(--tg-ink);
}
.tg__receipt .tg__done-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 4px;
}
.tg__receipt .tg__done-actions .tg__stamp {
  font-size: 16px;
}

/* the picture: hover shows a black COPY bar across it */
.tg__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.tg__copy-btn {
  position: relative;
  display: block;
  width: min(380px, 70vw, 44svh);
  cursor: copy;
}
.tg__copy-btn img {
  display: block;
  width: 100%;
  height: auto;
}
.tg__copy-bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  translate: 0 -50%;
  padding: 12px 0 10px;
  background: #141414;
  font-family: var(--font-heavy);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.tg__copy-btn:is(:hover, :focus-visible) .tg__copy-bar,
.tg__copy[data-state="copied"] .tg__copy-bar {
  opacity: 1;
}
.tg__copy-btn:focus-visible {
  outline: 2px dashed var(--tg-ink);
  outline-offset: 4px;
}
.tg__copy-hint {
  font-family: var(--tg-mono), monospace;
  font-size: 13px;
  font-style: italic;
  color: rgba(70, 76, 92, 0.75);
}

/* receipt options. a: the picture as a card lying on the form */
html[data-receipt="a"] .tg__copy-btn {
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.08),
    0 6px 14px rgba(20, 30, 50, 0.16);
}
/* b: seamless; the picture's paper melts into the form, a little larger */
html[data-receipt="b"] .tg__copy-btn {
  width: min(430px, 76vw, 50svh);
}

/* c: a photo print taped on at a slight angle */
html[data-receipt="c"] .tg__copy-btn {
  padding: 10px 10px 34px;
  background: #fbfaf6;
  rotate: -2.2deg;
  box-shadow:
    0 2px 3px rgba(0, 0, 0, 0.12),
    0 12px 26px rgba(20, 30, 50, 0.22);
  margin-top: 8px;
}
html[data-receipt="c"] .tg__copy-btn::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: 50%;
  top: -12px;
  width: 104px;
  height: 26px;
  translate: -50% 0;
  rotate: 3deg;
  background: rgba(236, 226, 196, 0.72);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}



/* the diagnosis link: the picture opens it, the box copies it */
a.tg__done-dx { display: block; text-decoration: none; transition: transform 0.2s; }
a.tg__done-dx:hover { transform: rotate(-1.5deg) scale(1.02); }
.tg__share { display: flex; gap: 10px; align-items: stretch; width: min(520px, 100%); }
.tg__share-link {
  flex: 1; min-width: 0; padding: 8px 10px; border: 1.5px solid var(--tg-blue, #3a62a0); background: rgba(255, 255, 255, 0.45);
  font-family: var(--tg-mono), monospace; font-size: 14px; color: var(--tg-ink); border-radius: 0;
}
.tg__share .tg__stamp { white-space: nowrap; }
.tg__share-hint { margin: 0; font-family: var(--tg-mono), monospace; font-size: 13px; color: var(--tg-ink); opacity: 0.75; }

/* =========================================================================
 * Booking form, 2026-11-12: the head sits centred in its box. The zone's name
 * (while hovering) and the ticked list (otherwise) share one slot just above
 * the head, so the form keeps one size and the head no longer sits low.
 * ====================================================================== */
@media (min-width: 800px) {
  .tg__cell--chart { align-items: stretch; }
  .tg .hurt { display: flex; flex-direction: column; align-items: center; width: 100%; }
  .tg .hurt > .hurt__title { align-self: stretch; }
  .tg .hh__status { display: grid; align-items: end; justify-items: center; height: 46px; margin: auto 0 6px; }
  .tg .hh__status > * { grid-area: 1 / 1; }
  .tg .hh__status { align-self: stretch; grid-template-columns: 100%; }
  .tg .hh__status .hh__label { justify-self: center; text-align: center; }
  .tg .hh__status .hurt__picked { max-height: none; text-align: center; }
  .tg .hh__status:has(.hh__label[data-on]) .hurt__picked { visibility: hidden; }
  .tg .hurt > .hh { margin-bottom: auto; }
}

/* SEND (2026-11-12): no box, just the word, set exactly like the form's header ("Book your medical appointment"):
   Gilroy 900 in capitals, the same size and spacing, the form's red, the same ink filter and printed speckle mask.
   Hovered or pressed, the ink turns black (texture kept). */
.tg .tg__send .tg__stamp,
.tg .tg__send .tg__stamp:is(:hover, :focus-visible, :active, :disabled) {
  padding: 4px 0 2px !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  font-family: var(--gil), "Gilroy", sans-serif !important;
  font-weight: 900 !important;
  font-size: clamp(18px, 2.1vw, 30px) !important;
  line-height: 1 !important;
  letter-spacing: 0.26em !important;
  text-transform: uppercase;
  color: #b83d2f !important; /* the header's red, as it prints */
  -webkit-text-fill-color: currentColor;
  filter: url("#ink-text-a") !important;
  -webkit-mask: url("ink.webp") 0 0 / 110px 110px !important;
  mask: url("ink.webp") 0 0 / 110px 110px !important;
  mix-blend-mode: normal !important;
  transition: color 0.3s ease !important;
  cursor: pointer;
}
.tg .tg__send .tg__stamp:is(:hover:not(:disabled), :focus-visible, :active) { color: #141414 !important; }
/* touch screens (2026-11-12): a tap leaves the button "hovered", so there it only goes black while pressed */
@media (hover: none) {
  .tg .tg__send .tg__stamp:hover:not(:active, :focus-visible) { color: #b83d2f !important; }
}
.tg .tg__send .tg__stamp:focus-visible { outline: none; text-decoration: underline 2px; text-underline-offset: 6px; }
.tg .tg__send .tg__stamp:disabled { opacity: 0.5; cursor: default; }
@media (max-width: 799px) {
  .tg .tg__send .tg__stamp, .tg .tg__send .tg__stamp:is(:hover, :focus-visible, :active, :disabled) { font-size: 17px !important; letter-spacing: 0.2em !important; }
}

/* =========================================================================
 * Phones (2026-11-12): the form is the whole screen, like About and the
 * category pages: no margin round the sheet, no shadow, and it scrolls with
 * the page itself rather than inside a box of its own (which read as cut off).
 * ====================================================================== */
@media (max-width: 799px), (max-height: 500px) and (pointer: coarse) {
  .overlay.overlay--tg { align-items: flex-start !important; padding: 0 0 var(--ticker-h, 24px) !important; }
  .overlay--tg > .tg { width: 100% !important; max-width: none !important; max-height: none !important; min-height: 100%;
    overflow: visible !important; margin: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
}
