/* Runway. Mist, lake and schist: the colours of the place it was built for. */
:root {
  --bg: #EDF1F0; --surface: #F8FAF9; --ink: #14211F; --muted: #5C6E6B; --faint: #9DB0AC;
  --line: #D3DDDA; --track: #D9E3E0; --lake: #0E5A5C; --on-lake: #F6FBFA;
  --amber: #96580B; --red: #B1332A; --green: #0E6B4A;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0C1413; --surface: #121D1B; --ink: #E6EFEC; --muted: #93A9A5; --faint: #587470;
    --line: #223432; --track: #1D2E2C; --lake: #5CC4BC; --on-lake: #06201F;
    --amber: #E0A04A; --red: #F08A80; --green: #6FD1A0;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 "Avenir Next", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  font-variant-numeric: tabular-nums;
  padding-bottom: calc(78px + env(safe-area-inset-bottom));
}
#view { max-width: 560px; margin: 0 auto; padding: max(22px, env(safe-area-inset-top)) 20px 28px; }
h1, h2, p { margin: 0; }
h2 { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; margin: 34px 0 6px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.sub { font-size: 14px; color: var(--muted); }
.note { font-size: 14px; color: var(--muted); margin-top: 10px; max-width: 46ch; }
:focus-visible { outline: 3px solid var(--lake); outline-offset: 2px; }

/* hero */
.hero h1 {
  font-size: clamp(60px, 19vw, 88px); line-height: 1; font-weight: 700; letter-spacing: -0.045em; margin: 6px 0 4px;
}
.hero h1.over, .over { color: var(--red); }
.hero .lead { font-size: 18px; }

/* the cycle strip: one bar per day of the pay cycle */
.strip { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; align-items: end; height: 72px; margin: 22px 0 6px; }
.strip i { display: block; background: var(--lake); border-radius: 3px 3px 0 0; min-height: 4px; }
.strip i.future { background: none; border-top: 2px dotted var(--faint); min-height: 0; height: 0 !important; }
.strip i.today { background: var(--amber); }
.axis { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }

/* lists */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { padding: 13px 0; border-bottom: 1px solid var(--line); }
.line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.line b { font-weight: 650; }
.line .desc { min-width: 0; overflow-wrap: anywhere; }
b.watch, .watch-text { color: var(--amber); }
b.over { color: var(--red); }
.in { color: var(--green); }

.bar { position: relative; height: 7px; border-radius: 4px; background: var(--track); margin: 9px 0 5px; }
.bar b { display: block; height: 100%; border-radius: 4px; background: var(--lake); }
.bar.watch b { background: var(--amber); }
.bar.over b { background: var(--red); }
.bar s { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); opacity: .5; }

.group { font-size: 14px; color: var(--muted); padding: 22px 0 4px; border-bottom: 1px solid var(--line); }
.chip {
  font: inherit; font-size: 13px; line-height: 1.2; color: var(--muted); background: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; margin-top: 5px;
}
.chip.warn { color: var(--amber); border-color: var(--amber); }
.tag { font-size: 12px; color: var(--muted); border: 1px dashed var(--faint); border-radius: 4px; padding: 0 6px; margin-left: 6px; }
details { border-bottom: 1px solid var(--line); }
details > summary { list-style: none; display: flex; justify-content: space-between; padding: 13px 0; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details ul { list-style: none; margin: 0 0 12px; padding: 0 0 0 14px; border-left: 2px solid var(--track); }
details ul li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 15px; color: var(--muted); }

.status { margin-top: 14px; padding: 12px 14px; border-left: 4px solid var(--lake); background: var(--surface); }
.status.off { border-color: var(--red); }

/* forms */
label { display: block; font-size: 14px; color: var(--muted); margin: 14px 0 5px; }
input, select {
  font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; min-height: 44px; width: 100%;
}
.check { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); font-size: 15px; }
.check input { width: 20px; min-height: 20px; margin-top: 2px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.brow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.brow .wide, .grid2 .wide { grid-column: 1 / -1; }
.actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.btn {
  font: inherit; font-weight: 650; border: 1px solid transparent; border-radius: 10px; padding: 11px 18px; min-height: 44px;
  background: var(--lake); color: var(--on-lake); cursor: pointer;
}
.btn.quiet { background: none; color: var(--lake); border-color: var(--line); }
.btn.danger { background: none; color: var(--red); border-color: var(--line); }
.btn:disabled { opacity: .55; cursor: default; }
.err { color: var(--red); font-size: 14px; min-height: 20px; margin-top: 8px; }

/* tabs */
.tabs {
  position: fixed; inset: auto 0 0 0; z-index: 5; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--bg); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabs[hidden] { display: none; }
.tabs button {
  font: inherit; font-size: 14px; color: var(--muted); background: none; border: 0; cursor: pointer;
  padding: 16px 0 14px; position: relative;
}
.tabs button[aria-current="page"] { color: var(--ink); font-weight: 650; box-shadow: inset 0 3px 0 var(--lake); }

dialog { border: 0; border-radius: 16px; padding: 22px; width: calc(100% - 32px); max-width: 420px; background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(0, 0, 0, .5); }
#toast {
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 15px;
  max-width: calc(100% - 40px); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 10;
}
#toast.show { opacity: 1; }
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }

.login { max-width: 360px; margin: 14vh auto 0; }
.login h1 { font-size: 40px; letter-spacing: -0.04em; margin-bottom: 4px; }
