/*
 * The Presskit Timer Demo (TimerDemoWidget): the timer page's live demos.
 *
 * Ported from the page's prototype (T-1233 a2), which is the record for the look.
 * Every rule is scoped under `.pk-timer-demo`, the root each stage prints, and
 * names the element under it (`.pk-timer-demo .screen`, never a lone `.screen`),
 * so neither Elementor's per-element CSS nor the theme's reset reaches inside and
 * nothing here leaks out. Hello Elementor's reset colours every button pink on
 * hover and focus and shows a `hidden` button; the button rules below state their
 * hover and focus, and `[hidden]` is held hidden, for that reason.
 *
 * Colour and type are the site's: the `--pk-site-*` tokens (presskit-site.css)
 * are read here and never redefined. The screens are the timer's own: `--s-*`
 * tokens, light by default and dark on `data-theme="dark"`, scoped to the screen.
 * A screen is drawn in container units of its own box, as the timer's display is,
 * so it is the same picture at any size.
 *
 * The seven extra faces below are the timer's Latin woff2, copied as they are
 * (assets/licenses/README.md). A browser fetches one only when text asks for it,
 * which on presskit.live is the faces demo and the brand pair's Barlow Condensed.
 * IBM Plex Sans and Mono are the site's own (presskit-site-fonts.css). Nothing
 * here is fetched from a font service.
 *
 * Depends on `presskit-site-fonts` and on `presskit-site-logo`, whose mark sits in
 * the controller's bar and on the pairing TV.
 */

/* ── The seven faces, at the timer's weights (timer/web/fonts.css) ── */

@font-face {
  font-family: 'Inter';
  src: url(../fonts/inter-latin-500-normal.woff2) format('woff2');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

/* Atkinson Hyperlegible has no 500; its 700 serves, which a 500 asks for. */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url(../fonts/atkinson-hyperlegible-latin-700-normal.woff2) format('woff2');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Montserrat';
  src: url(../fonts/montserrat-latin-500-normal.woff2) format('woff2');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'Barlow Condensed';
  src: url(../fonts/barlow-condensed-latin-500-normal.woff2) format('woff2');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'Manrope';
  src: url(../fonts/manrope-latin-500-normal.woff2) format('woff2');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'Source Sans 3';
  src: url(../fonts/source-sans-3-latin-500-normal.woff2) format('woff2');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url(../fonts/jetbrains-mono-latin-500-normal.woff2) format('woff2');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

/* ── The root: the site's tokens, read; the demo's own two ── */

.pk-timer-demo {
  --pk-timer-paper: var(--pk-site-paper, #fbfbf9);
  --pk-timer-ink: var(--pk-site-ink, #1d1d1b);
  --pk-timer-ink-2: var(--pk-site-ink-2, #6b6b66);
  --pk-timer-rule: var(--pk-site-rule, #e4e4df);
  --pk-timer-well: var(--pk-site-well, #f1f1ec);
  --pk-timer-mono: var(--pk-site-mono, 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  --pk-timer-sans: var(--pk-site-sans, 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif);
  --pk-timer-card: #ffffff;
  --pk-timer-ok: #15803d;
  /* The demo takes its width from where it is placed and never offers one of its
     own. Without this, a demo inside a box that sizes to its content (a centred
     max-width box in the site's flex-column body, say) asks every size-contained
     screen and grid inside for an intrinsic width on each tick, and headless
     Chrome hung and crashed on it with two stages on one page (T-1230 log). The
     cost: placed in an Elementor row container, the widget needs a width (its
     Advanced tab, or Full Width) as any width-less element would. */
  contain: inline-size;
  min-width: 0;
  color: var(--pk-timer-ink);
  font-family: var(--pk-timer-sans);
  line-height: 1.55;
}

.pk-timer-demo,
.pk-timer-demo *,
.pk-timer-demo *::before,
.pk-timer-demo *::after {
  box-sizing: border-box;
}

.pk-timer-demo p {
  margin: 0;
}

.pk-timer-demo [hidden] {
  display: none !important;
}

.pk-timer-demo :focus-visible {
  outline: 2px solid var(--pk-timer-ink);
  outline-offset: 2px;
  border-radius: 2px;
}

.pk-timer-demo .muted {
  color: var(--pk-timer-ink-2);
}

.pk-timer-demo .small {
  font-size: 0.9375rem;
}

.pk-timer-demo .measure {
  max-width: 34em;
}

/* ── Buttons, in the timer's three voices ── */

.pk-timer-demo .btn {
  appearance: none;
  font: inherit;
  font-family: var(--pk-timer-sans);
  font-weight: 500;
  font-size: 0.9375rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  color: var(--pk-timer-ink);
  background: transparent;
  border: 1px solid var(--pk-timer-ink);
  transition: background 160ms, color 160ms, transform 160ms;
}

.pk-timer-demo .btn:focus {
  background: transparent;
  color: var(--pk-timer-ink);
}

.pk-timer-demo .btn:hover {
  background: var(--pk-timer-well);
  color: var(--pk-timer-ink);
}

.pk-timer-demo .btn--primary,
.pk-timer-demo .btn--primary:focus {
  background: var(--pk-timer-ink);
  color: #fff;
  border-color: var(--pk-timer-ink);
}

.pk-timer-demo .btn--primary:hover {
  background: #000;
  color: #fff;
}

.pk-timer-demo .btn--wide {
  width: 100%;
}

.pk-timer-demo .btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ── The stage: a screen and the controller beside it ── */

.pk-timer-demo .stage {
  display: grid;
  gap: 20px;
  align-items: start;
}

@media (min-width: 900px) {
  .pk-timer-demo .stage {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

.pk-timer-demo .stage__note {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 0.9375rem;
  color: var(--pk-timer-ink-2);
}

.pk-timer-demo .stage__note button,
.pk-timer-demo .stage__note button:hover,
.pk-timer-demo .stage__note button:focus {
  appearance: none;
  font: inherit;
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: var(--pk-timer-ink);
  text-decoration: underline;
  text-underline-offset: 0.16em;
  cursor: pointer;
}

/* ── A viewer screen: the timer's display, in container units of its own box ── */

.pk-timer-demo .screen {
  --s-bg: #ffffff;
  --s-ink: #272525;
  --s-muted: #6b6764;
  --s-line: #e7e5e4;
  --s-over: #b91c1c;
  --s-warn: #b45309;
  --cells: 4.6;
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  container-type: size;
  overflow: hidden;
  border-radius: 10px;
  background: var(--s-bg);
  color: var(--s-ink);
  font-family: var(--display-font, var(--pk-timer-sans));
  font-weight: 500;
  line-height: 1.2;
  box-shadow: 0 0 0 1px var(--pk-timer-rule);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* The screen is the query container and a container cannot query itself, so its
     own padding in cq units resolved against the viewport (36px on a 900px window)
     and shrank everything inside. 2.25% of the width is 4cqh at 16:9; the 4cqh gap
     lives on the message, a child, instead (T-1232). */
  padding: 2.25% 3%;
  text-align: center;
  transition: background 0.3s, color 0.3s;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}

.pk-timer-demo .screen[data-theme='dark'] {
  --s-bg: #151414;
  --s-ink: #eeeeee;
  --s-muted: #a5a29f;
  --s-line: #333131;
  --s-over: #f87171;
  --s-warn: #fbbf24;
}

.pk-timer-demo .screen__event,
.pk-timer-demo .screen__clock {
  position: absolute;
  top: 3.6cqh;
  margin: 0;
  display: none;
  font-size: min(3.2cqw, 5.2cqh);
  line-height: 1.2;
  color: var(--s-muted);
}

.pk-timer-demo .screen__event {
  left: 3.4cqw;
  top: calc(3.6cqh - 0.1em);
  max-width: 40cqw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.pk-timer-demo .screen__clock {
  right: 3.4cqw;
  line-height: 1;
}

.pk-timer-demo .screen[data-event] .screen__event,
.pk-timer-demo .screen[data-clock] .screen__clock {
  display: block;
}

.pk-timer-demo .screen__name {
  display: none;
  max-width: 88cqw;
  font-size: min(9cqw, 15cqh);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.pk-timer-demo .screen[data-status='idle'] .screen__name {
  display: block;
}

.pk-timer-demo .screen[data-status='idle'][data-has-message] .screen__name {
  font-size: min(7cqw, 11cqh);
}

/* The workspace's logo between sessions, in place of its name (display.ts: 66cqw × 46cqh, 32cqh with a message). */
.pk-timer-demo .screen__logo {
  display: none;
  width: 66cqw;
  height: 46cqh;
  color: var(--s-ink);
}

.pk-timer-demo .screen__logo svg {
  display: block;
  width: 100%;
  height: 100%;
}

.pk-timer-demo .screen[data-logo][data-status='idle'] .screen__logo {
  display: block;
}

.pk-timer-demo .screen[data-logo][data-status='idle'] .screen__name {
  display: none;
}

.pk-timer-demo .screen[data-logo][data-status='idle'][data-has-message] .screen__logo {
  height: 32cqh;
}

.pk-timer-demo .screen__time {
  position: relative;
  display: none;
  font-size: min(calc(96cqw / var(--cells)), 62cqh);
  line-height: 1;
  white-space: nowrap;
  transition: color 0.3s;
}

.pk-timer-demo .screen[data-has-message] .screen__time {
  font-size: min(calc(96cqw / var(--cells)), 44cqh);
}

.pk-timer-demo .screen:is([data-status='running'], [data-status='paused']) .screen__time {
  display: block;
}

.pk-timer-demo .screen__label {
  position: absolute;
  bottom: 100%;
  left: 50%;
  display: none;
  padding-left: 0.3em;
  font-size: 0.1em;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--s-muted);
  transform: translate(-50%, -0.6em);
}

.pk-timer-demo .screen[data-status='paused'] .screen__label {
  display: block;
}

.pk-timer-demo .screen[data-status='paused'] .screen__reading {
  opacity: 0.38;
}

.pk-timer-demo .screen[data-warning] .screen__time {
  color: var(--s-warn);
}

.pk-timer-demo .screen[data-overtime] .screen__time {
  color: var(--s-over);
}

.pk-timer-demo .screen__message {
  margin: 0;
  max-width: 88cqw;
  font-size: min(5.4cqw, 7.5cqh);
  line-height: 1.2;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.pk-timer-demo .screen__message:not(:empty) {
  margin-top: 4cqh;
}

.pk-timer-demo .screen__message:empty {
  display: none;
}

.pk-timer-demo .screen__strip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  height: max(3px, 1.5cqh);
  background: var(--s-line);
}

.pk-timer-demo .screen[data-progress]:is([data-status='running'], [data-status='paused']) .screen__strip {
  display: block;
}

.pk-timer-demo .screen__fill {
  display: block;
  height: 100%;
  background: var(--s-muted);
  transform: scaleX(0);
  transform-origin: left center;
  transition: background 0.3s;
}

.pk-timer-demo .screen[data-status='paused'] .screen__fill {
  opacity: 0.38;
}

.pk-timer-demo .screen[data-warning] .screen__fill {
  background: var(--s-warn);
}

.pk-timer-demo .screen[data-overtime] .screen__fill {
  background: var(--s-over);
}

.pk-timer-demo .screen__rain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.pk-timer-demo .screen__rain img {
  position: absolute;
  max-width: none;
  will-change: transform, opacity;
}

/* A paired TV before it has a room, and the moment it gets one. */
.pk-timer-demo .screen__pair {
  position: absolute;
  inset: 0;
  display: none;
}

.pk-timer-demo .screen[data-pair='code'] .screen__pair--code,
.pk-timer-demo .screen[data-pair='paired'] .screen__pair--paired {
  display: block;
}

/* The room's logo waits behind the pairing card until the card goes; the
   prototype (a2) drew the two on top of each other. Named with `[data-logo]` so
   it outranks the idle-logo rule above. */
.pk-timer-demo .screen[data-pair] .screen__name,
.pk-timer-demo .screen[data-pair][data-logo] .screen__logo,
.pk-timer-demo .screen[data-pair] .screen__event,
.pk-timer-demo .screen[data-pair] .screen__clock {
  display: none;
}

.pk-timer-demo .pt__brand {
  position: absolute;
  top: 6cqh;
  left: 4.5cqw;
  display: flex;
  align-items: center;
  gap: 1.6cqw;
  font-size: 4.2cqh;
  color: var(--s-muted);
}

.pk-timer-demo .pt__brand .pk-site-logo {
  --pk-site-logo-size: 6.4cqh;
}

.pk-timer-demo .pt__body {
  position: absolute;
  left: 4.5cqw;
  top: 50%;
  transform: translateY(-50%);
  width: 56cqw;
  display: grid;
  gap: 2.6cqh;
  text-align: left;
}

.pk-timer-demo .pt__label {
  font-size: 5.4cqh;
}

.pk-timer-demo .pt__code {
  font-family: var(--pk-timer-mono);
  font-size: 16cqh;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1;
}

.pk-timer-demo .pt__how {
  font-size: 4.4cqh;
  line-height: 1.35;
  color: var(--s-muted);
}

.pk-timer-demo .pt__how b {
  color: var(--s-ink);
  font-weight: 500;
}

.pk-timer-demo .pt__qr {
  position: absolute;
  right: 6cqw;
  top: 50%;
  transform: translateY(-50%);
  width: 40cqh;
  height: 40cqh;
  border-radius: 1.4cqh;
}

.pk-timer-demo .pt__foot {
  position: absolute;
  left: 4.5cqw;
  bottom: 6cqh;
  margin: 0;
  font-size: 4.2cqh;
  color: var(--s-muted);
}

.pk-timer-demo .pt__paired {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 6cqw;
  font-size: 6.4cqh;
}

/* ── The controller ── */

.pk-timer-demo .ctl {
  background: var(--pk-timer-card);
  border: 1px solid var(--pk-timer-rule);
  border-radius: 10px;
  padding: 16px;
  display: grid;
  gap: 16px;
  min-width: 0;
  margin: 0;
}

.pk-timer-demo .ctl__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--pk-timer-rule);
  font-size: 0.8125rem;
}

.pk-timer-demo .ctl__bar .pk-site-logo {
  --pk-site-logo-size: 22px;
}

.pk-timer-demo .ctl__bar .pk-site-logo-wrap {
  flex: none;
}

.pk-timer-demo .ctl__bar b {
  font-family: var(--pk-timer-mono);
  font-weight: 500;
}

.pk-timer-demo .ctl__bar .where {
  color: var(--pk-timer-ink-2);
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pk-timer-demo .ctl__bar .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pk-timer-ok);
  flex: none;
}

.pk-timer-demo .ctl__group {
  display: grid;
  gap: 8px;
}

.pk-timer-demo .ctl__label {
  font-family: var(--pk-timer-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pk-timer-ink-2);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.pk-timer-demo .ctl__label output {
  font-family: var(--pk-timer-mono);
  color: var(--pk-timer-ink);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.pk-timer-demo .ctl__hint {
  color: var(--pk-timer-ink-2);
  text-transform: none;
  letter-spacing: 0;
}

.pk-timer-demo .seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--pk-timer-ink);
  border-radius: 8px;
  overflow: hidden;
}

.pk-timer-demo .seg--3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.pk-timer-demo .seg button,
.pk-timer-demo .seg button:hover,
.pk-timer-demo .seg button:focus {
  appearance: none;
  font: inherit;
  font-weight: 500;
  font-size: 0.9rem;
  height: 36px;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--pk-timer-ink);
  cursor: pointer;
  transition: background 160ms, color 160ms;
}

.pk-timer-demo .seg button[aria-pressed='true'] {
  background: var(--pk-timer-ink);
  color: #fff;
}

.pk-timer-demo .seg button:disabled {
  cursor: default;
  opacity: 0.45;
}

.pk-timer-demo .seg button[aria-pressed='true']:disabled {
  opacity: 1;
}

.pk-timer-demo .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pk-timer-demo .chip,
.pk-timer-demo .chip:hover,
.pk-timer-demo .chip:focus {
  appearance: none;
  font: inherit;
  font-family: var(--pk-timer-mono);
  font-size: 0.8rem;
  line-height: 1;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--pk-timer-rule);
  background: transparent;
  color: var(--pk-timer-ink);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: background 160ms, color 160ms, border-color 160ms;
}

.pk-timer-demo .chip[aria-pressed='true'] {
  border-color: var(--pk-timer-ink);
  background: var(--pk-timer-well);
}

.pk-timer-demo .chip:disabled {
  opacity: 0.45;
  cursor: default;
}

.pk-timer-demo .transport {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.pk-timer-demo .transport .btn {
  padding: 0 8px;
}

.pk-timer-demo .adjust {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pk-timer-demo .ctl .btn {
  height: 36px;
  font-size: 0.9rem;
}

.pk-timer-demo .msg {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
}

.pk-timer-demo .msg input {
  font: inherit;
  font-size: 0.9rem;
  height: 36px;
  width: 100%;
  padding: 0 10px;
  border: 1px solid var(--pk-timer-rule);
  border-radius: 8px;
  background: var(--pk-timer-paper);
  color: var(--pk-timer-ink);
  min-width: 0;
}

.pk-timer-demo .msg input:focus {
  border-color: var(--pk-timer-ink);
  outline: none;
}

.pk-timer-demo .msg .btn {
  padding: 0 10px;
}

.pk-timer-demo .reacts {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.pk-timer-demo .react,
.pk-timer-demo .react:focus {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  padding: 4px;
  cursor: pointer;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  transition: background 160ms, transform 160ms;
}

.pk-timer-demo .react:hover {
  background: var(--pk-timer-well);
}

.pk-timer-demo .react img {
  width: 100%;
  height: auto;
  display: block;
}

.pk-timer-demo .switches {
  display: grid;
  gap: 6px;
}

.pk-timer-demo .switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
  line-height: inherit;
  cursor: pointer;
}

.pk-timer-demo .switch input {
  appearance: none;
  width: 34px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  background: var(--pk-timer-rule);
  position: relative;
  flex: none;
  cursor: pointer;
  transition: background 160ms;
  margin: 0;
  padding: 0;
}

.pk-timer-demo .switch input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 25%);
  transition: transform 160ms;
}

.pk-timer-demo .switch input:checked {
  background: var(--pk-timer-ink);
}

.pk-timer-demo .switch input:checked::after {
  transform: translateX(14px);
}

/* A button the script "presses", and one a visitor presses: after every state above. */
.pk-timer-demo .btn.is-pressed,
.pk-timer-demo .chip.is-pressed,
.pk-timer-demo .seg button.is-pressed {
  background: var(--pk-timer-ink);
  color: #fff;
  border-color: var(--pk-timer-ink);
  transform: scale(0.97);
}

.pk-timer-demo .btn--primary.is-pressed {
  background: #000;
}

.pk-timer-demo .btn:disabled.is-pressed {
  opacity: 1;
}

.pk-timer-demo .react.is-pressed {
  background: var(--pk-timer-well);
  border-color: var(--pk-timer-ink);
  transform: scale(0.97);
}

/* ── Rows of screens ── */

.pk-timer-demo .frames {
  display: grid;
  gap: 20px 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.pk-timer-demo .frame {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.pk-timer-demo .frame p {
  font-size: 0.9375rem;
  line-height: 1.45;
}

.pk-timer-demo .frame b {
  display: block;
  font-weight: 600;
}

.pk-timer-demo .trio {
  display: grid;
  gap: 16px;
}

@media (min-width: 700px) {
  .pk-timer-demo .trio {
    grid-template-columns: 1.4fr 1fr 0.8fr;
    align-items: end;
  }
}

.pk-timer-demo .pair-screens {
  display: grid;
  gap: 16px;
}

@media (min-width: 700px) {
  .pk-timer-demo .pair-screens {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Pairing ── */

.pk-timer-demo .pairing {
  display: grid;
  gap: 20px;
  align-items: center;
}

@media (min-width: 820px) {
  .pk-timer-demo .pairing {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}

.pk-timer-demo .pairing + .measure {
  margin-top: 24px;
}

.pk-timer-demo .phone {
  border: 1px solid var(--pk-timer-rule);
  border-radius: 22px;
  background: var(--pk-timer-card);
  padding: 14px 16px 18px;
  display: grid;
  gap: 10px;
  max-width: 300px;
  width: 100%;
  justify-self: center;
  font-size: 0.875rem;
}

.pk-timer-demo .phone__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--pk-timer-ink-2);
  font-size: 0.75rem;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--pk-timer-rule);
}

.pk-timer-demo .phone__bar b {
  font-family: var(--pk-timer-mono);
  font-weight: 500;
}

.pk-timer-demo .phone__me {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--pk-timer-well);
  border: 1px solid var(--pk-timer-rule);
}

.pk-timer-demo .phone__title {
  margin: 4px 0 0;
  font-weight: 600;
  font-size: 1.0625rem;
}

.pk-timer-demo .phone__row {
  display: grid;
  gap: 4px;
  color: var(--pk-timer-ink-2);
  font-size: 0.75rem;
}

.pk-timer-demo .phone__field {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--pk-timer-rule);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--pk-timer-ink);
  font-size: 0.875rem;
  background: var(--pk-timer-paper);
}

.pk-timer-demo .phone__field svg {
  align-self: center;
}

.pk-timer-demo .phone__field .mono {
  font-family: var(--pk-timer-mono);
}

.pk-timer-demo .phone__note {
  margin: 0;
  color: var(--pk-timer-ink-2);
  font-size: 0.75rem;
  line-height: 1.45;
}

.pk-timer-demo .phone__note--done {
  font-size: 0.875rem;
  color: var(--pk-timer-ink);
}

.pk-timer-demo .phone [data-view] {
  display: none;
}

.pk-timer-demo .phone[data-state='form'] [data-view='form'],
.pk-timer-demo .phone[data-state='done'] [data-view='done'] {
  display: grid;
  gap: 10px;
}

.pk-timer-demo .phone__done {
  display: grid;
  gap: 10px;
}

.pk-timer-demo .phone__done .btn {
  width: 100%;
}

/* ── Faces ── */

.pk-timer-demo .specimens {
  display: grid;
  gap: 1px;
  background: var(--pk-timer-rule);
  border: 1px solid var(--pk-timer-rule);
  border-radius: 8px;
  overflow: hidden;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 860px) {
  .pk-timer-demo .specimens {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.pk-timer-demo .specimen {
  background: var(--pk-timer-paper);
  padding: 16px;
  display: grid;
  gap: 6px;
  align-content: start;
  min-width: 0;
}

.pk-timer-demo .specimen__digits {
  font-size: clamp(2.1rem, 4.6vw, 2.9rem);
  line-height: 1;
  font-weight: 500;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  white-space: nowrap;
}

.pk-timer-demo .specimen__name {
  font-weight: 600;
  font-size: 0.9375rem;
}

.pk-timer-demo .specimen__note {
  font-size: 0.8rem;
  color: var(--pk-timer-ink-2);
  line-height: 1.4;
}

.pk-timer-demo .f-plex { font-family: 'IBM Plex Sans', system-ui, sans-serif; }
.pk-timer-demo .f-inter { font-family: 'Inter', system-ui, sans-serif; }
.pk-timer-demo .f-atkinson { font-family: 'Atkinson Hyperlegible', system-ui, sans-serif; }
.pk-timer-demo .f-montserrat { font-family: 'Montserrat', system-ui, sans-serif; }
.pk-timer-demo .f-barlow { font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; }
.pk-timer-demo .f-manrope { font-family: 'Manrope', system-ui, sans-serif; }
.pk-timer-demo .f-source { font-family: 'Source Sans 3', system-ui, sans-serif; }
.pk-timer-demo .f-jetbrains { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* ── The address ── */

.pk-timer-demo .access__addr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.pk-timer-demo .access__addr .addr {
  font-family: var(--pk-timer-mono);
  font-weight: 600;
  font-size: clamp(1.3rem, 3.6vw, 2rem);
  letter-spacing: -0.01em;
  -webkit-user-select: all;
  user-select: all;
  overflow-wrap: anywhere;
}

.pk-timer-demo .copied {
  font-family: var(--pk-timer-mono);
  font-size: 0.85rem;
  color: var(--pk-timer-ok);
}

/* ── Reduced motion: no travel, no fades between states; the script draws stills ── */

@media (prefers-reduced-motion: reduce) {
  .pk-timer-demo .btn,
  .pk-timer-demo .chip,
  .pk-timer-demo .seg button,
  .pk-timer-demo .react {
    transition: none;
  }
}

/* The message stage's card holds the whole controller bar, so its column is the hero's 320px (T-1238). */
@media (min-width: 820px) {
  .pk-timer-demo .pairing--wide {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}
