@font-face { font-family: 'Instrument Sans'; font-weight: 400; font-display: swap; src: url(/fonts/instrument-sans-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-weight: 500; font-display: swap; src: url(/fonts/instrument-sans-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-weight: 600; font-display: swap; src: url(/fonts/instrument-sans-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-weight: 700; font-display: swap; src: url(/fonts/instrument-sans-latin-700-normal.woff2) format('woff2'); }

:root {
  /* --accent and --on-accent are set from brand.json at start-up; these are the defaults. */
  --accent: #2a3cf0; --on-accent: #fff;
  --bg: #fafaf7; --card: #fff; --ink: #111110; --line: #e6e4dc; --muted: #6b6a63; --field: #d3d0c5;
  --green: #17734a; --green-bg: #e6f3ec; --amber: #86550a; --amber-bg: #fbf0d9; --red: #b3261e; --red-bg: #fbe9e7;
  --soft: #f3f2ec; --radius: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-variant-numeric: tabular-nums; color: var(--ink); background: var(--bg); padding-bottom: env(safe-area-inset-bottom); -webkit-font-smoothing: antialiased; }

/* Desktop-only drifting background. Kept faint and masked so it never competes with the content. */
.bgp { display: none; }
@media (min-width: 900px) {
  .bgp { display: block; position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
    -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 38%, #000 25%, transparent 78%); mask-image: radial-gradient(ellipse 75% 65% at 50% 38%, #000 25%, transparent 78%); }
  .bgp::before { content: ''; position: absolute; inset: -40px; background-image: radial-gradient(circle, rgba(17,17,16,.2) 1px, transparent 1.4px); background-size: 28px 28px; animation: drift 38s linear infinite; }
  .bgp i { position: absolute; left: -20%; width: 140%; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .32; transform: rotate(-9deg); animation: sweep 14s var(--ease) infinite; }
  .bgp i:nth-child(1) { top: 24%; } .bgp i:nth-child(2) { top: 52%; animation-delay: -5s; animation-duration: 18s; } .bgp i:nth-child(3) { top: 78%; animation-delay: -10s; animation-duration: 22s; }
}
@keyframes drift { to { transform: translate(28px, 28px); } }
@keyframes sweep { 0% { transform: translateX(-12%) rotate(-9deg); opacity: 0; } 20%, 80% { opacity: .32; } 100% { transform: translateX(12%) rotate(-9deg); opacity: 0; } }

a { color: var(--accent); text-underline-offset: 3px; } a:hover { text-decoration-thickness: 2px; }
.top, .nav, .view, .toasts { position: relative; z-index: 1; }
.top { background: rgba(250,250,247,.88); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.top-in { max-width: 920px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brandrow { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.5px; }
.brandrow svg, .brandrow img { display: block; width: 28px; height: 28px; }
.who-name { color: var(--muted); font-size: 14px; margin-right: 6px; }
.link { background: none; border: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--field); font: inherit; font-size: 14px; padding: 8px 4px; cursor: pointer; }
.link:hover { text-decoration-color: var(--accent); }
.nav { background: rgba(250,250,247,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); display: flex; overflow-x: auto; position: sticky; top: 0; z-index: 5; padding: 0 8px; }
.nav a { flex: 0 0 auto; color: var(--muted); text-decoration: none; padding: 13px 14px 11px; font-size: 15px; font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; transition: color .2s, border-color .25s var(--ease); }
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.view { max-width: 920px; margin: 0 auto; padding: 18px 16px 90px; }
.view > * { animation: up .5s var(--ease) both; }
.view > *:nth-child(2) { animation-delay: .04s; } .view > *:nth-child(3) { animation-delay: .08s; } .view > *:nth-child(4) { animation-delay: .12s; } .view > *:nth-child(5) { animation-delay: .16s; } .view > *:nth-child(n+6) { animation-delay: .2s; }
@keyframes up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.foot { position: relative; z-index: 1; text-align: center; color: var(--muted); font-size: 13px; padding: 0 16px 28px; }
.foot:empty { display: none; }

h1 { font-size: 26px; letter-spacing: -.8px; line-height: 1.15; margin: 4px 0 12px; font-weight: 700; } h2 { font-size: 18px; letter-spacing: -.3px; margin: 22px 0 8px; font-weight: 700; } h3 { font-size: 16px; margin: 0 0 6px; font-weight: 600; }
.muted { color: var(--muted); } .center { text-align: center; } .small-text { font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card.clickable { cursor: pointer; transition: border-color .2s, transform .2s var(--ease); } .card.clickable:hover { border-color: var(--ink); } .card.clickable:active { transform: scale(.995); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.btn { appearance: none; border: 1px solid var(--ink); background: transparent; color: var(--ink); border-radius: 12px; padding: 12px 18px; font: inherit; font-weight: 600; min-height: 48px; cursor: pointer; transition: transform .15s var(--ease), background .2s, box-shadow .2s, opacity .2s; }
.btn:hover { background: var(--soft); } .btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); } .btn.primary:hover { background: var(--accent); box-shadow: 0 6px 18px -6px var(--accent); transform: translateY(-1px); } .btn.primary:active { transform: scale(.98); }
.btn.good { background: var(--green); color: #fff; border-color: var(--green); } .btn.good:hover { background: var(--green); }
.btn.danger { color: var(--red); border-color: #e3bdb8; } .btn.danger:hover { background: var(--red-bg); }
.btn.ghost { border-color: var(--line); }
.btn.small { min-height: 40px; padding: 8px 14px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; } .btn-row .btn { flex: 1 1 140px; }
.badge { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge.grey { background: var(--soft); color: #4b4a44; } .badge.blue { background: color-mix(in srgb, var(--accent) 11%, #fff); color: var(--accent); }
.badge.amber { background: var(--amber-bg); color: var(--amber); } .badge.green { background: var(--green-bg); color: var(--green); }
.badge.red { background: var(--red-bg); color: var(--red); } .badge.dark { background: var(--ink); color: #fff; }
.flag { color: var(--red); font-weight: 700; font-size: 12.5px; }
.banner { padding: 12px 14px; border-radius: 12px; margin: 10px 0; font-size: 15px; border: 1px solid transparent; }
.banner.error { background: var(--red-bg); color: var(--red); } .banner.info { background: color-mix(in srgb, var(--accent) 8%, #fff); color: var(--ink); border-color: color-mix(in srgb, var(--accent) 22%, #fff); }
.banner.ok { background: var(--green-bg); color: var(--green); } .banner.warn { background: var(--amber-bg); color: var(--amber); }
label.field { display: block; margin: 10px 0; } label.field > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 11px 12px; border: 1px solid var(--field); border-radius: 12px; background: #fff; color: var(--ink); min-height: 48px; transition: border-color .2s, box-shadow .2s; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.btn:focus-visible, a:focus-visible, .chip:focus-visible, .link:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
input[type=checkbox] { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 10px; margin: 12px 0; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-decoration: none; color: inherit; transition: border-color .2s, transform .2s var(--ease); } .tile:hover { border-color: var(--ink); transform: translateY(-2px); }
.tile .num { font-size: 30px; font-weight: 700; letter-spacing: -1px; line-height: 1.1; } .tile .lbl { font-size: 13px; color: var(--muted); }
.tile.alert .num { color: var(--red); } .tile.good .num { color: var(--green); }
.weekpick { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; margin-bottom: 12px; }
.weekpick-label { text-align: center; display: flex; flex-direction: column; line-height: 1.25; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: top; } th { font-size: 12.5px; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; }
.scroll-x { overflow-x: auto; }
.day { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); margin-bottom: 10px; overflow: hidden; }
.day-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--soft); font-weight: 600; }
.day-body { padding: 4px 12px 12px; }
.erow { border-top: 1px dashed var(--line); padding: 10px 0; } .erow:first-child { border-top: 0; }
.hours-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0; }
.hours-grid label { font-size: 12px; color: var(--muted); font-weight: 600; } .hours-grid input { padding: 9px 6px; text-align: center; }
.totals { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; text-align: center; } .totals div { background: var(--soft); border-radius: 12px; padding: 9px 4px; }
.totals b { display: block; font-size: 18px; letter-spacing: -.3px; } .totals span { font-size: 12px; color: var(--muted); }
.totals .grand { background: var(--accent); color: var(--on-accent); } .totals .grand span { color: var(--on-accent); opacity: .8; }
.savebar { position: sticky; bottom: 0; background: rgba(250,250,247,.94); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); margin: 16px -16px -90px; display: flex; gap: 10px; align-items: center; backdrop-filter: blur(8px); }
.savebar .state { flex: 1; font-size: 13px; color: var(--muted); }

/* The week as a bar chart of hours */
.wk { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 10px; margin-bottom: 12px; }
.wk-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; } .wk-top b { font-size: 26px; letter-spacing: -.8px; } .wk-top span { color: var(--muted); font-size: 13px; }
.wk-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 84px; }
.wk-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 6px; }
.wk-bar { width: 100%; max-width: 34px; border-radius: 7px 7px 3px 3px; background: var(--accent); min-height: 3px; transform-origin: bottom; animation: grow .7s var(--ease) both; transition: height .35s var(--ease); }
.wk-col:nth-child(2) .wk-bar { animation-delay: .04s; } .wk-col:nth-child(3) .wk-bar { animation-delay: .08s; } .wk-col:nth-child(4) .wk-bar { animation-delay: .12s; } .wk-col:nth-child(5) .wk-bar { animation-delay: .16s; } .wk-col:nth-child(6) .wk-bar { animation-delay: .2s; } .wk-col:nth-child(7) .wk-bar { animation-delay: .24s; }
.wk-bar.zero { background: var(--line); }
.wk-lbl { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 6px; text-align: center; font-size: 12px; color: var(--muted); font-weight: 500; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.photo-thumb { max-width: 100%; max-height: 260px; border-radius: 12px; border: 1px solid var(--line); display: block; margin: 8px 0; cursor: zoom-in; }
.photo-large { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; }
.toasts { position: fixed; left: 0; right: 0; bottom: calc(14px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 50; pointer-events: none; padding: 0 12px; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; max-width: 520px; font-size: 15px; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: up .3s var(--ease) both; } .toast.error { background: var(--red); }
dialog.modal { border: 0; border-radius: 18px; padding: 0; width: min(94vw, 460px); max-height: 90vh; color: var(--ink); } dialog.modal.wide { width: min(96vw, 760px); }
dialog.modal[open] { animation: up .3s var(--ease) both; }
dialog.modal::backdrop { background: rgba(17,17,16,.5); } .modal-form { padding: 18px; } .modal-form h2 { margin-top: 0; }
.error-slot { color: var(--red); font-size: 14px; min-height: 1px; margin-top: 6px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 14px; white-space: nowrap; cursor: pointer; min-height: 40px; transition: border-color .2s, background .2s; } .chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); } .list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; } .list-row .title { font-weight: 600; }
.login { max-width: 420px; margin: 7vh auto 0; }
.login-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.login-brand svg, .login-brand img { width: 56px; height: 56px; display: block; }
.login-brand .nm { font-size: 44px; font-weight: 700; letter-spacing: -2.4px; line-height: 1; }
.login-brand p { margin: 0; color: var(--muted); font-size: 17px; }
.email-preview { white-space: pre-wrap; font-size: 13.5px; background: var(--soft); border-radius: 10px; padding: 10px; word-break: break-word; }
@media (min-width: 700px) { .view { padding-top: 28px; } .hours-grid { grid-template-columns: repeat(4, 110px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
