/*
  Look Lab portal.

  Two surfaces. The public side (the wall, sign-in, sign-up) lives on the wall's own night navy.
  The signed-in console is a quiet porcelain workspace with a navy rail, so a salon owner's
  numbers read like a ledger, not a dashboard. Lab blue is kept for actions only; it is the
  same blue as the wall's "Discover your next look" invitation.
*/

:root {
    --night: #091430;
    --ink: #13203f;
    --ink-line: #24345c;
    --mist: #e7ecf7;
    --mist-dim: #a9b5d1;
    --porcelain: #f6f7fb;
    --paper: #ffffff;
    --rule: #dfe3ee;
    --text: #18213a;
    --text-dim: #5b6684;
    --lab-blue: #1f58ca;
    --lab-blue-deep: #1747a8;
    --rose: #c2566f;
    --ok: #1f7a52;
    --radius-s: 6px;
    --radius-m: 12px;
    --font: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
    --step-0: 1rem;
    --step-1: 1.25rem;
    --step-2: 1.563rem;
    --step-3: 2.441rem;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: var(--font);
    font-size: 100%;
    line-height: 1.5;
    color: var(--text);
    background: var(--porcelain);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--lab-blue); }
a:hover { color: var(--lab-blue-deep); }

:focus-visible {
    outline: 3px solid var(--lab-blue);
    outline-offset: 2px;
}

code {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 0.9em;
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.muted { color: var(--text-dim); }

/* ---------- Buttons and forms ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.55rem 1.15rem;
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: var(--paper);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover { border-color: var(--text-dim); color: var(--text); }

.btn-primary {
    background: var(--lab-blue);
    border-color: var(--lab-blue);
    color: #fff;
}

.btn-primary:hover { background: var(--lab-blue-deep); border-color: var(--lab-blue-deep); color: #fff; }

.btn-block { width: 100%; }

.btn-danger-quiet {
    min-height: 36px;
    padding: 0.3rem 0.9rem;
    color: var(--rose);
    border-color: transparent;
    background: transparent;
}

.btn-danger-quiet:hover { border-color: var(--rose); color: var(--rose); }

.form { display: grid; gap: 1.1rem; }

.form-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
}

.form-group {
    display: grid;
    gap: 1rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.form-group legend {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.field { display: grid; gap: 0.35rem; }
.field > span { font-weight: 600; font-size: 0.92rem; }
.field em { font-style: normal; font-weight: 400; color: var(--text-dim); }
.field small { color: var(--text-dim); }

.field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 1rem;
}

.field input, .field select {
    min-height: 44px;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius-s);
    background: var(--paper);
    color: var(--text);
    font: inherit;
}

.field input:focus, .field select:focus { border-color: var(--lab-blue); outline: none; box-shadow: 0 0 0 3px rgba(31, 88, 202, 0.2); }

.check {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    min-height: 32px;
    cursor: pointer;
}

.check input { width: 1.15rem; height: 1.15rem; margin-top: 0.18rem; accent-color: var(--lab-blue); }

.validation-message, .form-error { color: var(--rose); }

.form-error {
    margin: 0 0 1rem;
    padding: 0.8rem 1rem;
    border-left: 3px solid var(--rose);
    background: rgba(194, 86, 111, 0.1);
    border-radius: 0 var(--radius-s) var(--radius-s) 0;
    list-style: none;
}

ul.form-error { padding-left: 1rem; }

/* ---------- Auth (sign in, sign up) ---------- */

.auth {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(22rem, 34rem);
    min-height: 100vh;
    background: var(--night);
    color: var(--mist);
}

.auth-mosaic {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
    padding: 10px;
    box-sizing: border-box;
    overflow: hidden;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    perspective: 1400px;
    /* The mosaic steps out of the way of the form: it fades into the panel's navy at its right edge. */
    -webkit-mask-image: linear-gradient(90deg, #000 70%, transparent);
    mask-image: linear-gradient(90deg, #000 70%, transparent);
}

/* Each tile idles on its own: auth-mosaic.js sets --rx, --ry and --tz, the tile eases to them.
   A press sets rotate and translate on top: they follow the pointer quickly while it presses and
   settle back slowly once it lets go. */
.tile {
    --rx: 0deg; --ry: 0deg; --tz: 0px; --press-ms: 650ms;
    position: relative;
    min-height: 0;
    border-radius: 10px;
    overflow: hidden;
    background: var(--ink);
    transform: translateZ(var(--tz)) rotateX(var(--rx)) rotateY(var(--ry));
    transition:
        transform 1900ms cubic-bezier(0.22, 0.8, 0.2, 1), box-shadow 1900ms ease,
        rotate var(--press-ms) cubic-bezier(0.22, 0.8, 0.2, 1), translate var(--press-ms) cubic-bezier(0.22, 0.8, 0.2, 1);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    will-change: transform, rotate, translate;
}
.tile.lifted { z-index: 1; box-shadow: 0 22px 40px -12px rgba(0, 0, 0, 0.65); }
.auth-mosaic.pressing .tile { --press-ms: 120ms; }
/* A held finger presses the looks; it should not select them, drag them or open a menu on them. */
.auth-mosaic { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

.tile img {
    pointer-events: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.92);
}

/* The next look dissolves in under a slow zoom, with one soft band of light passing over it. The
   fade is timed to the band: it starts as the band enters the tile (about 550ms into its 1500ms
   ease-in-out run) and ends as it leaves, so the look changes under the light. */
.tile img.incoming { opacity: 0; transform: scale(1.07); }
.tile.swapping img.incoming { opacity: 1; transform: none; transition: opacity 420ms ease-in-out 550ms, transform 1500ms cubic-bezier(0.22, 0.8, 0.2, 1); }
.tile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgba(190, 215, 255, 0.22) 50%, transparent 65%);
    transform: translateX(-120%);
    pointer-events: none;
}
.tile.swapping::after { transform: translateX(120%); transition: transform 1500ms ease-in-out; }

.auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
    padding: clamp(2rem, 6vw, 4.5rem) clamp(1.5rem, 5vw, 4rem);
    max-width: 34rem;
}

.auth-brand { margin-bottom: 1.5rem; display: inline-block; }

.auth-title {
    margin: 0;
    font-size: var(--step-3);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

.auth-lede { margin: 0 0 1.25rem; color: var(--mist-dim); max-width: 32rem; }

.auth .field > span, .auth .form-group legend { color: var(--mist); }
.auth .field small, .auth .field em { color: var(--mist-dim); }

.auth .field input, .auth .field select {
    background: var(--ink);
    border-color: var(--ink-line);
    color: #fff;
}

.auth .check { color: var(--mist); }
.auth .auth-switch { color: var(--mist-dim); margin-top: 1rem; }
.auth .auth-switch a, .auth a:not(.btn) { color: #9fbcff; }
.auth .form-error { color: #ffc4d0; background: rgba(194, 86, 111, 0.18); }
.auth .validation-message { color: #ffc4d0; }

/* ---------- Sign-in options: Microsoft, Google, Apple ---------- */

/* The mosaic and the aside card share the left column; the form keeps the right. */
.auth { grid-template-areas: "art panel"; }
.auth-mosaic { grid-area: art; }
.auth-panel { grid-area: panel; }

/* Sticky, so on a long form the card stays in view while the form scrolls. */
.auth-aside {
    grid-area: art;
    z-index: 1;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
}
.auth-aside:empty { display: none; }

/* With a card on it, the mosaic steps back so the card reads first. */
.auth:has(.auth-aside:not(:empty)) .auth-mosaic .tile img { filter: saturate(0.7) brightness(0.5); }

.sso { display: grid; gap: 0.6rem; }

.sso-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    min-height: 50px;
    padding: 0.6rem 3rem;
    border: 1px solid #fff;
    border-radius: 999px;
    background: #fff;
    color: #1f1f1f;
    font: inherit;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 120ms ease, box-shadow 120ms ease;
}
.sso-btn:hover:not(:disabled) { background: #eef2fb; box-shadow: 0 0 0 4px rgba(159, 188, 255, 0.22); }
.sso-btn:active:not(:disabled) { background: #e2e8f6; }
.sso-btn:disabled { cursor: not-allowed; opacity: 0.55; }

/* The mark sits at the left edge and the label stays centred, as each provider lays out its own button. */
.sso-mark { position: absolute; left: 1.15rem; display: inline-grid; place-items: center; width: 20px; height: 20px; }
.sso-mark svg { width: 20px; height: 20px; }

.sso-off {
    flex: none;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: #e7ecf7;
    color: #5b6684;
    font-size: 0.72rem;
    font-weight: 600;
}

.sso-or {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.9rem;
    margin: 0.6rem 0 0.2rem;
    color: var(--mist-dim);
    font-size: 0.9rem;
}
.sso-or::before, .sso-or::after { content: ""; height: 1px; background: var(--ink-line); }

/* The person a provider vouched for, at the top of the finish-sign-up form. */
.identity-chip {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.55rem 1.1rem 0.55rem 0.55rem;
    border: 1px solid var(--ink-line);
    border-radius: 999px;
    background: var(--ink);
    width: fit-content;
    max-width: 100%;
}
.identity-avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--lab-blue);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
}
.identity-text { display: grid; line-height: 1.25; min-width: 0; }
.identity-text strong { color: #fff; }
.identity-text span { color: var(--mist-dim); font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Continue on your phone: the card on the screen ---------- */

.handoff {
    --handoff-left: 100;
    display: grid;
    gap: 1.4rem;
    width: min(23rem, 100%);
    padding: 1.6rem;
    border: 1px solid rgba(231, 236, 247, 0.16);
    border-radius: 28px;
    background: rgba(9, 20, 48, 0.74);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    backdrop-filter: blur(18px) saturate(1.2);
    box-shadow: 0 30px 80px rgba(3, 8, 22, 0.55);
    color: var(--mist);
}

.handoff-frame {
    position: relative;
    container-type: inline-size;
    aspect-ratio: 1;
    width: 100%;
    border-radius: 20px;
    background: #fff;
    overflow: hidden;
}

.handoff-qr, .handoff-match, .handoff-done {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    transition: opacity 260ms ease, transform 260ms ease, filter 260ms ease;
}
.handoff-qr svg, .handoff-qr-link { display: block; width: 100%; height: 100%; }
.handoff-qr-link { cursor: zoom-in; border-radius: 12px; }
.handoff-qr-link:focus-visible { outline: 3px solid var(--lab-blue); outline-offset: 2px; }

/* The time left on the code, as a ring that drains around the tile. */
.handoff-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 260ms ease;
}
.handoff-ring rect {
    fill: none;
    stroke: var(--lab-blue);
    stroke-width: 3;
    vector-effect: non-scaling-stroke;
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: calc(100 - var(--handoff-left));
    transition: stroke-dashoffset 1s linear;
}
.handoff[data-state="waiting"] .handoff-ring { opacity: 1; }

/* The number replaces the code once a phone has opened it: one thing to look at, nothing to misread. */
/* Overlays that are not showing must not catch the click meant for the code. */
.handoff-match, .handoff-done { pointer-events: none; }
.handoff-match {
    opacity: 0;
    transform: scale(1.06);
    background: #fff;
    align-content: center;
    gap: 7cqi;
}
.handoff-match-label {
    color: var(--text-dim);
    font-size: max(0.75rem, 5.5cqi);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
/* Four tiles sized off the frame, so the number reads from across the room at any card size. */
.handoff-match-num { display: flex; gap: 3cqi; }
.handoff-digit {
    display: grid;
    place-items: center;
    width: 19cqi;
    height: 25cqi;
    border-radius: 4.5cqi;
    background: var(--porcelain);
    box-shadow: inset 0 0 0 1px var(--rule), 0 1.5cqi 3cqi rgba(9, 20, 48, 0.08);
    color: var(--night);
    font-size: 17cqi;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.handoff[data-state="scanned"] .handoff-digit { animation: handoff-digit-in 420ms calc(var(--i) * 70ms + 120ms) cubic-bezier(0.2, 0.9, 0.25, 1.15) both; }
@keyframes handoff-digit-in {
    from { opacity: 0; transform: translateY(18%) scale(0.92); }
    to { opacity: 1; transform: none; }
}

.handoff-done { opacity: 0; transform: scale(0.9); background: var(--lab-blue); }
.handoff-done svg { width: 38%; height: 38%; fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; }

.handoff[data-state="loading"] .handoff-qr { opacity: 0.08; }
.handoff[data-state="scanned"] .handoff-qr { opacity: 0; transform: scale(0.94); }
.handoff[data-state="scanned"] .handoff-match { opacity: 1; transform: none; }
.handoff[data-state="approved"] .handoff-qr,
.handoff[data-state="done"] .handoff-qr { opacity: 0; }
.handoff[data-state="approved"] .handoff-done,
.handoff[data-state="done"] .handoff-done { opacity: 1; transform: none; }
.handoff[data-state="approved"] .handoff-done svg,
.handoff[data-state="done"] .handoff-done svg { stroke-dashoffset: 0; transition: stroke-dashoffset 420ms 120ms ease-out; }
.handoff[data-state="denied"] .handoff-qr,
.handoff[data-state="expired"] .handoff-qr,
.handoff[data-state="error"] .handoff-qr { opacity: 0.12; filter: blur(3px); }

.handoff-copy { display: grid; gap: 0.5rem; }
.handoff-title { margin: 0; font-size: var(--step-1); font-weight: 700; color: #fff; letter-spacing: -0.01em; }
.handoff-body { margin: 0; color: var(--mist-dim); font-size: 0.95rem; line-height: 1.5; }

.handoff-status {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0.35rem 0 0;
    color: var(--mist);
    font-size: 0.95rem;
    font-weight: 600;
    min-height: 1.5em;
}
.handoff-dot { flex: none; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--mist-dim); }
.handoff[data-state="waiting"] .handoff-dot { background: #7aa2ff; animation: handoff-pulse 1.8s ease-in-out infinite; }
.handoff[data-state="scanned"] .handoff-dot { background: #ffc857; }
.handoff[data-state="approved"] .handoff-dot,
.handoff[data-state="done"] .handoff-dot { background: #4cd39b; }
.handoff[data-state="denied"] .handoff-dot,
.handoff[data-state="expired"] .handoff-dot,
.handoff[data-state="error"] .handoff-dot { background: #ff8fa6; }

@keyframes handoff-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(122, 162, 255, 0.55); }
    50% { box-shadow: 0 0 0 0.45rem rgba(122, 162, 255, 0); }
}

.handoff-refresh {
    justify-self: start;
    min-height: 40px;
    padding: 0.4rem 1rem;
    border: 1px solid var(--ink-line);
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.handoff-refresh:hover { border-color: #9fbcff; }
.handoff-refresh[hidden] { display: none; }

.handoff-dev {
    margin: 0.2rem 0 0;
    padding: 0.45rem 0.7rem;
    border-radius: 10px;
    background: rgba(255, 200, 87, 0.12);
    color: #ffd98a;
    font-size: 0.82rem;
}
.handoff-dev[hidden] { display: none; }

/* ---------- Continue on your phone: the page on the phone ---------- */

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    margin: 0 0 0.75rem;
    padding: 0;
    list-style: none;
}
.steps li {
    padding-top: 0.55rem;
    border-top: 3px solid var(--ink-line);
    color: var(--mist-dim);
    font-size: 0.82rem;
    font-weight: 600;
}
.steps li.is-done { border-top-color: var(--lab-blue); color: var(--mist); }
.steps li.is-current { border-top-color: #9fbcff; color: #fff; }

.screen-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--ink-line);
    border-radius: 16px;
    background: var(--ink);
}
.screen-card-icon { flex: none; width: 1.75rem; height: 1.75rem; fill: none; stroke: #9fbcff; stroke-width: 1.7; stroke-linecap: round; }
.screen-card-text { display: grid; line-height: 1.3; }
.screen-card-text strong { color: #fff; }
.screen-card-text span { color: var(--mist-dim); font-size: 0.9rem; }

.phone-actions { display: grid; gap: 0.6rem; }

.btn-ghost { background: transparent; border-color: var(--ink-line); color: #fff; }
.auth a.btn-ghost { color: #fff; }
.btn-ghost:hover { border-color: #9fbcff; color: #fff; }

.match-form { display: grid; gap: 1.25rem; margin-top: 0.5rem; }

/*
  The four-digit code. Without script it is one big spaced-out field and a Confirm button. With
  script (.is-live) the field goes invisible on top of four boxes that mirror it: taps still land
  on the real input, so the phone's keyboard, paste and backspace behave as usual.
*/
.code-input { display: grid; gap: 0.6rem; }
.code-input-label { color: var(--mist-dim); font-size: 0.9rem; font-weight: 600; }
.code-input-box { position: relative; }
.code-input-field {
    width: 100%;
    min-height: 4.5rem;
    padding: 0 1rem;
    border: 1px solid var(--ink-line);
    border-radius: 18px;
    background: var(--ink);
    color: #fff;
    font: inherit;
    font-size: 2.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5em;
    text-align: center;
}
.code-input-field:focus-visible { outline: 3px solid #9fbcff; outline-offset: 2px; }
.code-cells { display: none; }
.code-input-error { margin: 0; color: #ffc4d0; font-size: 0.92rem; }

.code-input.is-live .code-cells {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.65rem;
    pointer-events: none;
}
.code-input.is-live .code-input-field {
    position: absolute;
    inset: 0;
    z-index: 1;
    height: 100%;
    min-height: 0;
    border: 0;
    background: transparent;
    color: transparent;
    caret-color: transparent;
    outline: none;
    -webkit-text-fill-color: transparent;
}
.code-input.is-live .code-input-field::selection { background: transparent; }
.code-input.is-live + .code-submit { display: none; }

.code-cell {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 5;
    border: 1px solid var(--ink-line);
    border-radius: 18px;
    background: var(--ink);
    color: #fff;
    font-size: clamp(2rem, 11vw, 2.75rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.code-cell.is-filled { border-color: #3a5592; animation: code-pop 200ms cubic-bezier(0.3, 1.5, 0.5, 1); }
.code-cell.is-caret { border-color: #9fbcff; box-shadow: 0 0 0 3px rgba(122, 162, 255, 0.28); }
.code-cell.is-caret::after {
    content: "";
    width: 2px;
    height: 38%;
    border-radius: 2px;
    background: #9fbcff;
    animation: code-caret 1.05s steps(1) infinite;
}

/* All four in: the row turns lab blue while the page sends it. */
.code-input.is-full .code-cell { border-color: var(--lab-blue); background: var(--lab-blue); }
.code-input.is-full .code-cell:nth-child(2) { transition-delay: 30ms; }
.code-input.is-full .code-cell:nth-child(3) { transition-delay: 60ms; }
.code-input.is-full .code-cell:nth-child(4) { transition-delay: 90ms; }
.code-input.is-sending .code-cells { animation: code-breathe 1.1s ease-in-out infinite; }

/* A wrong number: the empty row shakes once and glows rose. */
.code-input.is-wrong .code-cells { animation: code-shake 420ms cubic-bezier(0.36, 0.07, 0.19, 0.97); }
.code-input[data-error] .code-cell:not(.is-filled):not(.is-caret) { border-color: rgba(255, 143, 166, 0.55); }

@keyframes code-pop { 0% { transform: scale(0.88); } 100% { transform: none; } }
@keyframes code-caret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes code-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
@keyframes code-shake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-8px); }
    40%, 60% { transform: translateX(8px); }
}

/* A real switch for one yes-or-no choice with consequences. */
.toggle { position: relative; display: flex; align-items: flex-start; gap: 0.85rem; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track {
    position: relative;
    flex: none;
    width: 3rem;
    height: 1.75rem;
    margin-top: 0.1rem;
    border-radius: 999px;
    background: var(--ink-line);
    transition: background-color 160ms ease;
}
.toggle-track::after {
    content: "";
    position: absolute;
    top: 0.2rem;
    left: 0.2rem;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: #fff;
    transition: transform 160ms ease;
}
.toggle input:checked + .toggle-track { background: var(--lab-blue); }
.toggle input:checked + .toggle-track::after { transform: translateX(1.25rem); }
.toggle input:focus-visible + .toggle-track { outline: 3px solid #9fbcff; outline-offset: 2px; }
.toggle-text { display: grid; gap: 0.15rem; line-height: 1.35; }
.toggle-text strong { color: #fff; }
.toggle-text span { color: var(--mist-dim); font-size: 0.9rem; }

.deny-form { margin-top: 0.25rem; text-align: center; }
.link-button {
    min-height: 44px;
    padding: 0.4rem 0.8rem;
    border: 0;
    background: none;
    color: #9fbcff;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.phone-done { display: grid; gap: 0.75rem; justify-items: start; }
.phone-done svg { width: 4rem; height: 4rem; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.phone-done circle { fill: var(--lab-blue); stroke: none; }
.phone-done path { stroke: #fff; stroke-dasharray: 40; stroke-dashoffset: 40; animation: phone-check 420ms 150ms ease-out forwards; }
@keyframes phone-check { to { stroke-dashoffset: 0; } }

/* Fit the form to the screen: spacing follows the height, so the right side rarely needs to scroll. */
.auth { min-height: 100vh; min-height: 100dvh; }
.auth-panel { gap: clamp(0.3rem, 1.1dvh, 0.75rem); padding-block: clamp(0.5rem, 3.5dvh, 4.5rem); }
.auth-brand { margin-bottom: clamp(0.5rem, 2dvh, 1.75rem); }
/* The logo grows with the screen's height too, up to the room the sign-in form leaves free. */
.auth-brand img { display: block; width: auto; height: clamp(40px, 10dvh, 140px); }
.auth-title { font-size: clamp(1.75rem, 4.4dvh, var(--step-3)); }
.auth-lede { margin-bottom: clamp(0.5rem, 1.6dvh, 1.25rem); }
.auth .form { gap: clamp(0.5rem, 1.7dvh, 1.1rem); }
.auth .form-group { gap: clamp(0.5rem, 1.5dvh, 1rem); }
.auth .field { gap: 0.25rem; }
.auth .field input, .auth .field select { min-height: clamp(38px, 5.2dvh, 44px); }
.auth .sso { gap: clamp(0.35rem, 1dvh, 0.6rem); }
.auth .sso-btn { min-height: clamp(40px, 5.6dvh, 50px); padding-block: 0.3rem; }
.auth .sso-or { margin-block: clamp(0.2rem, 0.9dvh, 0.6rem) 0; }
.auth .auth-switch { margin-top: clamp(0.25rem, 1dvh, 1rem); }

/* Three columns when the left half is narrow, so the tiles keep their portrait shape. */
@media (max-width: 75rem) {
    .auth-mosaic { grid-template-columns: repeat(3, 1fr); }
    .auth-mosaic .tile:nth-child(n+10) { display: none; }
}

/*
  Stacked: portrait screens and narrow windows. A tall screen has no left half to give the looks,
  so they become a band across the top under the brand. The phone card overlaps the foot of the
  band, where the looks fade into navy, and the form follows. On a portrait kiosk that puts the
  code at eye height and the form within reach below it.
*/
@media (orientation: portrait), (max-width: 52rem) {
    .auth {
        --brand-room: clamp(4.25rem, 9dvh, 7rem);
        --looks: clamp(8rem, 26dvh, 26rem);
        --overlap: clamp(1.5rem, 5dvh, 4.5rem);
        position: relative;
        grid-template-columns: minmax(0, 1fr);
        /* The looks take whatever height the form leaves, so a tall kiosk has no empty navy. */
        grid-template-rows: minmax(calc(var(--brand-room) + var(--looks)), 1fr) auto auto;
        grid-template-areas: none;
    }
    /* The card takes its own share of the height, so the looks above it need less. */
    .auth:has(.auth-aside:not(:empty)) { --looks: clamp(8rem, 17dvh, 22rem); }

    /* Looks run in one to three rows, as many as fit across; the band crops the ends. */
    .auth-mosaic {
        grid-area: 1 / 1 / 2 / 2;
        position: relative;
        height: auto;
        container: auth-art / size;
        display: flex;
        flex-flow: column wrap;
        align-content: center;
        padding-top: var(--brand-room);
        -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - var(--overlap) - 5rem), transparent);
        mask-image: linear-gradient(180deg, #000 calc(100% - var(--overlap) - 5rem), transparent);
    }
    .auth-mosaic .tile {
        --rows: 2;
        --tile-h: calc((100cqh - (var(--rows) - 1) * 10px) / var(--rows));
        flex: none;
        width: calc(var(--tile-h) * 0.8);
        height: var(--tile-h);
    }
    .auth-mosaic .tile:nth-child(n) { display: block; }
    @container auth-art (height < 22rem) {
        .auth-mosaic .tile { --rows: 1; }
    }
    @container auth-art (height > 50rem) {
        .auth-mosaic .tile { --rows: 3; }
    }
    /* The card no longer sits over the faces, so they keep their colour. */
    .auth:has(.auth-aside:not(:empty)) .auth-mosaic .tile img { filter: saturate(0.92); }

    .auth-brand {
        position: absolute;
        z-index: 2;
        top: calc(var(--brand-room) / 2 + env(safe-area-inset-top, 0px));
        left: 50%;
        translate: -50% -50%;
        margin: 0;
    }
    /* Sized to the band it sits in, not the whole screen height. */
    .auth-brand img { height: clamp(40px, calc(var(--brand-room) - 1.75rem), 90px); }

    .auth-aside {
        grid-area: 2 / 1 / 3 / 2;
        position: static;
        height: auto;
        margin-top: calc(-1 * var(--overlap));
        padding: 0 clamp(1rem, 5vw, 3rem);
    }

    /* Code beside the words, so the card is short enough to share the screen with the form. */
    .handoff {
        --qr: clamp(8.5rem, 24vw, 16rem);
        grid-template-columns: var(--qr) minmax(0, 1fr);
        align-items: center;
        width: min(100%, 44rem);
        padding: clamp(0.9rem, 2.2vw, 1.5rem);
        gap: clamp(1rem, 3vw, 1.75rem);
        border-radius: clamp(20px, 3vw, 28px);
    }
    .handoff-frame { border-radius: clamp(12px, 2vw, 20px); }

    .auth-panel {
        grid-area: 3 / 1 / 4 / 2;
        justify-self: center;
        justify-content: center;
        width: 100%;
        max-width: 36rem;
        /* A short page keeps a real share of the screen rather than a strip under the looks. */
        min-height: 40dvh;
        padding: clamp(1.5rem, 4dvh, 3.5rem) clamp(1.25rem, 6vw, 2rem) max(2.5rem, env(safe-area-inset-bottom, 0px));
    }
}

/* A phone held in the hand has no use for a code to scan; the looks keep a short band. */
@media (max-width: 30rem) {
    .auth-aside { display: none; }
    .auth, .auth:has(.auth-aside:not(:empty)) { --brand-room: 3.75rem; --looks: clamp(6rem, 15dvh, 10rem); --overlap: 0px; }
    .auth-panel { padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
    .tile, .tile * { transition: none !important; }
    .tile::after { display: none; }
    .handoff *, .phone-done path, .code-input * { transition: none !important; animation: none !important; }
    .phone-done path, .handoff-done svg { stroke-dashoffset: 0; }
}

/* ---------- Console (signed in) ---------- */

.console {
    --rail-open: 15rem;
    --rail-shut: 4.5rem;
    --rail-ease: cubic-bezier(0.32, 0.72, 0, 1);
    display: grid;
    grid-template-columns: var(--rail-open) minmax(0, 1fr);
    min-height: 100vh;
    transition: grid-template-columns 0.32s var(--rail-ease);
}

.rail {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    padding: 1.5rem 1rem;
    background: var(--night);
    color: var(--mist);
    position: sticky;
    top: 0;
    z-index: 30;
    height: 100vh;
}

.rail-brand { padding: 0 0.6rem 1.25rem; }

.rail-account {
    margin: 0 0 0.6rem;
    padding: 0 0.6rem;
    color: #fff;
    font-weight: 600;
}

.rail-group {
    margin: 1.4rem 0 0.35rem;
    padding: 0 0.6rem;
    color: var(--mist-dim);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
}

.rail-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 2.6rem;
    padding: 0.5rem 0.65rem;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--mist);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.rail-link:hover { background: var(--ink); color: #fff; }
.rail-link:focus-visible { outline: 2px solid #9fbcff; outline-offset: 1px; }

.rail-link.active {
    background: var(--ink);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--lab-blue);
}

.rail-icon {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.78;
    transition: opacity 0.15s ease;
}
.rail-icon .dot { fill: currentColor; stroke: none; }
.rail-link:hover .rail-icon, .rail-link.active .rail-icon { opacity: 1; }
.rail-link.active .rail-icon { color: #9fbcff; }

.rail-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rail-foot {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--ink-line);
}

.rail-fold { color: var(--mist-dim); }
.rail-fold .rail-label { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 0.5rem; }
.rail-fold kbd {
    padding: 0.05rem 0.4rem;
    border: 1px solid var(--ink-line);
    border-radius: 5px;
    color: var(--mist-dim);
    font: 600 0.7rem/1.4 var(--font);
    opacity: 0;
    transition: opacity 0.15s ease;
}
.rail-fold:hover kbd, .rail-fold:focus-visible kbd { opacity: 1; }
.rail-fold-shut { display: none; }
.rail-icon .chev { transition: transform 0.32s var(--rail-ease); transform-origin: 14.5px 12px; }

.rail-me {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-top: 0.35rem;
    padding: 0.45rem 0.5rem;
}

.rail-avatar {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: linear-gradient(140deg, #2b4a8f, var(--ink));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.rail-me-text { display: grid; min-width: 0; justify-items: start; gap: 0.15rem; line-height: 1.25; }
.rail-me > .rail-label { display: none; }

.rail-user {
    max-width: 100%;
    overflow: hidden;
    color: #fff;
    font-size: 0.92rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rail-signout { color: var(--mist-dim); }

.rail-mark {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0.6rem 0 0;
    padding: 0.5rem 0.65rem 0.15rem;
    border-radius: 8px;
    color: #fff;
    opacity: 0.55;
    transition: opacity 0.15s ease;
}
.rail-mark:hover, .rail-mark:focus-visible { opacity: 1; }
.rail-brand .rail-mark { margin: 0; padding: 0; opacity: 1; }
.rail-mark-word { width: 5.75rem; height: auto; }
.rail-brand .rail-mark-word { width: 8rem; }
.rail-mark-short { display: none; width: 1.35rem; height: auto; }
.rail-mark > .rail-label { display: none; }

/* ---------- The rail folded to icons ---------- */

@media (min-width: 48.0625rem) {
    .console.is-rail-folded { grid-template-columns: var(--rail-shut) minmax(0, 1fr); }
    .is-rail-folded .rail { padding-inline: 0.75rem; }

    .is-rail-folded .rail-link { justify-content: center; gap: 0; padding-inline: 0; }
    .is-rail-folded .rail-link.active { box-shadow: inset 0 0 0 1px #2e4170; }

    /* The heading folds to a short rule; its words stay for a screen reader. */
    .is-rail-folded .rail-group {
        height: 1px;
        margin: 0.85rem 0.6rem;
        padding: 0;
        background: var(--ink-line);
        color: transparent;
    }

    /* A label leaves the rail and becomes the name shown beside its icon. */
    .is-rail-folded .rail-label,
    .is-rail-folded .rail-me > .rail-label,
    .is-rail-folded .rail-mark > .rail-label {
        position: absolute;
        top: 50%;
        left: calc(100% + 0.9rem);
        display: block;
        padding: 0.38rem 0.65rem;
        border-radius: 7px;
        background: var(--ink);
        box-shadow: 0 10px 30px -8px rgba(9, 20, 48, 0.55), inset 0 0 0 1px var(--ink-line);
        color: #fff;
        font-size: 0.85rem;
        font-weight: 500;
        letter-spacing: 0;
        text-transform: none;
        overflow: visible;
        opacity: 0;
        pointer-events: none;
        translate: -4px -50%;
        transition: opacity 0.12s ease, translate 0.16s var(--rail-ease);
    }
    .is-rail-folded .rail-label::before {
        content: "";
        position: absolute;
        top: 50%;
        left: -4px;
        width: 8px;
        height: 8px;
        background: inherit;
        rotate: 45deg;
        translate: 0 -50%;
    }
    .is-rail-folded .rail-link:hover > .rail-label,
    .is-rail-folded .rail-link:focus-visible > .rail-label,
    .is-rail-folded .rail-me:hover > .rail-label,
    .is-rail-folded .rail-mark:hover > .rail-label,
    .is-rail-folded .rail-mark:focus-visible > .rail-label {
        opacity: 1;
        translate: 0 -50%;
        transition-delay: 0.05s;
    }

    .is-rail-folded .rail-fold .rail-label { gap: 0.6rem; }
    .is-rail-folded .rail-fold kbd { opacity: 1; }
    .is-rail-folded .rail-fold-open { display: none; }
    .is-rail-folded .rail-fold-shut { display: inline; }
    .is-rail-folded .rail-icon .chev { transform: scaleX(-1); }

    .is-rail-folded .rail-me { justify-content: center; padding-inline: 0; }
    .is-rail-folded .rail-me-text { display: none; }

    .is-rail-folded .rail-mark { justify-content: center; padding-inline: 0; }
    .is-rail-folded .rail-mark-word { display: none; }
    .is-rail-folded .rail-mark-short { display: block; }

    /* The switcher keeps only its swatch. */
    .is-rail-folded .scope { margin: 0 0 0.35rem; }
    .is-rail-folded .scope-trigger { justify-content: center; padding: 0.3rem; }
    .is-rail-folded .scope-text, .is-rail-folded .scope-caret { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .console, .rail-icon .chev, .rail-label { transition: none; }
}

.console-main {
    padding: clamp(1.5rem, 4vw, 3rem);
}

.page-head { margin-bottom: 1.75rem; }

.page-head h1 {
    margin: 0;
    font-size: var(--step-3);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.page-head p { margin: 0.4rem 0 0; max-width: 46rem; }

.panel {
    margin: 0 0 1.5rem;
    padding: 1.5rem;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--radius-m);
}

fieldset.panel { display: grid; gap: 0.75rem; }
fieldset.panel legend { padding: 0 0.4rem; font-weight: 700; font-size: var(--step-1); }

.panel h2 {
    margin: 0 0 1rem;
    font-size: var(--step-1);
    letter-spacing: -0.01em;
}

/* The usage summary is the headline of the page: a sentence a salon owner can read aloud. */
.summary {
    margin: 0 0 1.5rem;
    max-width: 52rem;
    font-size: var(--step-1);
    line-height: 1.55;
    color: var(--text);
}

.summary strong { font-weight: 700; }

.notice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-m);
    background: #e8eefc;
    border: 1px solid #c9d7f7;
}

.notice p { margin: 0; max-width: 46rem; }
.notice.is-quiet { background: var(--paper); border-color: var(--rule); }
.notice.is-success { background: #e6f4ec; border-color: #bfe3cf; display: block; }
.notice.is-success p + p { margin-top: 0.75rem; }

.token code {
    display: inline-block;
    padding: 0.6rem 0.8rem;
    background: var(--paper);
    border: 1px dashed var(--ok);
    border-radius: var(--radius-s);
    word-break: break-all;
    user-select: all;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.table th {
    text-align: left;
    font-weight: 600;
    color: var(--text-dim);
    padding: 0 0.75rem 0.6rem;
    border-bottom: 1px solid var(--rule);
}

.table td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid var(--rule);
    vertical-align: top;
}

.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; }
.table tr.is-revoked td { color: var(--text-dim); }

.tag {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    background: var(--porcelain);
    border: 1px solid var(--rule);
    font-size: 0.8rem;
    color: var(--text-dim);
}

.tag.is-warn { background: #fdecef; border-color: #f4c6d0; color: var(--rose); }

.tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--rule);
}

.tabs a {
    padding: 0.6rem 0.9rem;
    color: var(--text-dim);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tabs a.is-active { color: var(--text); border-bottom-color: var(--lab-blue); font-weight: 600; }

.settings { max-width: 52rem; }

.search { margin-bottom: 1.25rem; }
.search .field { min-width: min(28rem, 100%); }

.status-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin: 0 0 1.5rem;
}

.status-form p { margin: 0; color: var(--text-dim); }

/* ---------- Charts ---------- */

.chart-pair {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 1.5rem;
}

.chart { margin: 0; }

.chart figcaption {
    margin-bottom: 0.6rem;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-dim);
}

.chart svg {
    display: block;
    width: 100%;
    height: 7rem;
}

.chart rect { fill: var(--lab-blue); }
.chart rect:hover { fill: var(--night); }

.chart-axis {
    display: flex;
    justify-content: space-between;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}

.chart-empty {
    display: grid;
    place-items: center;
    height: 7rem;
    margin: 0;
    border: 1px dashed var(--rule);
    border-radius: var(--radius-s);
    color: var(--text-dim);
}

@media (max-width: 48rem) {
    .console { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; }
    .rail-brand { padding-bottom: 0; }
    .rail-account, .rail-group { display: none; }
    .rail-link { width: auto; }
    .rail-foot { flex-direction: row; margin: 0 0 0 auto; padding: 0; border: 0; }
    .rail-fold, .rail-me, .rail-foot > .rail-mark { display: none; }
    .table { display: block; overflow-x: auto; }
}

/* ---------- The wall's corner, on the welcome screen ---------- */

.ll-entry {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* No arrow disk on this one, so its padding is even on both sides; its height matches the kiosk's. */
.ll-entry .ll-entry-primary {
    min-height: calc(var(--cta-font, 1.25rem) * 2.74);
    padding-inline: calc(var(--cta-font, 1.25rem) * 1.05);
    justify-content: center;
    text-decoration: none;
}

.ll-entry-secondary {
    display: inline-flex;
    flex: none;
    align-items: center;
    min-height: calc(var(--cta-font, 1.25rem) * 2.74);
    padding: 0 1.15em;
    border-radius: 999px;
    background: rgba(9, 20, 48, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.34);
    color: #fff;
    font-size: calc(var(--cta-font, 1.25rem) * 0.78);
    font-weight: 600;
    text-decoration: none;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.ll-entry-secondary:hover { color: #fff; border-color: #fff; background: rgba(9, 20, 48, 0.78); }

.ll-entry-secondary:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }

/* Staff get back to their account from a paired screen; small, so guests are not invited in. */
.ll-staff-link {
    position: absolute;
    left: max(clamp(1rem, 3vw, 2.5rem), env(safe-area-inset-left, 0px));
    bottom: max(clamp(0.6rem, 2vmin, 1.25rem), env(safe-area-inset-bottom, 0px));
    z-index: 40;
    padding: 0.35rem 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.ll-staff-link:hover { color: #fff; }

@media (max-width: 40rem) {
    /* Below the brand on a narrow screen, the two choices share one wide row. */
    .ll-entry { width: min(100%, 34em); }
    .ll-entry .ll-entry-primary { flex: 1; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* Blazor moves focus to the page heading after navigation; that is for screen readers, not a ring. */
h1:focus { outline: none; }

.table .actions form { margin: 0; }

/* ---------- MSI staff sign-in ----------
   Millennium's own door into Look Lab: the company's plum and its mark, a Microsoft-style
   button, and nothing of the business sign-in's photo mosaic. */

.staff {
    --msi-plum: #5f449b;
    --msi-night: #241838;
    --msi-lilac: #cbbdf0;
    --msi-ink: #1d1729;
    --msi-dim: #625a74;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(20rem, 5fr) 7fr;
    background: var(--paper);
    color: var(--msi-ink);
    font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
}

.staff-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(2rem, 5vw, 3.5rem);
    background: var(--msi-night);
    color: #fff;
}

/* The mark again, huge and faint, running off the panel's corner. */
.staff-brand::after {
    content: "";
    position: absolute;
    right: -18%;
    bottom: -22%;
    width: 85%;
    aspect-ratio: 1;
    border: clamp(1.5rem, 3vw, 2.75rem) solid var(--msi-plum);
    border-radius: 50%;
    opacity: 0.45;
    pointer-events: none;
}

.staff-logo { width: min(17rem, 100%); height: auto; display: block; }

.staff-brand-name {
    position: relative;
    z-index: 1;
    margin: 0;
    font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
    font-size: clamp(1.9rem, 3.4vw, 2.75rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
    max-width: 15ch;
}

.staff-brand-name span { display: block; color: var(--msi-lilac); font-weight: 400; }

.staff-made {
    position: relative;
    z-index: 1;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--msi-lilac);
    font-size: 0.9rem;
}

.staff-made img { opacity: 0.9; }

.staff-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(2rem, 6vw, 5rem);
}

.staff-form { width: min(25rem, 100%); display: flex; flex-direction: column; gap: 1rem; }

.staff-title {
    margin: 0;
    font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.staff-lede { margin: 0 0 0.5rem; color: var(--msi-dim); line-height: 1.55; }

/* Microsoft's own sign-in button: white, a grey hairline, square corners, the four squares. */
.staff-ms {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 3rem;
    padding: 0 1.25rem;
    border: 1px solid #8c8c8c;
    border-radius: 2px;
    background: #fff;
    color: #5e5e5e;
    font: 600 0.95rem "Segoe UI", system-ui, sans-serif;
    cursor: pointer;
}

.staff-ms:hover { background: #f3f3f3; border-color: #5e5e5e; color: #3b3b3b; }
.staff-ms:focus-visible { outline: 3px solid var(--msi-plum); outline-offset: 2px; }

.staff-help { margin: 0.25rem 0 0; color: var(--msi-dim); font-size: 0.875rem; line-height: 1.5; }
.staff-help strong { color: var(--msi-ink); font-weight: 600; }

.staff-panel .form-error { margin: 0; }
.staff-panel .notice { margin: 0; }

.staff-foot {
    margin: 2.5rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rule);
    width: min(25rem, 100%);
    color: var(--msi-dim);
    font-size: 0.875rem;
}

.staff-foot a, .staff-help a { color: var(--msi-plum); }

.staff .btn { border-radius: 2px; }

.rail-badge {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--mist-dim);
    border: 1px solid var(--ink-line);
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
}

@media (max-width: 760px) {
    .staff { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
    .staff-brand { gap: 1.25rem; padding: 1.5rem; }
    .staff-brand::after { width: 55%; right: -14%; bottom: -60%; }
    .staff-logo { width: 9.5rem; }
    .staff-brand-name { font-size: 1.5rem; max-width: none; }
    .staff-made { display: none; }
    .staff-panel { justify-content: flex-start; padding: 2rem 1.5rem; }
}

/* ---------- Customize wall: a live copy of the wall's corner above its fields ---------- */

.btn-quiet {
    min-height: 36px;
    padding: 0.3rem 0.9rem;
    border-color: transparent;
    background: transparent;
    color: var(--lab-blue);
}

.btn-quiet:hover { border-color: var(--lab-blue); color: var(--lab-blue); }

.table .actions { white-space: nowrap; }
.table .actions form { display: inline-block; }

.wall-brand { display: grid; gap: 1.5rem; max-width: 52rem; }

.wall-brand-preview { margin: 0; display: grid; gap: 0.5rem; }
.wall-brand-preview figcaption { font-size: 0.85rem; }

.wall-brand-preview {
    position: relative;
}

.wall-brand-stage {
    position: absolute;
    inset: 0 0 1.75rem;
    border-radius: var(--radius-m);
    /* A suggestion of the photo wall under the corner, without loading any photos. */
    background:
        linear-gradient(to bottom, rgba(4, 9, 22, 0.9), rgba(4, 9, 22, 0.35) 70%, rgba(4, 9, 22, 0.15)),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 52px, transparent 52px 60px),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 52px, transparent 52px 60px),
        radial-gradient(120% 140% at 80% 120%, #1c2f5e, #070f24 60%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.wall-brand-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 9rem;
    padding: 1.5rem 1.75rem 3rem;
    color: #f4f7ff;
    font-family: "Source Sans Pro", "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wall-brand-mark { display: inline-flex; flex: none; }
.wall-brand-mark img { display: block; height: 2.25rem; width: auto; max-width: 11rem; object-fit: contain; object-position: left center; }
.wall-brand-mark.is-white img { filter: brightness(0) invert(1); }

.wall-brand-rule {
    flex: none;
    align-self: stretch;
    width: 1px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.42) 20%, rgba(255, 255, 255, 0.42) 80%, transparent);
}

.wall-brand-text { display: grid; gap: 0.2rem; min-width: 0; }
.wall-brand-text strong { font-size: 1.6rem; line-height: 1.1; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.wall-brand-text span { font-size: 1rem; font-weight: 500; color: rgba(244, 247, 255, 0.78); }

.wall-brand-logo { margin: 0; padding: 0; border: 0; display: grid; gap: 0.5rem; }
.wall-brand-logo legend { padding: 0; margin-bottom: 0.35rem; font-weight: 600; font-size: 0.92rem; }

.wall-brand-actions { display: flex; gap: 0.75rem; }

@media (max-width: 34rem) {
    .wall-brand-head { flex-direction: column; align-items: flex-start; }
    .wall-brand-rule { display: none; }
}
