  /* staff.djshazam.com: the staff time clock. Built on the Coastal Evergreen tokens; layout glue uses tokens only. */
  * { box-sizing: border-box; }
  html, body { margin: 0; height: 100%; }
  body {
    background: var(--bg-dark);
    color: var(--text-on-dark);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
  }
  button { font: inherit; color: inherit; }

  /* --- App column: full screen on a phone, a phone-width column on desktop --- */
  .app {
    max-width: 440px; margin: 0 auto;
    min-height: 100vh; min-height: 100dvh;
    display: grid; grid-template-rows: auto 1fr auto;
    padding: env(safe-area-inset-top) 0 0;
  }
  .bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid rgba(231, 222, 211, 0.12);
  }
  .bar img { height: 26px; width: auto; display: block; }
  .bar__who {
    background: none; border: 0; padding: var(--space-2) 0 var(--space-2) var(--space-4);
    font-size: var(--text-caption); font-weight: var(--weight-medium); color: var(--c-mist);
    cursor: pointer; min-height: 44px;
  }
  .bar__who:focus-visible, .row:focus-visible, .punch:focus-visible, .toast button:focus-visible, .gate button:focus-visible {
    outline: var(--focus-width) solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm);
  }

  .scroll { overflow-y: auto; padding: 0 var(--space-5); }

  /* --- Status: the one thing to read at a glance --- */
  .status { padding: var(--space-8) 0 var(--space-6); }
  .status__line {
    display: flex; align-items: center; gap: var(--space-2);
    font-size: var(--text-body); font-weight: var(--weight-medium); margin: 0 0 var(--space-3);
  }
  .dot { width: 10px; height: 10px; border-radius: var(--radius-full); flex: none;
    border: 1.5px solid rgba(231, 222, 211, 0.5); }
  .is-on .dot { background: var(--c-mist); border-color: var(--c-mist); }

  .clock {
    font-family: var(--font-head); font-weight: var(--weight-bold);
    font-variant-numeric: lining-nums tabular-nums;
    font-size: clamp(4.5rem, 24vw, 6.5rem); line-height: 0.95; letter-spacing: -0.02em;
    margin: 0;
  }
  .clock small {
    font-family: var(--font-body); font-weight: var(--weight-medium);
    font-size: 0.26em; letter-spacing: 0; color: var(--c-mist); margin-left: 0.15em;
  }
  .status__sub { margin: var(--space-3) 0 0; font-size: var(--text-body); color: rgba(231, 222, 211, 0.78); }

  .note {
    margin: var(--space-5) 0 0; padding: var(--space-3) var(--space-4);
    border-left: 2px solid var(--c-mist);
    background: rgba(127, 166, 182, 0.08);
    font-size: 0.9375rem; line-height: 1.45; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  }
  .note--due { border-left-color: var(--c-coral-base); background: rgba(201, 122, 106, 0.10); }
  .note strong { font-weight: var(--weight-semibold); }

  /* --- Today's punches --- */
  .today { padding: var(--space-4) 0 var(--space-6); border-top: 1px solid rgba(231, 222, 211, 0.12); }
  .today__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--space-2); }
  .today__head h2 { font-family: var(--font-body); font-size: var(--text-caption); font-weight: var(--weight-semibold); margin: 0; color: var(--c-mist); }
  .today__head span { font-size: var(--text-caption); font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }
  .log { list-style: none; margin: 0; padding: 0; }
  .log li {
    display: grid; grid-template-columns: 5.25rem 1fr auto; gap: var(--space-3); align-items: baseline;
    padding: var(--space-2) 0; font-size: 0.9375rem; font-variant-numeric: tabular-nums;
  }
  .log time { font-weight: var(--weight-semibold); }
  .log .dur { color: rgba(231, 222, 211, 0.7); font-size: var(--text-caption); }
  .log .gap { color: var(--c-mist); }
  .log .gap.short .dur, .log .gap.short span { color: var(--c-coral-base); }
  .empty { font-size: 0.9375rem; color: rgba(231, 222, 211, 0.6); margin: var(--space-2) 0 0; }

  /* --- The button. Full width, bottom of the screen, under the thumb. --- */
  .dock {
    padding: var(--space-4) var(--space-5) calc(var(--space-5) + env(safe-area-inset-bottom));
    background: var(--bg-dark);
    border-top: 1px solid rgba(231, 222, 211, 0.12);
    position: sticky; bottom: 0;
  }
  .punch {
    width: 100%; height: clamp(150px, 28vh, 220px);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2);
    border-radius: var(--radius-md); cursor: pointer; border: 1px solid transparent;
    background: var(--c-sandstone); color: var(--c-evergreen);
    transition: transform var(--motion-fast) var(--ease-out), background-color var(--motion-fast) var(--ease-out);
    touch-action: manipulation; user-select: none; -webkit-user-select: none;
  }
  .punch:active { transform: scale(0.985); background: var(--surface-sunken); }
  .punch__verb { font-size: 2rem; font-weight: var(--weight-semibold); letter-spacing: -0.01em; line-height: 1; }
  .punch__hint { font-size: var(--text-caption); font-weight: var(--weight-medium); opacity: 0.75; }
  .punch.is-out { background: var(--evergreen-hover); color: var(--c-sandstone); border-color: rgba(231, 222, 211, 0.45); }
  .punch.is-out:active { background: var(--evergreen-pressed); }

  /* --- Toast with undo (protects against a pocket tap) --- */
  .toast {
    /* Top of the screen, so it never sits on the button. */
    position: fixed; left: 50%; top: calc(76px + env(safe-area-inset-top));
    width: min(400px, calc(100% - 2 * var(--space-5)));
    transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
    transition: transform var(--motion-fast) var(--ease-out), opacity var(--motion-fast) var(--ease-out);
    background: var(--c-sandstone); color: var(--c-evergreen); box-shadow: var(--elev-3);
    border-radius: var(--radius-lg); padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
    font-size: 0.9375rem; font-weight: var(--weight-medium); z-index: 5;
  }
  .toast.is-in { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
  .toast button {
    background: none; border: 1px solid var(--border-strong); border-radius: var(--radius-md);
    padding: 10px 16px; font-weight: var(--weight-semibold); cursor: pointer; color: var(--c-evergreen);
  }

  /* --- Name picker (first visit only) --- */
  .pick { padding: var(--space-8) 0 var(--space-6); }
  .pick h1 { font-family: var(--font-head); font-weight: var(--weight-bold); font-size: 2.25rem; line-height: 1.1; margin: 0 0 var(--space-3); }
  .pick p { margin: 0 0 var(--space-6); color: rgba(231, 222, 211, 0.78); }
  .roster { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(231, 222, 211, 0.12); }
  .row {
    width: 100%; display: flex; align-items: center; gap: var(--space-4);
    min-height: 64px; padding: var(--space-3) 0; background: none; border: 0;
    border-bottom: 1px solid rgba(231, 222, 211, 0.12); text-align: left; cursor: pointer;
    font-size: var(--text-body-lg); font-weight: var(--weight-medium);
  }
  .row:active { background: rgba(231, 222, 211, 0.06); }
  .avatar {
    width: 40px; height: 40px; border-radius: var(--radius-full); flex: none;
    display: grid; place-items: center; font-size: var(--text-caption); font-weight: var(--weight-semibold);
    background: rgba(127, 166, 182, 0.18); color: var(--c-sandstone);
  }
  .row .role { display: block; font-size: var(--text-caption); color: var(--c-mist); font-weight: var(--weight-medium); }
  .source { font-size: var(--text-caption); color: rgba(231, 222, 211, 0.55); margin-top: var(--space-4); }

  /* --- Stacked actions in the dock (role buttons, meal break + end shift) --- */
  .actions { display: grid; gap: var(--space-3); }
  .actions .punch { height: 96px; }
  .actions .punch.punch--solo { height: clamp(150px, 28vh, 220px); }
  .actions .punch .punch__verb { font-size: 1.375rem; }
  .actions .punch.punch--back { height: 128px; }
  .actions .punch.punch--again { height: 72px; }
  .actions .punch.punch--solo .punch__verb { font-size: 2rem; }
  .punch:disabled { opacity: 0.4; cursor: not-allowed; }
  .punch:disabled:active { transform: none; background: var(--c-sandstone); }
  .actions__label { margin: 0; font-size: var(--text-caption); font-weight: var(--weight-semibold); color: var(--c-mist); }
  .linkbtn {
    justify-self: center; background: none; border: 0; cursor: pointer; min-height: 44px; padding: var(--space-2) var(--space-4);
    color: var(--c-mist); font-size: 0.9375rem; font-weight: var(--weight-semibold);
    text-decoration: underline; text-underline-offset: 3px;
  }
  .linkbtn:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }

  /* --- End of shift: rest break question + optional note --- */
  .ask { padding: var(--space-8) 0 var(--space-6); }
  .ask__done { margin: 0 0 var(--space-6); color: rgba(231, 222, 211, 0.78); }
  .ask h1 { font-family: var(--font-head); font-weight: var(--weight-bold); font-size: 2rem; line-height: 1.15; margin: 0 0 var(--space-2); }
  .ask__sub { margin: 0 0 var(--space-5); color: rgba(231, 222, 211, 0.78); }
  .choice { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
  .choice button {
    height: 72px; border-radius: var(--radius-md); cursor: pointer;
    background: transparent; border: 1px solid rgba(231, 222, 211, 0.45);
    font-size: 1.25rem; font-weight: var(--weight-semibold);
    transition: background-color var(--motion-fast) var(--ease-out);
  }
  .choice button[aria-pressed="true"] { background: var(--c-sandstone); color: var(--c-evergreen); border-color: var(--c-sandstone); }
  .choice button:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: 2px; }
  .ask .note { margin-top: var(--space-4); }
  .ask label { display: block; margin: var(--space-6) 0 var(--space-2); font-weight: var(--weight-semibold); }
  .ask label span { font-weight: var(--weight-regular); color: var(--c-mist); }
  .ask textarea {
    width: 100%; min-height: 104px; resize: vertical; padding: var(--space-3) var(--space-4);
    font: inherit; font-size: 1rem; line-height: 1.5; color: var(--c-sandstone);
    background: rgba(231, 222, 211, 0.06); border: 1px solid rgba(231, 222, 211, 0.25); border-radius: var(--radius-md);
  }
  .ask textarea:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: 1px; }


  /* --- Sync status: shows only when taps are waiting to reach the sheet --- */
  .sync { margin: 0 0 var(--space-3); font-size: var(--text-caption); font-weight: var(--weight-semibold); color: var(--c-mist); text-align: center; }
  .sync--warn { color: var(--c-coral-base); }

  /* --- Gate: shown when the page was not opened from the staff QR code --- */
  .gate { padding: var(--space-8) 0; }
  .gate h1 { font-family: var(--font-head); font-weight: var(--weight-bold); font-size: 2rem; line-height: 1.15; margin: 0 0 var(--space-3); }
  .gate p { margin: 0 0 var(--space-4); color: rgba(231, 222, 211, 0.78); }

  [hidden] { display: none !important; }

  @media (prefers-reduced-motion: reduce) {
    .punch, .toast { transition: none; }
  }
