/* Kusa by Langa.
   Ink rail, white working surface, hairline registers. Gold means one thing:
   time worked and the action that starts it. It is never text on a light surface. */
:root {
  --ink: #1B1F3B; --ink-2: #2A2F55; --muted: #5A5F7A; --rule: #E4E1D8; --rule-2: #F0EEE7;
  --paper: #FFFFFF; --cream: #FFF8E7; --gold: #F5B301; --gold-deep: #DFA200; --amber: #A84B07;
  --lav: #B9BDD6; --bad: #B42318; --bad-bg: #FDECEA; --ok: #17663F; --ok-bg: #E4F3EA; --warn-bg: #FDEBC8;
  --head: "Bricolage Grotesque", "IBM Plex Sans", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--body); color: var(--ink); background: var(--paper); }
a { color: var(--amber); text-underline-offset: 2px; }
h1 { font-family: var(--head); font-weight: 700; font-size: 28px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 4px; }
h2 { font-family: var(--head); font-weight: 700; font-size: 19px; margin: 40px 0 10px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---- shell: ink rail + work area ---- */
body.app { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--ink); color: var(--cream); padding: 22px 0 18px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; padding: 0 22px; }
.brand img { display: block; border-radius: 8px; }
.word { font-family: var(--head); font-weight: 800; font-size: 25px; letter-spacing: -.03em; line-height: 1; }
.rail nav { display: flex; flex-direction: column; margin-top: 30px; flex: 1; }
.rail nav a { color: var(--lav); text-decoration: none; padding: 10px 22px; border-left: 3px solid transparent; display: flex; justify-content: space-between; align-items: center; }
.rail nav a:hover { color: var(--cream); }
.rail nav a[aria-current] { color: var(--cream); font-weight: 600; border-left-color: var(--gold); background: var(--ink-2); }
.rail nav a.mine { margin-top: 18px; }
.count { background: var(--gold); color: var(--ink); font-weight: 600; font-size: 12.5px; min-width: 22px; text-align: center; padding: 1px 6px; border-radius: 11px; }
.who { margin: 0; padding: 14px 22px 0; border-top: 1px solid var(--ink-2); font-size: 13.5px; }
.who .name { font-weight: 600; } .who .org { color: var(--lav); margin-bottom: 6px; }
.rail button.link { color: var(--cream); }
.work { padding: 34px 40px 60px; max-width: 1240px; width: 100%; }

@media (max-width: 820px) {
  body.app { display: block; }
  .rail { position: static; height: auto; padding: 12px 0 0; }
  .rail nav { flex-direction: row; flex-wrap: wrap; margin-top: 10px; }
  .rail nav a { padding: 9px 14px; border-left: 0; border-bottom: 3px solid transparent; }
  .rail nav a[aria-current] { border-bottom-color: var(--gold); }
  .rail nav a.mine { margin-top: 0; }
  .who { display: flex; gap: 12px; align-items: center; padding: 8px 14px; }
  .who .org { display: none; }
  .brand { padding: 0 14px; }
  .work { padding: 22px 16px 48px; }
}

/* ---- page furniture ---- */
.pagehead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px 24px; margin-bottom: 22px; }
.pagehead p { margin: 0; max-width: 62ch; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.notice { background: var(--ok-bg); color: var(--ok); padding: 9px 14px; border-radius: 6px; margin: 0 0 18px; font-weight: 500; }
.alert { background: var(--bad-bg); color: var(--bad); padding: 9px 14px; border-radius: 6px; }
.fielderror { color: var(--bad); margin: 5px 0 0; font-size: 13.5px; }
.empty { border-top: 2px solid var(--ink); padding: 22px 0; max-width: 60ch; }

/* ---- controls ---- */
label { display: block; font-weight: 600; margin: 16px 0 5px; }
label .muted { font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], select {
  width: 100%; min-height: 42px; padding: 8px 11px; border: 1px solid #A9A69B; border-radius: 6px; font: inherit; color: var(--ink); background: #fff; }
.filters input, .filters select { width: auto; }
input[type=range] { width: 100%; accent-color: var(--ink); }
button, .button { font: inherit; font-weight: 600; cursor: pointer; border-radius: 6px; min-height: 42px; padding: 8px 16px; border: 1px solid var(--ink); background: #fff; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
button:hover, .button:hover { background: var(--rule-2); }
.primary { background: var(--ink); color: var(--cream); }
.primary:hover { background: var(--ink-2); }
.wide { width: 100%; }
button.link { border: 0; background: none; padding: 0; min-height: 0; font-weight: inherit; color: var(--amber); text-decoration: underline; display: inline; }
button:disabled { opacity: .6; cursor: default; }
.check { font-weight: 400; display: flex; gap: 9px; align-items: flex-start; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.row.three { grid-template-columns: 1fr 1fr 1.2fr; }
.row.radius { grid-template-columns: 130px 1fr; align-items: center; }
@media (max-width: 600px) { .row, .row.three { grid-template-columns: 1fr; } }
.form { max-width: 720px; }
fieldset { border: 0; border-top: 1px solid var(--rule); padding: 6px 0 22px; margin: 0; }
legend { font-family: var(--head); font-weight: 700; font-size: 17px; padding: 0 12px 0 0; }
.form > .primary { margin-top: 4px; }
.days { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.days label { margin: 0; font-weight: 500; }
.days input { position: absolute; opacity: 0; }
.days span { display: inline-flex; min-width: 52px; min-height: 42px; align-items: center; justify-content: center; border: 1px solid #A9A69B; border-radius: 6px; cursor: pointer; }
.days input:checked + span { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.days input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.linkbox { border: 1px solid var(--ink); border-radius: 6px; padding: 16px 18px; margin: 0 0 24px; max-width: 720px; background: var(--cream); }
.linkbox.quiet { background: none; border-color: var(--rule); margin-top: 34px; }
.linkbox p { margin: 0 0 8px; }
.copyrow { display: flex; gap: 8px; } .copyrow input { font-size: 13.5px; }

/* ---- registers (tables) ---- */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; font-weight: 500; font-size: 13.5px; color: var(--muted); padding: 0 14px 8px 0; border-bottom: 2px solid var(--ink); white-space: nowrap; }
tbody th, tbody td { text-align: left; font-weight: 400; padding: 13px 14px 13px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
thead th.num { text-align: right; }
.who-name { font-weight: 600; display: block; }
.sub { display: block; font-size: 13px; color: var(--muted); }
.sub.warn, a.sub.warn { color: var(--amber); font-weight: 500; }
tr.off th, tr.off td { color: var(--muted); }
.actions { text-align: right; white-space: nowrap; padding-right: 0; } .actions form { display: inline; margin-left: 12px; }

/* status marks: shape and words, not colour alone */
.mark { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.mark::before { content: ""; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--muted); flex: none; }
.mark.in::before { background: var(--gold); border-color: var(--ink); }
.mark.out::before { border-color: var(--ink); }
.mark.warn::before { border-radius: 2px; transform: rotate(45deg); background: var(--amber); border-color: var(--amber); }
.mark.warn { color: var(--amber); font-weight: 500; }
.mark.none { color: var(--muted); }
.mark.none::before { height: 0; border-width: 2px 0 0; border-radius: 0; width: 11px; }

/* ---- live view ---- */
.tally { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 30px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); }
.tally div { padding: 12px 16px 12px 0; }
.tally div + div { border-left: 1px solid var(--rule); padding-left: 16px; }
.tally dt { color: var(--muted); font-size: 13.5px; }
.tally dd { margin: 0; font-family: var(--head); font-weight: 700; font-size: 40px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tally dd a { color: var(--amber); }
@media (max-width: 600px) { .tally { grid-template-columns: 1fr 1fr; } .tally div:nth-child(3) { border-left: 0; padding-left: 0; } .tally div:nth-child(n+3) { border-top: 1px solid var(--rule); } }
.register { min-width: 860px; }
.register .stripcol { width: 38%; min-width: 280px; padding-right: 22px; }
.hours { position: relative; height: 18px; font-size: 12px; font-variant-numeric: tabular-nums; }
.hours span { position: absolute; transform: translateX(-50%); }
.hours span:first-child { transform: none; } .hours span:last-child { transform: translateX(-100%); }
.strip { position: relative; height: 22px; margin-top: 2px; background: repeating-linear-gradient(to right, var(--rule) 0 1px, transparent 1px 20%); border-right: 1px solid var(--rule); }
.strip i { position: absolute; display: block; }
.strip .shift { top: 2px; bottom: 2px; border: 1.5px solid var(--ink); border-radius: 3px; }
.strip .worked { top: 5px; bottom: 5px; background: var(--gold); border-radius: 2px; box-shadow: inset 0 0 0 1px var(--gold-deep); }
.strip .now { top: -4px; bottom: -4px; width: 2px; background: var(--amber); }
.key { margin-top: 14px; display: flex; gap: 6px 8px; align-items: center; flex-wrap: wrap; }
.key .k { display: inline-block; width: 22px; height: 10px; margin-left: 10px; }
.key .k:first-child { margin-left: 0; }
.key .k.shift { border: 1.5px solid var(--ink); border-radius: 3px; } .key .k.worked { background: var(--gold); border-radius: 2px; } .key .k.now { width: 2px; height: 14px; background: var(--amber); }

/* ---- to review ---- */
.reviews { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.reviews li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 28px; padding: 18px 0; border-bottom: 1px solid var(--rule); align-items: start; }
.why { color: var(--amber); font-weight: 500; margin-top: 2px; }
.said { margin: 6px 0; padding-left: 12px; border-left: 3px solid var(--gold); }
.decide { display: flex; gap: 8px; margin: 0; flex-wrap: wrap; } .decide input { width: 220px; }
@media (max-width: 900px) { .reviews li { grid-template-columns: 1fr; } .decide input { width: 100%; } }

/* ---- sites ---- */
.split { display: grid; grid-template-columns: minmax(300px, 440px) 1fr; gap: 28px; align-items: start; }
.card { padding: 0; } .list { border-top: 2px solid var(--ink); }
.list thead th { border-bottom-width: 1px; padding-top: 10px; }
.mapcard { border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.map { height: calc(100vh - 190px); min-height: 420px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.sitename { font-weight: 600 !important; color: var(--ink) !important; text-decoration: none !important; text-align: left; }
.sitename:hover { text-decoration: underline !important; }
@media (max-width: 960px) { .split { grid-template-columns: 1fr; } .map { height: 420px; } }

/* ---- sign-in and other plain pages ---- */
body.plain { background: var(--cream); min-height: 100vh; }
main.narrow { max-width: 400px; margin: 0 auto; padding: 8vh 18px 40px; }
.loginbrand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.loginbrand img { border-radius: 13px; box-shadow: 0 0 0 1px #E6DCC3; }
.loginbrand .word { font-size: 44px; }
.loginbrand .by { color: var(--muted); align-self: flex-end; padding-bottom: 4px; }
.sheet { background: #fff; border: 1px solid #E6DCC3; border-radius: 6px; padding: 26px 24px 20px; }
.sheet h1 { font-size: 24px; margin-bottom: 10px; }
.sheet form { margin-bottom: 16px; } .sheet .primary { margin-top: 20px; }
.foot { color: var(--muted); font-size: 13px; margin-top: 16px; }

/* ---- phone clock ---- */
body.phone { background: var(--cream); min-height: 100vh; }
.phonetop { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; }
.phonetop .brand { padding: 0; } .phonetop .word { font-size: 23px; }
.phonetop form { margin: 0; display: flex; gap: 16px; align-items: center; font-size: 14px; }
.phonemain { max-width: 460px; margin: 0 auto; padding: 6px 20px 40px; }
.phonemain .date { color: var(--muted); margin: 0; }
.phonemain h1 { font-size: 30px; margin: 2px 0; }
.sunwrap { display: flex; justify-content: center; padding: 30px 0 18px; }
.sun { width: min(72vw, 264px); height: min(72vw, 264px); min-height: 0; border-radius: 50%; border: 0; flex-direction: column; gap: 4px; padding: 0 20px;
  background: var(--gold); color: var(--ink); box-shadow: 0 0 0 10px #FCE9A9, 0 0 0 22px #FEF3CF; }
.sun:hover { background: var(--gold-deep); }
.sun .big { font-family: var(--head); font-weight: 800; font-size: 34px; letter-spacing: -.02em; line-height: 1.05; }
.sun .small { font-weight: 500; font-size: 14.5px; }
body.is-in .sun { background: var(--ink); color: var(--cream); box-shadow: 0 0 0 10px #D9DAE6, 0 0 0 22px #ECECF2; }
body.is-in .sun:hover { background: var(--ink-2); }
.sun:disabled { opacity: 1; }
.result { min-height: 24px; text-align: center; font-weight: 500; margin: 14px 0 0; }
.result.good { color: var(--ok); } .result.warn { color: var(--amber); } .result.bad { color: var(--bad); }
.reason { margin: 6px 0 0; }
.phonemap { height: 190px; border: 1px solid #E6DCC3; border-radius: 6px; margin-top: 18px; }
.mine { display: grid; grid-template-columns: 1fr 1fr; margin: 26px 0 0; border-top: 2px solid var(--ink); }
.mine div { padding: 10px 0; } .mine dt { color: var(--muted); font-size: 13.5px; }
.mine dd { margin: 0; font-family: var(--head); font-weight: 700; font-size: 28px; font-variant-numeric: tabular-nums; }
.phonemain h2 { margin: 22px 0 4px; font-size: 17px; }
.log { list-style: none; margin: 0; padding: 0; }
.log li { display: flex; gap: 14px; padding: 9px 0; border-bottom: 1px solid #E6DCC3; }
.log .t { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 46px; }
.log em { display: block; font-style: normal; font-size: 13px; color: var(--amber); }
.promise { color: var(--muted); font-size: 13px; margin-top: 24px; }
@media (prefers-reduced-motion: no-preference) { .sun { transition: background-color .15s; } }
