/* ==========================================================================
   Themes. <html data-theme="..."> is set by the server from the hs_theme cookie
   (see Infrastructure/Themes.cs); every color below comes from these tokens.
   ========================================================================== */
:root,
[data-theme="evergreen"] {
    color-scheme: light;
    --bg: #f3f7f6;
    --glow-1: rgba(20, 184, 166, .22);
    --glow-2: rgba(132, 204, 22, .16);
    --surface: rgba(255, 255, 255, .86);
    --surface-solid: #ffffff;
    --surface-2: #eef5f3;
    --ink: #10201d;
    --muted: #5b6e69;
    --line: rgba(16, 32, 29, .1);
    --brand: #0f766e;
    --brand-2: #14b8a6;
    --brand-ink: #ffffff;
    --brand-soft: rgba(20, 184, 166, .12);
    --link: #0f766e;
    --topbar-bg: rgba(255, 255, 255, .72);
    --topbar-ink: #10201d;
    --danger: #c0262d;
    --danger-2: #f0525a;
    --danger-soft: rgba(224, 49, 49, .1);
    --warn: #9a5b00;
    --warn-soft: rgba(245, 159, 0, .15);
    --ok: #177245;
    --ok-soft: rgba(47, 158, 68, .13);
    --info-soft: rgba(15, 118, 110, .08);
    --shadow: 0 1px 2px rgba(16, 32, 29, .05), 0 8px 24px -8px rgba(16, 32, 29, .14);
    --shadow-lift: 0 2px 4px rgba(16, 32, 29, .06), 0 18px 40px -12px rgba(15, 118, 110, .35);
    --map-filter: none;
}

[data-theme="midnight"] {
    color-scheme: dark;
    --bg: #070b16;
    --glow-1: rgba(34, 211, 238, .18);
    --glow-2: rgba(168, 85, 247, .2);
    --surface: rgba(17, 24, 43, .78);
    --surface-solid: #111a2e;
    --surface-2: #17213a;
    --ink: #e6ecff;
    --muted: #8e9bbd;
    --line: rgba(148, 163, 214, .16);
    --brand: #06b6d4;
    --brand-2: #8b5cf6;
    --brand-ink: #ffffff;
    --brand-soft: rgba(34, 211, 238, .14);
    --link: #67e8f9;
    --topbar-bg: rgba(7, 11, 22, .7);
    --topbar-ink: #e6ecff;
    --danger: #e11d48;
    --danger-2: #fb7185;
    --danger-soft: rgba(251, 113, 133, .14);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, .14);
    --ok: #4ade80;
    --ok-soft: rgba(74, 222, 128, .13);
    --info-soft: rgba(103, 232, 249, .09);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -10px rgba(0, 0, 0, .7);
    --shadow-lift: 0 0 0 1px rgba(34, 211, 238, .35), 0 20px 50px -12px rgba(139, 92, 246, .45);
    --map-filter: invert(1) hue-rotate(185deg) brightness(.92) contrast(.88) saturate(.7);
}

[data-theme="sunset"] {
    color-scheme: light;
    --bg: #fff8f3;
    --glow-1: rgba(251, 113, 133, .22);
    --glow-2: rgba(251, 191, 36, .22);
    --surface: rgba(255, 255, 255, .84);
    --surface-solid: #ffffff;
    --surface-2: #fff1e8;
    --ink: #2a1510;
    --muted: #7c5f55;
    --line: rgba(42, 21, 16, .1);
    --brand: #e8590c;
    --brand-2: #e64980;
    --brand-ink: #ffffff;
    --brand-soft: rgba(232, 89, 12, .11);
    --link: #c2410c;
    --topbar-bg: rgba(255, 248, 243, .74);
    --topbar-ink: #2a1510;
    --danger: #b91c1c;
    --danger-2: #ef4444;
    --danger-soft: rgba(220, 38, 38, .1);
    --warn: #92400e;
    --warn-soft: rgba(245, 158, 11, .16);
    --ok: #15803d;
    --ok-soft: rgba(34, 197, 94, .13);
    --info-soft: rgba(232, 89, 12, .07);
    --shadow: 0 1px 2px rgba(42, 21, 16, .05), 0 8px 24px -8px rgba(124, 45, 18, .16);
    --shadow-lift: 0 2px 4px rgba(42, 21, 16, .06), 0 18px 40px -12px rgba(230, 73, 128, .35);
    --map-filter: sepia(.15) saturate(1.1);
}

[data-theme="royal"] {
    color-scheme: light;
    --bg: #f5f5ff;
    --glow-1: rgba(99, 102, 241, .22);
    --glow-2: rgba(217, 70, 239, .15);
    --surface: rgba(255, 255, 255, .85);
    --surface-solid: #ffffff;
    --surface-2: #efeffd;
    --ink: #17153a;
    --muted: #636087;
    --line: rgba(23, 21, 58, .1);
    --brand: #4f46e5;
    --brand-2: #a855f7;
    --brand-ink: #ffffff;
    --brand-soft: rgba(99, 102, 241, .12);
    --link: #4338ca;
    --topbar-bg: rgba(245, 245, 255, .72);
    --topbar-ink: #17153a;
    --danger: #be123c;
    --danger-2: #f43f5e;
    --danger-soft: rgba(225, 29, 72, .1);
    --warn: #92400e;
    --warn-soft: rgba(245, 158, 11, .15);
    --ok: #047857;
    --ok-soft: rgba(16, 185, 129, .13);
    --info-soft: rgba(79, 70, 229, .07);
    --shadow: 0 1px 2px rgba(23, 21, 58, .05), 0 8px 24px -8px rgba(49, 46, 129, .18);
    --shadow-lift: 0 2px 4px rgba(23, 21, 58, .06), 0 18px 40px -12px rgba(79, 70, 229, .4);
    --map-filter: none;
}

:root {
    --radius: 16px;
    --radius-sm: 10px;
    --gradient: linear-gradient(135deg, var(--brand), var(--brand-2));
    --focus: 0 0 0 3px var(--surface-solid), 0 0 0 5px var(--brand-2);
    --ease: cubic-bezier(.2, .8, .2, 1);
    font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "SF Pro Text", Roboto, "Helvetica Neue", sans-serif;
    color: var(--ink);
    background: var(--bg);
}

/* ==========================================================================
   Base
   ========================================================================== */
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; min-height: 100vh; -webkit-font-smoothing: antialiased; }

/* Soft colored glows behind everything. */
.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none;
            background:
                radial-gradient(40rem 30rem at 8% -8%, var(--glow-1), transparent 70%),
                radial-gradient(36rem 28rem at 100% 10%, var(--glow-2), transparent 70%),
                radial-gradient(50rem 30rem at 50% 115%, var(--glow-1), transparent 70%),
                var(--bg); }

h1, h2, h3 { font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "SF Pro Display", Roboto, sans-serif;
             letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); font-weight: 750; margin: .25rem 0 1rem;
     background: linear-gradient(120deg, var(--ink) 30%, var(--brand) 75%, var(--brand-2));
     -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-size: 1.15rem; font-weight: 700; margin: 1.25rem 0 .75rem; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
::selection { background: var(--brand-soft); }

/* ==========================================================================
   Top bar
   ========================================================================== */
.topbar { position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; justify-content: space-between;
          gap: 1rem; padding: .7rem clamp(1rem, 3vw, 2rem); flex-wrap: wrap;
          background: var(--topbar-bg); color: var(--topbar-ink);
          backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
          border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.15rem;
         letter-spacing: -.02em; text-decoration: none; color: var(--topbar-ink); }
.brand-mark { width: 34px; height: 34px; padding: 5px; border-radius: 10px; color: #fff;
              background: var(--gradient); box-shadow: 0 6px 16px -6px var(--brand); }
.brand:hover .brand-mark path { transform-origin: 32px 32px; animation: tick 1.2s var(--ease); }
@keyframes tick { to { transform: rotate(360deg); } }

.topbar-right { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.nav { display: flex; gap: .25rem; align-items: center; flex-wrap: wrap;
       padding: .25rem; border-radius: 999px; background: var(--brand-soft); }
.nav a, .nav .nav-logout { font: inherit; font-weight: 600; font-size: .92rem; padding: .4rem .9rem; border-radius: 999px;
                           color: var(--topbar-ink); text-decoration: none; background: none; border: 0; cursor: pointer;
                           transition: background-color .2s, color .2s; }
.nav a:hover, .nav .nav-logout:hover { background: var(--surface-solid); }
.nav a[aria-current="page"] { background: var(--gradient); color: var(--brand-ink); box-shadow: 0 6px 14px -6px var(--brand); }
.nav .nav-logout { color: var(--muted); }

/* Theme picker */
.theme-menu { position: relative; }
.theme-menu summary { list-style: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px;
                      cursor: pointer; color: var(--topbar-ink); background: var(--brand-soft); transition: transform .2s var(--ease); }
.theme-menu summary::-webkit-details-marker { display: none; }
.theme-menu summary:hover { transform: rotate(-12deg) scale(1.06); }
.theme-menu summary svg { width: 20px; height: 20px; }
.theme-list { position: absolute; right: 0; top: calc(100% + .5rem); width: 250px; padding: .4rem; display: grid; gap: .2rem;
              background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--radius);
              box-shadow: var(--shadow-lift); animation: pop .18s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.theme-choice { display: flex; align-items: center; gap: .75rem; width: 100%; text-align: left; padding: .55rem .6rem;
                background: none; border: 1px solid transparent; color: var(--ink); font-weight: 400; border-radius: 12px; box-shadow: none; }
.theme-choice:hover { background: var(--surface-2); transform: none; box-shadow: none; }
.theme-choice[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.theme-choice strong { display: block; font-size: .95rem; }
.theme-choice small { color: var(--muted); }
.swatch { flex: none; width: 34px; height: 34px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.swatch-evergreen { background: linear-gradient(135deg, #f3f7f6 0 38%, #0f766e 38% 70%, #14b8a6 70%); }
.swatch-midnight { background: linear-gradient(135deg, #070b16 0 38%, #06b6d4 38% 70%, #8b5cf6 70%); }
.swatch-sunset { background: linear-gradient(135deg, #fff8f3 0 38%, #e8590c 38% 70%, #e64980 70%); }
.swatch-royal { background: linear-gradient(135deg, #f5f5ff 0 38%, #4f46e5 38% 70%, #a855f7 70%); }

/* ==========================================================================
   Layout and surfaces
   ========================================================================== */
.page { max-width: 1080px; margin: 0 auto; padding: clamp(1rem, 3vw, 2rem); animation: rise .45s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
        padding: clamp(1rem, 2.5vw, 1.6rem); margin-bottom: 1.25rem; box-shadow: var(--shadow);
        backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.card > h2:first-child, .card > .entry-head:first-child h2 { margin-top: 0; }
.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }

/* Sign-in pages: centered card with a gradient top edge. */
.page > .card.narrow { margin-top: clamp(1rem, 8vh, 5rem); position: relative; overflow: hidden; }
.page > .card.narrow::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--gradient); }
.auth-intro { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.auth-intro .brand-mark { width: 46px; height: 46px; padding: 7px; border-radius: 14px; }
.auth-intro h1 { margin: 0; }
.auth-intro p { margin: .1rem 0 0; color: var(--muted); }

/* ==========================================================================
   Forms
   ========================================================================== */
label { display: block; font-weight: 600; font-size: .92rem; margin: .9rem 0 .35rem; }
.hint { font-weight: 400; color: var(--muted); font-size: .9rem; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); padding: .65rem .8rem;
                          border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-solid);
                          transition: border-color .2s, box-shadow .2s; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
input[type="checkbox"] { width: 1.15rem; height: 1.15rem; margin: 0 .6rem 0 0; accent-color: var(--brand); flex: none; }
.check { display: flex; align-items: center; font-weight: 400; cursor: pointer; }

button, .button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 650;
                  padding: .65rem 1.2rem; border-radius: 999px; border: 1px solid transparent; background: var(--gradient);
                  color: var(--brand-ink); cursor: pointer; text-decoration: none; text-align: center;
                  box-shadow: 0 8px 18px -10px var(--brand);
                  transition: transform .15s var(--ease), box-shadow .2s var(--ease), filter .2s; }
button:hover, .button:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -10px var(--brand); filter: brightness(1.05); }
button:active, .button:active { transform: translateY(0) scale(.98); }
button.secondary, .button.secondary { background: var(--surface-solid); color: var(--link); border-color: var(--line); box-shadow: var(--shadow); }
button.secondary:hover, .button.secondary:hover { border-color: var(--brand); }
button.danger { background: linear-gradient(135deg, var(--danger), var(--danger-2)); box-shadow: 0 8px 18px -10px var(--danger); }
button.link { background: none; border: none; padding: 0; font-weight: 500; text-decoration: underline; color: var(--link);
              box-shadow: none; border-radius: 4px; }
button.link:hover { transform: none; box-shadow: none; }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; filter: grayscale(.3); }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }
.actions > input { flex: 1 1 14rem; width: auto; }

.message { padding: .75rem 1rem; border-radius: var(--radius-sm); margin: .75rem 0; border-left: 4px solid currentColor;
           animation: rise .3s var(--ease); }
.message:empty { display: none; }
.message.error { background: var(--danger-soft); color: var(--danger); }
.message.ok { background: var(--ok-soft); color: var(--ok); }
.message.info { background: var(--info-soft); color: var(--ink); border-left-color: var(--brand); }

/* ==========================================================================
   Tiles (Manage home)
   ========================================================================== */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.tile { position: relative; display: block; overflow: hidden; background: var(--surface); border: 1px solid var(--line);
        border-radius: var(--radius); padding: 1.2rem; text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
        transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; }
.tile::after { content: ""; position: absolute; inset: auto -30% -60% auto; width: 160px; height: 160px; border-radius: 50%;
               background: var(--gradient); opacity: .08; transition: opacity .25s, transform .4s var(--ease); }
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: color-mix(in srgb, var(--brand) 45%, transparent); }
.tile:hover::after { opacity: .18; transform: scale(1.3); }
.tile-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; margin-bottom: .8rem;
             background: var(--gradient); color: #fff; box-shadow: 0 8px 18px -8px var(--brand); }
.tile-icon svg { width: 22px; height: 22px; }
.tile strong { display: block; margin-bottom: .25rem; font-size: 1.05rem; color: var(--ink); }
.tile span { color: var(--muted); font-size: .93rem; }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
              box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .7rem .85rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700;
     background: var(--surface-2); }
tbody tr { transition: background-color .15s; }
tbody tr:hover td { background: var(--brand-soft); }
tbody tr:last-child td { border-bottom: 0; }
tr.inactive td { color: var(--muted); }
td button { padding: .35rem .8rem; font-size: .85rem; }

.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 700; padding: .18rem .6rem;
         border-radius: 999px; background: var(--brand-soft); color: var(--link); margin: 0 .25rem .2rem 0; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }

.hidden { display: none !important; }

/* ==========================================================================
   Worker clock
   ========================================================================== */
body.clock .page { max-width: 500px; }
#clock-page { text-align: center; padding: 2rem 1.5rem; }
#clock-page label, #clock-page select { text-align: left; }
.status { font-size: 1.05rem; margin-bottom: 1rem; color: var(--muted); }
.status strong { display: block; font-size: 1.5rem; color: var(--ink); letter-spacing: -.01em; }
.timer { font-size: clamp(2.6rem, 10vw, 3.6rem); font-variant-numeric: tabular-nums; font-weight: 800; margin: .25rem 0 1rem;
         letter-spacing: -.03em; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
#clock-page .actions { justify-content: center; margin-top: 1.5rem; }
.clock-button { width: min(15rem, 70vw); aspect-ratio: 1; font-size: 1.5rem; padding: 1rem; border-radius: 50%;
                box-shadow: 0 0 0 10px var(--brand-soft), 0 24px 50px -14px var(--brand); }
.clock-button:hover { transform: scale(1.03); box-shadow: 0 0 0 14px var(--brand-soft), 0 28px 60px -14px var(--brand); }
.clock-button.out { background: linear-gradient(135deg, var(--danger), var(--danger-2)); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 8px var(--danger-soft), 0 24px 50px -14px var(--danger); }
    50% { box-shadow: 0 0 0 20px transparent, 0 24px 50px -14px var(--danger); }
}
#retry-button { margin-top: .5rem; }

/* ==========================================================================
   Maps
   ========================================================================== */
.map { height: 380px; border-radius: var(--radius); border: 1px solid var(--line); margin: 1rem 0; overflow: hidden;
       box-shadow: var(--shadow); z-index: 0; }
.map .leaflet-tile-pane { filter: var(--map-filter); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface-solid); color: var(--ink); box-shadow: var(--shadow-lift); }
.leaflet-popup-content-wrapper { border-radius: 12px; }
.results { list-style: none; padding: 0; margin: .5rem 0; }
.results li button { width: 100%; justify-content: flex-start; text-align: left; background: var(--surface-solid); color: var(--ink);
                     border: 1px solid var(--line); font-weight: 400; margin-bottom: .3rem; border-radius: var(--radius-sm); box-shadow: none; }
.results li button:hover { border-color: var(--brand); background: var(--brand-soft); }

/* ==========================================================================
   My time, timesheets, change log
   ========================================================================== */
.entry { border-bottom: 1px solid var(--line); padding: .85rem 0; }
.entry:last-child { border-bottom: 0; }
.entry-head { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; align-items: baseline; }
.history { margin: .5rem 0 0; padding-left: 1rem; color: var(--muted); font-size: .9rem; border-left: 2px solid var(--brand-soft); list-style: none; }
.history li { padding: .15rem 0 .15rem .5rem; }

.live-head { align-items: center; }
.live-head h2::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: .55rem; border-radius: 50%;
                        background: var(--ok); vertical-align: middle; animation: blink 1.8s ease-in-out infinite; }
@keyframes blink { 50% { box-shadow: 0 0 0 6px var(--ok-soft); opacity: .7; } }
tr.flagged td { background: var(--warn-soft); }
td.empty { color: var(--muted); text-align: center; padding: 2rem; }
.map-unavailable { margin: .75rem 0; padding: .9rem 1rem; border: 1px dashed var(--line); border-radius: var(--radius); }
.popup-flags { color: var(--warn); font-weight: 600; margin-top: .25rem; }

.person { margin-bottom: 1rem; }
.person-head { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; align-items: baseline; }
.person-head h2 { margin: 0 0 .4rem; }
.person-totals { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; background: var(--surface-2);
                 padding: .2rem .7rem; border-radius: 999px; font-size: .9rem; }
.week-nav { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; padding: .4rem;
            width: fit-content; max-width: 100%; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
            box-shadow: var(--shadow); }
.week-nav strong { margin: 0 .6rem; font-variant-numeric: tabular-nums; }
.week-nav button.link { margin: 0 .6rem 0 .2rem; }
.entry.deleted { opacity: .55; text-decoration: line-through; }
.filters { display: flex; gap: .9rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; padding: 1rem 1.1rem;
           border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.filters > div { flex: 1 1 12rem; }
.filters label { margin: 0 0 .35rem; }
.approve-hint { align-self: center; }

@media (max-width: 600px) {
    .page { padding: .9rem; }
    .topbar { padding: .6rem .9rem; }
    .nav a, .nav .nav-logout { padding: .35rem .65rem; font-size: .88rem; }
    th:nth-child(n+4), td:nth-child(n+4) { display: none; }
    .week-nav { border-radius: var(--radius); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ==========================================================================
   Company branding
   ========================================================================== */
.company { display: inline-flex; align-items: center; gap: .55rem; margin-right: auto; padding-left: 1rem;
           border-left: 1px solid var(--line); min-width: 0; }
.company-logo { height: 34px; max-width: 120px; object-fit: contain; border-radius: 8px; }
.company-name { font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 16rem; }
.logo-card h2 { margin-top: 0; }
.logo-row { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.logo-row > div:last-child { flex: 1 1 16rem; }
.logo-preview { display: grid; place-items: center; width: 140px; height: 96px; padding: .6rem; border-radius: var(--radius);
                border: 1px dashed var(--line); background: var(--surface-2); }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.file-button { margin: 0; font-size: 1rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.file-button:has(+ .visually-hidden:focus-visible) { box-shadow: var(--focus); }
.theme-note { margin: .2rem .5rem .4rem; font-size: .8rem; color: var(--muted); }
@media (max-width: 600px) { .company-name { display: none; } .company { padding-left: .6rem; } }

/* ==========================================================================
   Shift notes, photos and videos
   ========================================================================== */
.shift-extras h2 { margin-top: 0; }
.shift-extras .file-button { gap: .4rem; }
.upload-progress { display: flex; align-items: center; gap: .75rem; margin-top: .75rem; font-size: .9rem; color: var(--muted); }
.upload-progress progress { flex: 1; height: 10px; appearance: none; border: 0; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.upload-progress progress::-webkit-progress-bar { background: var(--surface-2); }
.upload-progress progress::-webkit-progress-value { background: var(--gradient); border-radius: 999px; }
.upload-progress progress::-moz-progress-bar { background: var(--gradient); border-radius: 999px; }
.attachments { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: .75rem;
               grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.attachment { background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem;
              display: flex; flex-direction: column; gap: .45rem; animation: rise .3s var(--ease); }
.attachment-note { grid-column: 1 / -1; }
.attachment-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.attachment-head .link { margin-left: auto; font-size: .85rem; }
.attachment-head .badge { margin: 0; }
.note-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.attachment-media { display: block; width: 100%; border-radius: 8px; overflow: hidden; background: #000; }
.attachment-media img, video.attachment-media { display: block; width: 100%; max-height: 260px; object-fit: cover; }
video.attachment-media { object-fit: contain; }
.entry .attachments { margin: .5rem 0; }
.check-hint { margin: .2rem 0 0 1.75rem; }

/* Breaks */
#clock-page .actions { flex-direction: column; align-items: center; }
.break-button { min-width: 12rem; }
.break-button.on-break { animation: pulse-soft 2.4s ease-in-out infinite; }
@keyframes pulse-soft { 50% { box-shadow: 0 0 0 10px var(--brand-soft), 0 8px 18px -10px var(--brand); } }
.timer.paused { opacity: .5; }

/* ==========================================================================
   Face check
   ========================================================================== */
.face-policy { margin: .4rem 0 0 1.75rem; padding: .6rem .8rem; border-radius: var(--radius-sm); background: var(--warn-soft); }
.face-panel h2 { margin-top: 0; }
.face-notice { white-space: pre-wrap; font-size: .92rem; line-height: 1.55; padding: .8rem 1rem; border-radius: var(--radius-sm);
               background: var(--surface-2); border-left: 3px solid var(--brand); max-height: 16rem; overflow: auto; }
.face-enrolled { display: flex; gap: 1rem; align-items: center; }
.face-enrolled img { width: 72px; height: 72px; object-fit: cover; border-radius: 50%; border: 3px solid var(--brand-soft); flex: none; }
.face-enrolled p { margin: .2rem 0; }
.camera-dialog { width: min(34rem, calc(100vw - 2rem)); padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius);
                 background: var(--surface-solid); color: var(--ink); box-shadow: var(--shadow-lift); text-align: center; }
.camera-dialog::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); }
.camera-dialog h2 { margin-top: 0; }
.camera-dialog .actions { justify-content: center; }
.camera-frame { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.camera-video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }   /* mirror, like a mirror */
.camera-oval { position: absolute; inset: 10% 26%; border: 3px dashed rgba(255, 255, 255, .8); border-radius: 50%;
               box-shadow: 0 0 0 999px rgba(0, 0, 0, .25); pointer-events: none; }
.camera-shoot { min-width: 14rem; }
.face-tiles { display: flex; gap: .75rem; flex-wrap: wrap; margin: .5rem 0; }
.face-tiles:empty { display: none; }
.face-tile { margin: 0; width: 140px; }
.face-tile img { width: 140px; height: 140px; object-fit: cover; border-radius: var(--radius-sm); border: 3px solid var(--line); display: block; }
.face-tile.ok img { border-color: var(--ok); }
.face-tile.warn img { border-color: var(--warn); }
.face-tile figcaption { font-size: .8rem; color: var(--muted); margin-top: .3rem; }

/* Confirm-your-email banner on Manage */
.banner { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.25rem; padding: .8rem 1rem;
          border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--ink); border: 1px solid var(--line);
          border-left: 4px solid var(--warn); }
.banner button { padding: .4rem .9rem; font-size: .88rem; }

/* ==========================================================================
   Public website (home, signup, trade pages)
   ========================================================================== */
.auth-links { display: flex; align-items: center; gap: .4rem; }
.auth-links > a:not(.button) { font-weight: 600; font-size: .92rem; padding: .4rem .8rem; border-radius: 999px;
                               color: var(--topbar-ink); text-decoration: none; }
.auth-links > a:not(.button):hover { background: var(--brand-soft); }
.auth-links .button { padding: .45rem 1rem; font-size: .92rem; }

.signup-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .8rem; }
.signup-form .actions .button, .signup-form .actions button { width: 100%; }
.fine-print { margin: .75rem 0 0; }
.narrow.wide { max-width: 620px; }
/* Hidden from people, visible to bots. */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

body.marketing .page { max-width: 1160px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem);
        align-items: start; padding: clamp(.5rem, 3vw, 2rem) 0 clamp(1.5rem, 4vw, 3rem); }
.hero-copy h1 { font-size: clamp(2.2rem, 1.4rem + 3.4vw, 3.6rem); line-height: 1.05; margin: .4rem 0 1rem; }
.eyebrow { display: inline-block; margin: 0; padding: .25rem .8rem; border-radius: 999px; font-size: .82rem; font-weight: 700;
           background: var(--brand-soft); color: var(--link); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 34rem; }
.ticks { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: .6rem; }
.ticks li { position: relative; padding-left: 1.9rem; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .2rem; width: 1.15rem; height: 1.15rem; border-radius: 50%;
                    background: var(--gradient); }
.ticks li::after { content: ""; position: absolute; left: .4rem; top: .42rem; width: .28rem; height: .5rem;
                   border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(40deg); }
.hero-form { margin: 0; position: relative; overflow: hidden; scroll-margin-top: 5rem; }
.hero-form::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--gradient); }
.hero-form > h2 { margin-top: .4rem; }

.band { padding: clamp(1.5rem, 4vw, 3rem) 0; }
.band-title { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem); text-align: center; margin: 0 0 1.75rem; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem;
           box-shadow: var(--shadow); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.feature .tile-icon { margin-bottom: .9rem; }
.feature h3 { margin: 0 0 .35rem; font-size: 1.08rem; }
.feature p { margin: 0; color: var(--muted); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.steps li { display: grid; gap: .35rem; align-content: start; background: var(--surface); border: 1px solid var(--line);
            border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); }
.steps li > span:last-child { color: var(--muted); }
.step-no { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; font-weight: 800;
           color: var(--brand-ink); background: var(--gradient); box-shadow: 0 8px 18px -8px var(--brand); }

.cta { text-align: center; padding: clamp(2rem, 5vw, 3.5rem) 1rem; margin: 1rem 0 2rem; border-radius: var(--radius);
       background: var(--gradient); color: var(--brand-ink); box-shadow: var(--shadow-lift); }
.cta h2 { margin: 0 0 .4rem; font-size: clamp(1.4rem, 1rem + 1.6vw, 2rem); }
.cta p { margin: 0 0 1.2rem; opacity: .92; }
.cta .button { background: var(--surface-solid); color: var(--link); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .5); }

.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 1rem 2rem; flex-wrap: wrap;
               padding: 1.5rem 0 .5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; }
.site-footer strong { color: var(--ink); margin-right: .5rem; }
.site-footer nav { display: flex; gap: .4rem 1.1rem; flex-wrap: wrap; }

@media (max-width: 860px) {
    .hero { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .signup-form .two { grid-template-columns: 1fr; }
    .auth-links > a:not(.button) { padding: .4rem .5rem; }
}

/* ==========================================================================
   Platform admin
   ========================================================================== */
body.admin .page { max-width: 1280px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 1rem; align-items: end; }
.filters label { margin-top: .4rem; }
.filters .actions { margin-top: .4rem; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
