/* Built for a phone in the sun, held by a guy with paint on his hands.
   Big type, big targets, high contrast, no small print. */

:root {
  --bg: #12141a;
  --card: #1c1f28;
  --card2: #262a35;
  --line: #333846;
  --text: #f2f4f8;
  --dim: #9aa3b2;
  --green: #17a34a;
  --green-d: #0f7a37;
  --red: #dc2626;
  --red-d: #a81b1b;
  --blue: #2563eb;
  --blue-d: #1a4fc4;
  --amber: #f59e0b;
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
  line-height: 1.4;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  -webkit-user-select: none;
  user-select: none;
}

.wrap { max-width: 520px; margin: 0 auto; padding: 16px 16px 40px; }

/* ---- tomorrow's plan ---- */
.card.plan { border: 2px solid var(--blue); }
.card.plan.changed { border-color: var(--amber); }
.plantag { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px;
           background: var(--amber); color: #111; font-size: 12px; font-weight: 900; letter-spacing: .5px; }
.planline { margin-top: 6px; font-size: 17px; }
.planok { margin-top: 12px; color: #86efac; font-weight: 800; font-size: 18px; }
.planprob { margin-top: 12px; color: #fed7aa; font-weight: 800; font-size: 17px; }
/* "PROBLEM" must be findable but must never compete with the green GOT IT --
   the common case is the plan being fine. */
.btn.ghost.problem { color: #fed7aa; border-color: #7c4a12; font-size: 16px; padding: 13px; }

/* ---- "is your week right?" ---- */
.card.weeksign { border: 2px solid var(--green); }
.card.weeksign .stats { margin-bottom: 4px; }
.card.weeksign .prow { border-radius: 12px; margin-top: 8px; }
/* A day John edited. He has never been shown these anywhere else, so it gets a
   colour of its own rather than hiding in the grey. */
.weekedit { margin-top: 3px; font-size: 14px; font-weight: 700; color: #fcd34d; }
.weekagain { margin-top: 10px; padding: 10px 12px; border-radius: 12px;
             background: #422006; border: 1px solid var(--amber); color: #fde68a;
             font-size: 15px; line-height: 1.4; }

/* ---- language toggle ---- */
.lang { display: flex; gap: 8px; margin-bottom: 20px; }
.lang button {
  flex: 1; padding: 12px; border: 2px solid var(--line); border-radius: 12px;
  background: transparent; color: var(--dim); font-size: 15px; font-weight: 800;
  letter-spacing: .5px; cursor: pointer;
}
.lang button.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---- big buttons ---- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 26px 20px; margin-bottom: 14px;
  border: none; border-radius: var(--radius);
  font-size: 26px; font-weight: 900; letter-spacing: .5px;
  color: #fff; cursor: pointer; transition: transform .08s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; }
.btn.green { background: var(--green); box-shadow: 0 5px 0 var(--green-d); }
.btn.red   { background: var(--red);   box-shadow: 0 5px 0 var(--red-d); }
.btn.blue  { background: var(--blue);  box-shadow: 0 5px 0 var(--blue-d); }
.btn.ghost {
  background: transparent; border: 2px solid var(--line);
  color: var(--dim); font-size: 18px; padding: 16px; box-shadow: none;
}
.btn svg { width: 30px; height: 30px; flex: none; }

/* ---- cards & numbers ---- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin-bottom: 14px;
}
.label { color: var(--dim); font-size: 14px; font-weight: 700;
         text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.big { font-size: 40px; font-weight: 900; line-height: 1.1; }
.timer { font-size: 56px; font-weight: 900; font-variant-numeric: tabular-nums;
         letter-spacing: -1px; text-align: center; }
.pulse { display: inline-block; width: 12px; height: 12px; border-radius: 50%;
         background: var(--green); margin-right: 8px;
         animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.stats .card { margin: 0; text-align: center; padding: 16px 10px; }
.stats .big { font-size: 30px; }

.pay { text-align: center; background: linear-gradient(160deg, #14532d, #166534);
       border-color: #1d7a45; }
.pay .big { font-size: 44px; }

/* ---- PIN pad ---- */
.dots { display: flex; justify-content: center; gap: 18px; margin: 28px 0 24px; }
.dot { width: 22px; height: 22px; border-radius: 50%;
       border: 3px solid var(--line); }
.dot.on { background: var(--green); border-color: var(--green); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pad button {
  padding: 22px 0; font-size: 32px; font-weight: 800;
  background: var(--card2); color: var(--text);
  border: 1px solid var(--line); border-radius: 14px; cursor: pointer;
}
.pad button:active { background: var(--line); }
.pad .wide { grid-column: span 1; font-size: 22px; }

/* ---- job search + sort (painter side: big targets, no small print) ---- */
.jobsearch {
  width: 100%; padding: 18px 20px; margin-bottom: 12px;
  font-size: 20px; font-weight: 700; font-family: inherit;
  background: var(--card); color: var(--text);
  border: 2px solid var(--line); border-radius: var(--radius);
}
.jobsearch:focus { outline: none; border-color: var(--green); }
.jobsearch::placeholder { color: var(--dim); font-weight: 500; }

.sorts { display: flex; gap: 8px; margin-bottom: 16px; }
.sorts button {
  flex: 1; padding: 14px 8px; border: 2px solid var(--line); border-radius: 12px;
  background: transparent; color: var(--dim);
  font-size: 14px; font-weight: 800; letter-spacing: .5px; cursor: pointer;
}
.sorts button.on { background: var(--card2); color: var(--text); border-color: var(--dim); }

/* ---- job list ---- */
.job {
  display: block; width: 100%; text-align: left; padding: 20px;
  background: var(--card2); border: 2px solid var(--line);
  border-radius: var(--radius); margin-bottom: 12px;
  color: var(--text); font-size: 22px; font-weight: 800; cursor: pointer;
}
.job:active { border-color: var(--green); }
.job.on { border-color: var(--green); background: #14361f; }
.job small { display: block; color: var(--dim); font-size: 15px;
             font-weight: 500; margin-top: 4px; }

/* ---- his week, day by day, with a FIX button on each punch ---- */
.daycard { background: var(--card); border: 1px solid var(--line);
           border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.dayrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
          padding: 13px 16px; background: var(--card2); border-bottom: 1px solid var(--line); }
.dayrow b { font-size: 17px; }
.dayh { margin-left: auto; font-weight: 900; font-size: 18px; }
.sunbadge { font-size: 12px; font-weight: 800; color: #fcd34d;
            background: #422006; padding: 3px 8px; border-radius: 999px; }

.prow { display: flex; justify-content: space-between; align-items: center; gap: 12px;
        padding: 14px 16px; border-bottom: 1px solid var(--line); }
.prow:last-child { border-bottom: none; }
.prow b { font-size: 17px; }
.ptimes { color: var(--dim); font-size: 15px; margin-top: 3px; }
.pright { display: flex; align-items: center; gap: 10px; }
.pendtag { font-size: 11px; font-weight: 800; color: #93c5fd; background: #1e3a5f;
           padding: 3px 8px; border-radius: 999px; margin-left: 6px; }
.fixbtn { padding: 9px 14px; border-radius: 10px; cursor: pointer;
          background: transparent; border: 2px solid var(--line); color: var(--dim);
          font-size: 13px; font-weight: 900; letter-spacing: .5px; font-family: inherit; }
.fixbtn:active { border-color: var(--blue); color: var(--text); }

.autowarn {
  margin-top: 6px; font-size: 13px; line-height: 1.4;
  color: #fed7aa; background: #4a2a05; border: 1px solid var(--amber);
  padding: 6px 10px; border-radius: 8px;
}

/* a day he's signed off on */
.daycard.signed { border-color: #1d7a45; }
.okbadge { font-size: 12px; font-weight: 800; color: #86efac;
           background: #14532d; padding: 3px 9px; border-radius: 999px; }
.fixbtn.okbtn { border-color: var(--green); color: #86efac; }

/* the job dropdown right on the clock-out screen */
.dayjob {
  width: 100%; padding: 12px 14px; font-size: 19px; font-weight: 800;
  font-family: inherit; background: var(--card2); color: var(--text);
  border: 2px solid var(--line); border-radius: 12px;
}
.dayjob:focus { outline: none; border-color: var(--blue); }
.prow.changed { background: #101a33; }
.prow.changed .dayjob { border-color: var(--blue); color: #93c5fd; }

/* the reduce-only editor that drops down under a punch at clock-out */
.adjbtn {
  background: transparent; border: 1px solid var(--line); color: var(--dim);
  border-radius: 9px; padding: 7px 12px; font-size: 13px; font-weight: 700;
  white-space: nowrap;
}
.adjbox {
  background: var(--card2); border-radius: 14px; padding: 14px 16px;
  margin: 2px 0 14px; display: flex; flex-direction: column; gap: 10px;
}
.adjbox .btn { margin: 0; }
.adjtime {
  width: 100%; font-size: 22px; font-weight: 800; text-align: center;
  padding: 12px; background: var(--bg); color: var(--text);
  border: 2px solid var(--line); border-radius: 12px;
}

/* ---- the correction form: big fields, thumb-sized ---- */
.flab { display: block; font-size: 15px; font-weight: 800; color: var(--dim);
        margin: 0 0 8px; }
.finput { width: 100%; padding: 16px; margin-bottom: 18px;
          font-size: 19px; font-family: inherit; font-weight: 600;
          background: var(--card); color: var(--text);
          border: 2px solid var(--line); border-radius: 14px; }
.finput:focus { outline: none; border-color: var(--green); }
textarea.finput { font-weight: 500; line-height: 1.4; resize: none; }
.frow { display: flex; gap: 12px; }
.frow > div { flex: 1; }

/* ---- misc ---- */
.title { font-size: 28px; font-weight: 900; margin: 0 0 4px; }
.sub { color: var(--dim); margin: 0 0 20px; }
.warn { background: #422006; border-color: var(--amber); color: #fde68a; }
.err  { background: #450a0a; border-color: var(--red); color: #fecaca; }

/* ---- first-run setup: two steps, each ticks itself off ---- */
.setupstep {
  background: var(--card); border: 2px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.setupstep.done { border-color: var(--green); background: #14361f; }

.stephead { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.stephead b { font-size: 21px; line-height: 1.25; }
.stepnum {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--card2); border: 2px solid var(--line);
  font-size: 20px; font-weight: 900; color: var(--dim);
}
.setupstep.done .stepnum { background: var(--green); border-color: var(--green); color: #fff; }
.stepwhy { color: var(--dim); font-size: 15px; line-height: 1.45; margin-top: 5px; }

.setupsteps { margin: 0; padding-left: 24px; }
.setupsteps li { font-size: 17px; line-height: 1.5; margin-bottom: 12px; }
.setupsteps b { color: #93c5fd; }

.setupnote { font-size: 16px; line-height: 1.5; margin-bottom: 14px; color: var(--text); }
.setupnote b { color: #93c5fd; }
.setupnote.bad { color: #fca5a5; }
.setupnote.bad b { color: #fecaca; }

.stepdone { color: #86efac; font-weight: 800; font-size: 17px; }

/* "put this on your phone" */
.card.install { border-color: var(--blue); background: #101a33; }
.installhow {
  margin-top: 12px; padding: 14px; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--line);
  font-size: 16px; line-height: 1.5;
}
.installhow b { color: #93c5fd; }

/* the three-step fix, only shown when the phone flat refuses to ask */
.fixsteps { text-align: left; margin: 16px 0 0; padding-left: 26px; line-height: 1.6; }
.fixsteps li { margin-bottom: 10px; font-size: 17px; }

/* the "are you really at this job?" box */
.locok   { background: #14361f; border-color: var(--green); color: #bbf7d0; }
.locbad  { background: #4a1d05; border-color: var(--amber); color: #fed7aa; }
.locwarn { background: var(--card2); border-color: var(--dim); color: var(--text); }
.row { display: flex; justify-content: space-between; align-items: center;
       padding: 14px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: none; }
.row b { font-size: 20px; }
.center { text-align: center; }
.hide { display: none !important; }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: 24px; z-index: 50;
  max-width: 488px; margin: 0 auto; padding: 16px 20px;
  background: var(--card2); border: 1px solid var(--line);
  border-radius: 12px; text-align: center; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}

.spinner {
  width: 44px; height: 44px; margin: 30px auto;
  border: 5px solid var(--line); border-top-color: var(--green);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }
