/* The staff time off page. Colours and fonts are the Nios design system's tokens. Phone first; on a wide screen it
   stays a phone-width column. */
:root {
  --sapphire: #082341;
  --ivory: #FDFAF7;
  --champagne: #F0D6B4;
  --outline: #DCC2AC;
  --gold: #D2971A;
  --sapphire-2: #4B5E75;
  --wash: #F9EFE3;

  --surface: var(--ivory);
  --fg: var(--sapphire);
  --muted: var(--sapphire-2);
  --line: var(--outline);
  --faint: color-mix(in oklab, var(--outline) 48%, var(--ivory));
  --mark: var(--gold);
  --mark-tint: color-mix(in oklab, var(--gold) 16%, var(--ivory));
  --toast-muted: color-mix(in oklab, var(--ivory) 76%, var(--sapphire));
  --dim: color-mix(in oklab, var(--sapphire-2) 58%, var(--ivory)); /* B: the pale numbers of days that cannot be booked */
  --shadow: 0 24px 48px -22px color-mix(in oklab, var(--sapphire) 26%, transparent);
  --shadow-up: 0 -24px 48px -24px color-mix(in oklab, var(--sapphire) 30%, transparent);
  --ease: cubic-bezier(.16, 1, .3, 1);

  --display: 'Bacasime Antique', Georgia, 'Times New Roman', serif;
  --text: 'Inter', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --col: 520px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--surface); }
body { margin: 0; touch-action: manipulation; min-height: 100vh; background: var(--surface); color: var(--fg); font-family: var(--text); font-size: 14.5px; line-height: 1.45; -webkit-font-smoothing: antialiased; caret-color: var(--sapphire); }
::selection { background: var(--champagne); color: var(--sapphire); }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--mark); outline-offset: 2px; }
h1, h2 { font-family: var(--display); font-weight: 400; margin: 0; text-wrap: balance; line-height: 1.15; }
p { margin: 0; }
[hidden] { display: none !important; }
.gx { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
main { max-width: calc(var(--col) + 32px); margin: 0 auto; }
.scroll { padding: 22px 0 48px; }

/* the test band */
.band { position: sticky; top: 0; z-index: 30; background: var(--gold); color: var(--sapphire); font-size: 13px; font-weight: 600; text-align: center; padding: calc(6px + env(safe-area-inset-top, 0px)) 16px 6px; }

/* buttons and links */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; border: 1.5px solid var(--sapphire); background: var(--sapphire); color: var(--ivory); font-weight: 600; font-size: 15px; padding: 8px 22px; min-height: 44px; transition: background .3s var(--ease), transform .3s var(--ease); }
.btn:hover { background: color-mix(in oklab, var(--sapphire) 86%, var(--ivory)); }
.btn:active { transform: scale(.98); }
.btn.sec { background: none; color: var(--sapphire); }
.btn.sec:hover { background: var(--wash); }
.btn.big { width: 100%; min-height: 52px; font-size: 16.5px; box-shadow: var(--shadow); }
.btn[disabled] { opacity: .55; cursor: default; }
.linkbtn { background: none; border: 0; padding: 0; min-height: 44px; color: var(--fg); font-weight: 600; font-size: 15px; text-decoration: underline; text-decoration-color: var(--mark); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.linkbtn:hover { text-decoration-thickness: 2.5px; }
.linkbtn.quiet { justify-self: center; padding: 0 18px; font-weight: 500; }
.icon-btn { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: none; display: grid; place-items: center; color: var(--fg); }
.icon-btn:hover { background: var(--wash); }

/* forms */
.fld { display: grid; gap: 6px; font-size: 14px; font-weight: 500; color: var(--muted); }
.fld input, .fld select { width: 100%; min-height: 48px; background: var(--surface); border: 1px solid var(--sapphire-2); border-radius: 12px; padding: 10px 12px; font-size: 17px; font-weight: 400; color: var(--fg); }
.fld textarea { width: 100%; min-height: 110px; background: var(--surface); border: 1px solid var(--sapphire-2); border-radius: 12px; padding: 10px 12px; font-size: 17px; font-weight: 400; color: var(--fg); resize: vertical; line-height: 1.4; }
.fld input.code { letter-spacing: .3em; font-variant-numeric: tabular-nums; font-size: 20px; }
.tick { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; font-size: 14px; color: var(--fg); padding: 6px 0; min-height: 44px; }
.tick input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--sapphire); }
.err { font-size: 14.5px; font-weight: 600; color: var(--fg); display: flex; gap: 8px; align-items: flex-start; }
.err::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--gold); }

/* sign-in */
.signin { padding: 40px 0 48px; display: grid; gap: 16px; max-width: 420px; margin: 0 auto; }
.signin .logo { width: 84px; height: auto; margin-bottom: 8px; }
.signin h1 { font-size: 34px; }
.signin .lead { font-size: 16px; }
.signin form { display: grid; gap: 14px; margin-top: 4px; }
.signin .small { font-size: 13.5px; color: var(--muted); }
.signin > .linkbtn { justify-self: start; }

/* screen headers */
.s-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.s-top h1 { font-size: 28px; }
.s-who { color: var(--muted); font-size: 14px; margin-top: 3px; }
.s-bar { display: flex; align-items: center; gap: 10px; margin: -6px 0 14px -6px; }
.s-bar h1 { font-size: 26px; }
/* an admin looking at someone's page: whose it is, and the way back */
.viewing { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin: 14px 0 0; padding: 2px 18px; border-radius: 999px; background: var(--wash); border: 1px solid var(--line); font-size: 15px; }
.viewing .icon-btn { background: var(--surface); }
.viewing .vl { color: var(--muted); }
.viewing b { font-weight: 600; }

/* the admin's list of people */
.list-h { font-family: var(--text); font-weight: 600; font-size: 17px; margin: 28px 0 8px; }
.people { display: grid; }
.person { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 60px; padding: 10px 6px; background: none; border: 0; border-bottom: 1px solid var(--faint); text-align: left; color: var(--fg); transition: background .3s var(--ease); }
.person:first-child { border-top: 1px solid var(--faint); }
.person:hover { background: var(--wash); }
.person .pl { display: grid; gap: 2px; }
.person .pn { font-weight: 600; font-size: 16px; }
.person .pj { color: var(--muted); font-size: 14px; }
.person .chev { color: var(--muted); flex: none; }

/* booking is paused */
.paused { margin: 16px 0 14px; padding: 14px 16px; border-radius: 18px; border: 1.5px solid var(--gold); background: var(--mark-tint); font-size: 15.5px; font-weight: 500; }
.sheet .paused { margin: 4px 0 0; }

/* sections */
section.sec { margin-top: 28px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.sec-h h2 { font-family: var(--text); font-weight: 600; font-size: 17px; letter-spacing: -.01em; }

/* rows: booked days and lists */
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 58px; padding: 8px 0; border-bottom: 1px solid var(--faint); font-size: 16px; }
.row .d { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row .w { color: var(--muted); font-size: 14px; }
.row .rt { text-align: right; max-width: 170px; font-size: 13px; line-height: 1.3; }
.row .linkbtn { white-space: nowrap; flex: none; }
.empty { color: var(--muted); font-size: 14.5px; display: flex; align-items: center; gap: 12px; padding: 14px 2px; }
.empty::before { content: ""; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--wash) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23082341' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 10.4l3 3 6-6.6'/%3E%3C/svg%3E") center / 18px no-repeat; }

/* notices */
.offer { margin-top: 20px; border: 1.5px solid var(--gold); background: var(--mark-tint); border-radius: 18px; padding: 14px 16px; display: grid; gap: 6px; font-size: 15px; }
.offer b { font-size: 16.5px; font-weight: 600; }
.offer .acts { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 18px; margin-top: 10px; }
.offer .btn { padding-inline: 28px; }
.offer span { color: var(--fg); }
.notice { margin-top: 14px; border: 1px solid var(--line); border-radius: 18px; padding: 10px 16px; min-height: 58px; font-size: 15px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.notice .linkbtn { flex: none; }

.foot { margin-top: 22px; display: grid; justify-items: start; gap: 2px; }
.foot .small { color: var(--muted); font-size: 13.5px; margin-top: 10px; }

/* book a day off */
.intro { color: var(--muted); font-size: 14.5px; margin-bottom: 14px; }
.ytabs { display: flex; gap: 8px; margin-bottom: 12px; }
.mchips { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 18px; }
.mchip, .ytab { min-height: 44px; min-width: 0; padding: 0 2px; border-radius: 999px; border: 1px solid var(--line); background: none; font-size: 14px; font-weight: 500; color: var(--fg); white-space: nowrap; transition: background .3s var(--ease); }
.ytab { padding: 0 18px; }
.mchip:hover, .ytab:hover { background: var(--wash); }
.mchip[aria-pressed="true"], .ytab[aria-pressed="true"] { background: var(--sapphire); border-color: var(--sapphire); color: var(--ivory); font-weight: 600; }
.mname { font-family: var(--text); font-weight: 600; font-size: 18.5px; margin: 4px 0 10px; }
.daylist { display: grid; gap: 8px; }

.stopline { margin: 0 0 14px; padding: 12px 16px; border-radius: 18px; background: var(--wash); border: 1px solid var(--line); font-size: 15px; font-weight: 500; }

/* ---------- the figures, the calendar and the year ---------- */
/* text only a screen reader reads */
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* the small "i" beside a heading or label; 44px to tap, drawn as a 19px mark */
.ibtn { display: inline-grid; place-items: center; width: 44px; height: 44px; margin: -12px -10px -12px 0; padding: 0; border: 0; background: none; color: var(--muted); border-radius: 50%; vertical-align: middle; }
.ibtn:hover { color: var(--fg); background: var(--wash); }

/* the year control at the top of home */
.yseg { display: flex; gap: 6px; margin-top: 18px; }
.ychip { min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line); background: none; font-size: 15px; font-weight: 500; color: var(--fg); font-variant-numeric: tabular-nums; transition: background .3s var(--ease); }
.ychip:hover { background: var(--wash); }
.ychip[aria-pressed="true"] { background: var(--sapphire); border-color: var(--sapphire); color: var(--ivory); font-weight: 600; }
/* both years together, side by side */
.sums { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 22px; padding: 16px 0 14px; border-top: 1px solid var(--faint); border-bottom: 1px solid var(--faint); }
.sum { display: grid; align-content: start; gap: 1px; min-width: 0; }
.sum .sy { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.sum .mid { font-size: 34px; line-height: 1.05; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.sum .lab { color: var(--muted); font-size: 14.5px; }
.sum .sub { color: var(--muted); font-size: 13px; line-height: 1.35; margin-top: 3px; }
.hero-m .hours { color: var(--muted); font-size: 13.5px; line-height: 1.4; margin-top: 4px; }
/* a figure not known yet (2027's sick hours before payroll sets them): words in place of a numeral, never a zero */
.pair .mid.soon { font-size: 22px; line-height: 1.55; letter-spacing: -.01em; }
/* the year to book: one large figure, its bar and key, then two side by side, then quiet rows */
.figs .sec-h { margin-bottom: 0; }
.figs .sec-h .fig { font-size: .84em; font-weight: 500; font-variant-numeric: tabular-nums; }
.hero-m { display: grid; gap: 4px; padding: 8px 0 14px; }
.hero-m > div:first-child { display: grid; gap: 2px; }
.hero-m .big { font-size: 64px; line-height: 1; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.hero-m .lab { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-size: 14.5px; }
.vbar { display: flex; gap: 3px; margin: 10px 0 6px; }
.vbar i { flex: 1; height: 10px; border-radius: 3px; border: 1px solid var(--line); }
.vbar i.u { background: var(--sapphire); border-color: var(--sapphire); }
.vbar i.b { background: var(--gold); border-color: var(--gold); }
.vbar i.h { flex: .5; }
.key { display: inline-block; width: 8px; height: 8px; border-radius: 2px; border: 1px solid var(--line); margin-right: 5px; }
.key.u { background: var(--sapphire); border-color: var(--sapphire); }
.key.b { background: var(--gold); border-color: var(--gold); }
.bal-sub { grid-column: 1 / -1; color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.hero-m .bal-sub { display: flex; flex-wrap: wrap; gap: 2px 14px; }
.kitem { white-space: nowrap; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 18px 0 16px; border-top: 1px solid var(--faint); border-bottom: 1px solid var(--faint); }
.pair.one { grid-template-columns: 1fr; } /* 2027's sick hours are unknown until payroll pays that year */
.pair .mid { display: block; font-size: 34px; line-height: 1.05; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pair .lab { display: block; color: var(--muted); font-size: 14.5px; }
.pair .lab .ibtn { vertical-align: middle; }
.pair .sub { display: block; color: var(--muted); font-size: 13.5px; }
.bal-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; padding: 18px 0 16px; border-bottom: 1px solid var(--faint); font-size: 16px; }
.bal-k { font-weight: 500; }
.bal-v { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fig-line { margin-top: 10px; font-size: 15px; }
.fig-line.small { font-size: 13.5px; color: var(--muted); }
/* the year payroll is still paying (December): quieter, under the year to book */
.figs.quiet .bal-row { font-size: 15px; padding: 11px 0; }
.seeyear { margin-top: 6px; }

/* "Book a day off" floats at the bottom over a fade; the page leaves room under its last row for it */
.scroll.has-cta { padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }
.cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: 24px max(16px, env(safe-area-inset-right, 0px)) calc(14px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: linear-gradient(to top, var(--surface) 64%, color-mix(in oklab, var(--surface) 0%, transparent)); pointer-events: none; }
.cta-in { max-width: var(--col); margin: 0 auto; pointer-events: auto; }

/* the month calendar */
.ckey { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.ckey span { display: inline-flex; align-items: center; gap: 6px; }
.ckey i { flex: none; width: 17px; height: 17px; border-radius: 5px; }
.ckey .k-open { background: var(--wash); border: 1px solid var(--line); }
.ckey .k-full { border: 1px dashed var(--sapphire-2); }
.ckey .k-mine { background: var(--sapphire); }
.dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; font-size: 11.5px; color: var(--muted); text-align: center; font-weight: 500; margin-bottom: 4px; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.day { position: relative; min-width: 0; height: 54px; border: 1px solid transparent; border-radius: 14px; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0; font-size: 16px; line-height: 1; color: var(--dim); font-variant-numeric: tabular-nums; transition: background .3s var(--ease), transform .3s var(--ease); }
button.day:active { transform: scale(.98); }
.day .t { font-size: 11px; font-weight: 600; line-height: 1; }
.day.off { color: var(--dim); }
.day.open { background: var(--wash); border-color: var(--line); color: var(--sapphire); font-weight: 600; }
.day.open:hover { background: var(--champagne); }
.day.full { border-color: var(--sapphire-2); border-style: dashed; color: var(--fg); }
.day.closed { border-color: var(--line); color: var(--fg); }
.day.mine { background: var(--sapphire); color: var(--ivory); font-weight: 600; }
.day.wait { border: 1.5px solid var(--sapphire-2); color: var(--sapphire); font-weight: 600; }
.day.offer-d { background: var(--gold); color: var(--sapphire); font-weight: 700; }
.day.other { border-color: var(--faint); color: var(--fg); }
.day.now::after { content: ""; position: absolute; bottom: 6px; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }
.hint { color: var(--muted); font-size: 13.5px; margin-top: 10px; }

/* "Your year" */
.mhead { font-size: 13px; font-weight: 600; color: var(--muted); padding: 18px 0 4px; }
.yrow { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--faint); font-size: 15px; }
.yrow .d { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.yrow.past .d { font-weight: 500; }
.yrow small { display: block; color: var(--muted); font-size: 13.5px; }

/* questions */
.qa { padding: 14px 0; border-bottom: 1px solid var(--faint); }
.qa h2 { font-family: var(--text); font-weight: 600; font-size: 16px; line-height: 1.3; margin-bottom: 4px; }
.qa p { font-size: 15px; max-width: 65ch; }

/* the sheet that rises from the bottom */
.sheet-wrap { position: fixed; inset: 0; z-index: 35; background: color-mix(in oklab, var(--sapphire) 42%, transparent); display: flex; align-items: flex-end; justify-content: center; animation: fade .18s ease-out; }
.sheet { width: 100%; max-width: calc(var(--col) + 48px); background: var(--surface); border-radius: 32px 32px 0 0; padding: 28px max(20px, env(safe-area-inset-right, 0px)) calc(22px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); display: grid; gap: 8px; box-shadow: var(--shadow-up); animation: rise .3s var(--ease); max-height: 90vh; overflow-y: auto; }
.sheet h2 { font-family: var(--text); font-weight: 600; font-size: 21px; line-height: 1.25; }
.sheet p { font-size: 16px; }
.sheet .pay { font-weight: 600; }
.sheet p.small { font-size: 14.5px; color: var(--muted); }
.sheet .acts { display: grid; gap: 8px; margin-top: 12px; }

/* the toast */
.toast { position: fixed; z-index: 36; left: 12px; right: 12px; max-width: var(--col); margin: 0 auto; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); background: var(--sapphire); color: var(--ivory); border-radius: 18px; padding: 13px 16px; font-size: 15px; font-weight: 500; box-shadow: var(--shadow); animation: rise .26s var(--ease); display: grid; gap: 3px; }
.toast small { font-weight: 400; font-size: 13.5px; color: var(--toast-muted); }
/* on a screen with no floating button the toast sits low */
.toast.low { bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }

/* loading */
.skel { display: grid; gap: 16px; padding: 28px 0 40px; }
.skel i { display: block; position: relative; overflow: hidden; height: 18px; border-radius: 9px; background: var(--faint); }
.skel i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--wash), transparent); transform: translateX(-100%); animation: sweep 1.1s var(--ease) infinite; }
.skel i.h { height: 34px; width: 36%; }
.skel i.w60 { width: 60%; }
.skel i.w80 { width: 80%; }
.skel i.box { height: 150px; border-radius: 24px; }
.skel.sm { padding: 8px 0; }
.skel.sm i.box { height: 60px; }

.failbox { display: grid; gap: 14px; justify-items: start; padding: 28px 0; }

@keyframes rise { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sweep { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* wide screens: the same column, with a little more air */
@media (min-width: 720px) {
  .scroll { padding-top: 48px; }
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 28px; }
}
