/* RSPH-189: the public access workstation — a shared PC on the workshop floor, worked with a finger and often
   with gloves still on. It borrows the Workshop TV's board: true black, the hi-vis green, DM Sans. Everything
   you touch is at least 4rem tall. The one thing that moves on its own is the green bar under the header on
   an unlocked panel, draining towards the moment it locks. Always dark, whatever the theme. */
.ws {
    --ws-ink: #000;
    --ws-steel: #14171b;
    --ws-steel-2: #1f242a;
    --ws-line: #3a414a;
    --ws-text: #eef1f5;
    --ws-muted: #9aa4b1;
    --ws-go: var(--rs-accent);
    --ws-go-press: var(--rs-accent-press);
    --ws-out: #f2685f;
    --ws-amber: #f0b429;

    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    overflow: auto;
    background: var(--ws-ink);
    color: var(--ws-text);
    font-family: var(--bs-font-ui);
    -webkit-font-smoothing: antialiased;
}

/* Header ------------------------------------------------------------------ */
.ws-head {
    position: sticky; top: 0; z-index: 2;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0.875rem clamp(1rem, 3vw, 2.5rem);
    background: var(--ws-ink);
    border-bottom: 3px solid var(--ws-go);
}
.ws-head__brand { display: flex; align-items: baseline; gap: 1rem; min-width: 0; }
.ws-head__logo { height: 2.25rem; width: auto; display: block; }
.ws-head__logo--for-light { display: none; }
.ws-head__where { font-size: 1.05rem; color: var(--ws-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-head__clock { font-size: 2.25rem; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }

.ws-body { flex: 1 0 auto; padding: 0 clamp(1rem, 3vw, 2.5rem) 2.5rem; }

.ws-flash { margin: 1rem clamp(1rem, 3vw, 2.5rem) 0; padding: 1rem 1.25rem; border-radius: calc(12px * var(--rs-radius-scale)); font-size: 1.1rem; border: 1.5px solid; }
.ws-flash--ok { border-color: var(--ws-go); color: var(--ws-go); background: rgba(var(--rs-accent-rgb), 0.08); }
.ws-flash--bad { border-color: var(--ws-out); color: #ffd9d6; background: rgba(242, 104, 95, 0.12); }
.ws-flash--inline { margin: 0 0 1.5rem; }

.ws-title { margin: 0; font-size: clamp(1.6rem, 2.6vw, 2.25rem); font-weight: 600; line-height: 1.15; color: var(--ws-text); }
.ws-empty { margin: 1.5rem 0; font-size: 1.15rem; color: var(--ws-muted); max-width: 60ch; }
.ws-foot { margin: 2rem 0 0; color: var(--ws-muted); font-size: 1rem; max-width: 70ch; }

/* Buttons ----------------------------------------------------------------- */
.ws-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 4rem; min-width: 10rem; padding: 0 1.75rem;
    font: inherit; font-size: 1.2rem; font-weight: 600;
    border-radius: calc(14px * var(--rs-radius-scale)); border: 2px solid transparent;
    cursor: pointer; touch-action: manipulation;
}
.ws-btn:focus-visible, .ws-key:focus-visible, .ws-person:focus-visible, .ws-search input:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.ws-btn--go { background: var(--ws-go); color: #00140c; }
.ws-btn--go:active { background: var(--ws-go-press); }

/* Name grid ----------------------------------------------------------------- */
.ws-grid-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 1.75rem 0 1.25rem; }
.ws-search input {
    min-height: 3.5rem; width: min(26rem, 80vw); padding: 0 1.25rem;
    font: inherit; font-size: 1.15rem; color: var(--ws-text);
    background: var(--ws-steel); border: 1.5px solid var(--ws-line); border-radius: calc(14px * var(--rs-radius-scale));
}
.ws-people {
    list-style: none; margin: 0; padding: 0;
    display: grid; gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
}
.ws-person {
    display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
    height: 100%; padding: 1.5rem 1rem 1.25rem;
    text-align: center; text-decoration: none; color: var(--ws-text);
    background: var(--ws-steel); border: 1.5px solid var(--ws-line); border-radius: calc(18px * var(--rs-radius-scale));
}
a.ws-person:hover, a.ws-person:active { border-color: var(--ws-go); background: var(--ws-steel-2); color: var(--ws-text); }
.ws-person--no-pin { opacity: 0.55; }
.ws-person__name { font-size: 1.2rem; font-weight: 600; line-height: 1.2; }

.ws-status { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.95rem; color: var(--ws-muted); }
.ws-status::before { content: ''; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--ws-line); }
.ws-status--working { color: var(--ws-go); }
.ws-status--working::before { background: var(--ws-go); }
.ws-status--in { color: var(--ws-text); }
.ws-status--in::before { background: var(--ws-text); }
.ws-status--none::before { display: none; }

.ws-avatar {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    border-radius: 50%; overflow: hidden;
    background: var(--ws-steel-2); color: var(--ws-text); font-weight: 600;
    border: 2px solid var(--ws-line);
}
.ws-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ws-avatar--lg { width: 6rem; height: 6rem; font-size: 2rem; }
.ws-avatar--xl { width: 7.5rem; height: 7.5rem; font-size: 2.5rem; }

/* PIN ----------------------------------------------------------------------- */
.ws-pin { max-width: 26rem; margin: 2rem auto 0; text-align: center; }
.ws-pin__who { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; }
.ws-pin__ask { margin: 0; font-size: 1.15rem; color: var(--ws-muted); }
.ws-pin__input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.ws-pin__dots { display: flex; justify-content: center; gap: 1rem; margin: 0 0 1.75rem; }
.ws-pin__dot { width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2px solid var(--ws-muted); }
.ws-pin__dot.is-filled { background: var(--ws-go); border-color: var(--ws-go); }
.ws-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.875rem; }
.ws-key {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 5rem;
    font: inherit; font-size: 2rem; font-weight: 500; color: var(--ws-text); text-decoration: none;
    background: var(--ws-steel); border: 1.5px solid var(--ws-line); border-radius: calc(18px * var(--rs-radius-scale));
    cursor: pointer; touch-action: manipulation;
}
.ws-key:active { background: var(--ws-steel-2); border-color: var(--ws-go); }
.ws-key--quiet { font-size: 1.1rem; color: var(--ws-muted); background: transparent; }
.ws-key svg { width: 2rem; height: 2rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* A technician's turn, across the normal app (RSPH-189) ------------------------------------------------------ */
.ws-turn { position: sticky; top: 0; z-index: 70; background: var(--sb-bg, #060a09); color: var(--sb-text, #eef3f1); }
.ws-turn__row {
    display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
    min-height: 3.5rem; padding: 0.4rem clamp(1rem, 2.5vw, 2rem);
}
.ws-turn__who { flex: 1 1 auto; min-width: 0; font-size: 1.05rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-turn__lock { font-size: 0.95rem; color: var(--sb-faint, #7d8985); white-space: nowrap; }
.ws-turn__lock strong { display: inline-block; min-width: 3.2ch; font-size: 1.35rem; font-weight: 600; color: var(--sb-text, #eef3f1); font-variant-numeric: tabular-nums; }
.ws-turn__off {
    min-height: 2.75rem; padding: 0 1.4rem;
    font: inherit; font-size: 1rem; font-weight: 600;
    color: #000; background: var(--sb-text, #eef3f1); border: 0; border-radius: calc(12px * var(--rs-radius-scale));
    cursor: pointer; touch-action: manipulation;
}
.ws-turn__off:focus-visible { outline: 3px solid var(--sb-green, var(--rs-sidebar-accent)); outline-offset: 2px; }
.ws-turn__drain { height: 5px; background: rgba(255, 255, 255, 0.08); }
.ws-turn__bar {
    display: block; height: 100%; background: var(--sb-green, var(--rs-sidebar-accent));
    transform-origin: left center;
    transition: transform 1s linear, background-color 0.3s;
}
.ws-turn__bar.is-low { background: #f0b429; }
@media (prefers-reduced-motion: reduce) { .ws-turn__bar { transition: none; } }
