:root {
  --brand: #0f5c4d;
  --brand-2: #157a66;
  --brand-soft: #e3f2ed;
  --bg: #f4f6f5;
  --card: #ffffff;
  --ink: #1b2522;
  --muted: #5f6f6a;
  --line: #dde4e1;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --warn: #8a5a00;
  --warn-soft: #fff4dc;
  --ok: #1e7b34;
  --ok-soft: #e6f4ea;
  --radius: 12px;
  --nav-h: 64px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); }
body { font-size: 16px; line-height: 1.4; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); }
body.modal-open { overflow: hidden; }
a { color: var(--brand-2); }
h1 { font-size: 1.35rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 0 0 8px; }
h3 { font-size: 1rem; margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.loading { padding: 40px 16px; text-align: center; color: var(--muted); }

/* ---------- header & nav ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--brand); color: #fff;
}
.brand { font-weight: 700; font-size: 1.05rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync { font-size: .78rem; opacity: .9; white-space: nowrap; }
.sync.bad { background: #ffd8d4; color: var(--danger); padding: 2px 8px; border-radius: 99px; opacity: 1; }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav a {
  flex: 1; height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600;
}
.nav a svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav a.on { color: var(--brand); }
@media (min-width: 1000px) {
  body { padding-bottom: 24px; padding-left: 92px; }
  .nav { top: 0; bottom: 0; right: auto; width: 92px; flex-direction: column; border-top: 0; border-right: 1px solid var(--line); padding-top: 64px; justify-content: flex-start; }
  .nav a { flex: 0 0 76px; }
  .top { padding-left: 108px; margin-left: -92px; }
}

/* ---------- page layout ---------- */
.page { max-width: 1400px; margin: 0 auto; padding: 14px 16px; }
.page.narrow { max-width: 760px; }
.page.wide { max-width: 1840px; } /* the month uses the whole of a big screen, like Aworka */
@media (min-width: 1000px) { .page.wide .diary-foot { padding-right: 84px; } } /* clear of the round + */
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.page-head h1 { flex: 1; min-width: 140px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 8px; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

/* ---------- buttons & inputs ---------- */
button, .btn {
  font: inherit; font-weight: 600; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); padding: 10px 14px; min-height: 44px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none;
}
button:active { transform: translateY(1px); }
.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.good { background: var(--ok); border-color: var(--ok); color: #fff; }
.danger { color: var(--danger); border-color: #f0c5c1; }
.ghost { background: transparent; border-color: transparent; }
.sm { padding: 6px 10px; min-height: 36px; font-size: .88rem; }
.icon-btn { width: 44px; padding: 0; }
.fab {
  position: fixed; right: 18px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 18px); z-index: 15;
  width: 60px; height: 60px; border-radius: 50%; font-size: 32px; line-height: 1; padding: 0;
  background: var(--brand); color: #fff; border: 0; box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
@media (min-width: 1000px) { .fab { bottom: 28px; right: 28px; } }
input, select, textarea {
  font: inherit; width: 100%; padding: 10px 12px; min-height: 44px;
  border: 1px solid #c9d3cf; border-radius: 10px; background: #fff; color: var(--ink);
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-2); outline-offset: 0; border-color: var(--brand-2); }
label { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.fields-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 10px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 1rem; color: var(--ink); font-weight: 500; margin: 6px 0; }
.check input { width: 22px; height: 22px; min-height: 0; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { margin: 0; }
.days input { display: none; }
.days span { display: inline-block; min-width: 44px; text-align: center; padding: 9px 6px; border-radius: 9px; border: 1px solid #c9d3cf; color: var(--muted); font-weight: 600; cursor: pointer; }
.days input:checked + span { background: var(--brand); color: #fff; border-color: var(--brand); }
.seg { display: flex; border: 1px solid #c9d3cf; border-radius: 10px; overflow: hidden; }
.seg label { flex: 1; margin: 0; }
.seg input { display: none; }
.seg span { display: block; text-align: center; padding: 10px 6px; font-weight: 600; color: var(--muted); cursor: pointer; font-size: .92rem; }
.seg input:checked + span { background: var(--brand); color: #fff; }
.seg label + label span { border-left: 1px solid #c9d3cf; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar select, .toolbar input { width: auto; flex: 1 1 140px; }

/* ---------- chips ---------- */
.chip { display: inline-block; font-size: .74rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #eef1f0; color: var(--muted); white-space: nowrap; }
.chip.tbc { background: var(--warn-soft); color: var(--warn); }
.chip.booked { background: var(--brand-soft); color: var(--brand); }
.chip.done { background: var(--ok-soft); color: var(--ok); }
.chip.skipped { background: #eee; color: #666; text-decoration: line-through; }
.chip.late { background: var(--danger-soft); color: var(--danger); }
.chip.owed { background: var(--danger-soft); color: var(--danger); }
.chip.est { background: #ede7f6; color: #5b3a99; }
.chip.remind { background: var(--ok-soft); color: var(--ok); }
.tell-box { margin-top: 12px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-right: 4px; }

/* ---------- diary ---------- */
.week-nav { display: flex; align-items: center; gap: 6px; }
.week-nav .label { font-weight: 700; min-width: 0; flex: 1; text-align: center; }
.week { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 1000px) { .week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; } }
.day { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 80px; }
.day.today { border-color: var(--brand-2); box-shadow: 0 0 0 2px var(--brand-soft); }
.day.past { opacity: .92; }
.day-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.day-head .d { font-weight: 700; flex: 1; }
.day.today .day-head .d { color: var(--brand); }
.day-head .hol { font-size: .7rem; color: var(--warn); font-weight: 700; display: block; }
.day-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.day-foot { padding: 6px 10px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; }
/* The small round + in the top right corner of each day: a new booking on that day. */
.day-plus {
  position: relative; flex: 0 0 auto; width: 18px; height: 18px; min-height: 0; padding: 0; border: 0; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 15px; line-height: 1; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
/* Small to look at, but still easy to tap. */
.day-plus::after { content: ""; position: absolute; inset: -9px; }
.day-plus:hover { background: var(--brand-2); }
@media (max-width: 999px) { .day { min-height: 0; } .day-body:not(:has(.visit)) { display: none; } .day-head { border-bottom: 0; } .day-body { border-top: 1px solid var(--line); } }
.diary-head .week-nav { flex: 1 1 100%; }
.diary-head .jump { flex: 1; width: auto; min-height: 44px; }
@media (min-width: 1000px) {
  .day-plus { width: 15px; height: 15px; font-size: 13px; }
  .day-plus::after { inset: -6px; }
  .day-head { padding: 6px 8px; flex-wrap: wrap; row-gap: 0; }
  /* Narrow columns: the day and its + on the first line, Sheet underneath. */
  .week .day-head .d { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .week .day-head .sheet-btn { order: 3; flex: 1 0 100%; text-align: left; min-height: 0; padding: 0; font-size: .78rem; font-weight: 600; color: var(--muted); text-decoration: underline; background: none; border: 0; }
  .diary-head .week-nav { flex: 1 1 auto; }
  .diary-head .jump { flex: 0 0 auto; }
}
.visit {
  text-align: left; display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; width: 100%; border: 1px solid var(--line); border-left: 5px solid var(--c, #999);
  border-radius: 9px; padding: 8px 10px; background: #fff; min-height: 0; font-weight: 400; cursor: pointer;
}
.visit .name { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visit .meta { font-size: .8rem; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visit .tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.visit.done { background: #f6fbf7; }
.visit.skipped { opacity: .55; }
.visit.late { background: #fff7f6; }

/* ---------- lists ---------- */
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.item { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; cursor: pointer; background: #fff; width: 100%; text-align: left; border-radius: 0; border-left: 0; border-right: 0; border-top: 0; font-weight: 400; min-height: 56px; }
.item:last-child { border-bottom: 0; }
.item .t { font-weight: 700; }
.item .s { font-size: .85rem; color: var(--muted); }
.item .r { text-align: right; white-space: nowrap; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; font-size: .95rem; }
.kv dt { color: var(--muted); font-weight: 600; font-size: .85rem; padding-top: 2px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-size: .8rem; }
.tbl td.num, .tbl th.num { text-align: right; }

/* ---------- takings ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.stat .v { font-size: 1.4rem; font-weight: 800; }
.stat .l { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat.alert .v { color: var(--danger); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(10, 25, 20, .45); display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
.modal-card {
  background: var(--bg); width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto;
  border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}
@media (min-width: 700px) { .modal { align-items: center; } .modal-card { border-radius: 18px; max-height: 88vh; } }
.modal-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.modal-head h2 { flex: 1; margin: 0; font-size: 1.2rem; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.actions > * { flex: 1 1 140px; }
.sticky-actions { position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom)); background: var(--bg); padding: 10px 0 4px; margin-top: 4px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 90px); z-index: 60;
  background: #1b2522; color: #fff; padding: 10px 16px; border-radius: 10px; max-width: 92vw; font-size: .95rem; box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

/* ---------- login ---------- */
.login { max-width: 380px; margin: 60px auto; padding: 0 16px; }
.login .card { padding: 22px; }

/* ---------- day sheet / print ---------- */
.sheet .job { border-bottom: 1px solid var(--line); padding: 10px 0; display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; }
.sheet .box { width: 22px; height: 22px; border: 2px solid #555; border-radius: 4px; margin-top: 2px; }
@media print {
  body { padding: 0; background: #fff; }
  .top, .nav, .fab, .no-print { display: none !important; }
  body { padding-left: 0 !important; }
  .page { padding: 0; }
  .card { border: 0; padding: 0; }
}

/* ChatGPT setup */
.steps { padding-left: 20px; margin: 0 0 8px; }
.steps li { margin-bottom: 16px; }
.copy { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; }
.copy input, .copy textarea { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; }

/* ---------- week / month ---------- */
.view-seg { flex: 0 0 auto; }
.view-seg span { padding: 8px 14px; }
.diary-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tip-mouse { display: none; }
@media (hover: hover) and (pointer: fine) { .tip-mouse { display: inline; } .tip-touch { display: none; } }
.mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.mwd { font-size: .72rem; font-weight: 700; color: var(--muted); text-align: center; padding: 2px 0; }
.mday {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; min-height: 56px; min-width: 0;
  padding: 4px; cursor: pointer; display: flex; flex-direction: column; gap: 3px;
}
.mday.other { opacity: .45; }
.mday.today { border-color: var(--brand-2); box-shadow: 0 0 0 2px var(--brand-soft); }
.mday.sel { background: var(--brand-soft); border-color: var(--brand); }
.mhead { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.mdate { font-weight: 700; font-size: .9rem; }
.mday.today .mdate { color: var(--brand); }
.mday.hol .mdate { color: var(--warn); }
.mplus { display: none; }
.mlist { display: none; }
.mdots { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.mdots i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, #999); }
.mdots b { font-size: .7rem; color: var(--muted); font-weight: 700; }
.mchip {
  display: block; width: 100%; text-align: left; min-height: 0; padding: 2px 6px; font-size: .78rem; font-weight: 500;
  border: 0; border-left: 4px solid var(--c, #999); border-radius: 5px; background: #f1f4f3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mchip.done { opacity: .6; }
.mchip.late { background: var(--danger-soft); }
.mchip.skipped { text-decoration: line-through; opacity: .5; }
.mpanel { margin-top: 4px; }
.mpanel .day-body:not(:has(.visit))::before { content: "Nothing booked."; color: var(--muted); font-size: .9rem; padding: 4px 2px; }
@media (max-width: 999px) { .mpanel .day-body:not(:has(.visit)) { display: flex; } }
@media (min-width: 700px) {
  .mday { min-height: 108px; }
  .mhead { align-items: center; }
  .mplus { display: block; width: 13px; height: 13px; font-size: 12px; }
  .mplus::after { inset: -6px; }
  .mlist { display: flex; flex-direction: column; gap: 3px; }
  .mdots { display: none; }
}

/* ---------- dragging a visit ---------- */
[data-drag] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; opacity: .95; box-shadow: 0 10px 28px rgba(0,0,0,.3); margin: 0; }
.dragging { opacity: .35; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
.drop-on { outline: 3px dashed var(--brand-2); outline-offset: -2px; background: var(--brand-soft) !important; }
.toast-undo { min-height: 0; padding: 4px 12px; margin-left: 10px; background: transparent; color: #9fe3cd; border-color: #4f6b63; }
@media (max-width: 999px) {
  .view-seg span { padding: 8px 10px; font-size: .88rem; }
  .diary-head .jump { flex: 1 1 110px; min-width: 110px; }
}

/* Quotes: one tap makes a quote a live job */
.quote-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 10px; padding: 8px 8px 8px 12px; border-radius: 10px; background: #ede7f6; color: #5b3a99; font-weight: 600; }
.quote-bar span { flex: 1 1 auto; }
.quote-bar button { flex: 0 0 auto; }
.item .r .row-btn { margin-top: 6px; }
.ok-note { margin-top: 0; padding: 8px 12px; border-radius: 10px; background: var(--ok-soft); color: var(--ok); font-weight: 600; }

/* Paid by: tap the way it was paid */
.pay-amount { margin: 0 0 12px; font-size: 1.4rem; font-weight: 700; }
.pay-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.pay-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 700px) { .pay-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Logged in as someone with their own login: name and Log out in the top bar */
.me-btn { flex: 0 0 auto; min-height: 0; padding: 4px 10px; font-size: .78rem; font-weight: 600; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.5); border-radius: 99px; white-space: nowrap; }
.me-btn:hover { background: rgba(255,255,255,.12); }

/* Field workers' app, laid out like Aworka's: three days, then Debts, New Job, Expenses */
.fdays, .ftools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.fday { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 10px 4px; min-height: 76px; background: #fff; border: 1px solid var(--line); border-radius: 12px; font-weight: 400; color: var(--ink); }
.fday b { font-size: 1.05rem; }
.fday span { font-size: .85rem; }
.fday small { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.fday.is-today b { color: var(--brand); }
.fday.on { border: 3px solid var(--brand); padding: 8px 2px; background: var(--brand-soft); }
.ftools > * { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 56px; padding: 6px; text-align: center; font-weight: 700; text-decoration: none; }
.ftools small { font-size: .75rem; font-weight: 600; color: var(--danger); }
.field-date { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 16px 0 8px; }
.field-date h2 { margin: 0; }
.field-list { display: flex; flex-direction: column; gap: 8px; }
.field-head { align-items: center; gap: 10px; }
.field-head h1 { margin: 0; }
.field-foot { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; }
.login-row { flex-wrap: wrap; }
.login-row .grow { min-width: 200px; }
.login-row .r { display: flex; gap: 6px; flex-wrap: wrap; white-space: normal; }

/* Photos and videos on a job */
.vh { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.media-box { margin-top: 12px; }
.mrows { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.mrow { display: flex; gap: 10px; align-items: center; width: 100%; min-height: 0; padding: 6px; text-align: left; font-weight: 400; background: #fff; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.mrow .grow { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mrow .s { font-size: .8rem; color: var(--muted); }
.mnote { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .92rem; }
.mthumb { position: relative; flex: 0 0 auto; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: #26302d; display: flex; align-items: center; justify-content: center; }
.mthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mplay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-style: normal; font-size: 20px; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.chip.mtag-before { background: var(--warn-soft); color: var(--warn); }
.chip.mtag-after { background: var(--ok-soft); color: var(--ok); }
.chip.mtag-info { background: #e3ecfa; color: #1f4f96; }
.media-pick { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; margin-bottom: 10px; font-weight: 700; cursor: pointer; color: var(--brand); background: var(--brand-soft); border: 2px dashed var(--brand-2); }
.mpicked { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.mpicked:empty { display: none; }
.mpick { position: relative; width: 76px; height: 76px; border-radius: 8px; overflow: hidden; background: #26302d; display: block; }
.mpick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mpick small { position: absolute; left: 0; right: 0; bottom: 0; padding: 1px 4px; font-size: .68rem; color: #fff; background: rgba(0,0,0,.45); }
.mpick-x { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; line-height: 1; }
.mf-status { margin: 0 0 10px; color: var(--muted); }
.mf-status.bad { color: var(--danger); }
.mview { margin: 0 -4px 10px; background: #111; border-radius: 10px; overflow: hidden; display: flex; justify-content: center; }
.mview img, .mview video { display: block; max-width: 100%; max-height: 62vh; margin: 0 auto; }
.mview a { display: block; }
.mview-note { margin: 0 0 6px; white-space: pre-wrap; }

/* The service above each job, £ on paid jobs, EST on estimates, and longer jobs drawn taller */
.visit .vsvc { display: block; text-align: center; font-size: .72rem; font-weight: 700; color: var(--c, var(--muted)); filter: brightness(.8); margin: -2px 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Taller the longer the job (26px an hour on a computer, so an 8 hour job is the biggest; gentler on a phone). */
.visit { min-height: calc(20px + var(--h, 0) * 16px); }
@media (min-width: 1000px) { .week .visit, .mpanel .visit { min-height: calc(60px + var(--h, 0) * 26px); } }
.chip.paid { background: var(--ok); color: #fff; }
.chip.est { letter-spacing: .03em; }
.mchip { display: flex; align-items: center; gap: 3px; }
.mchip > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk { flex: 0 0 auto; font-style: normal; font-size: .62rem; font-weight: 800; line-height: 1; padding: 2px 3px; border-radius: 3px; }
.mk.est { background: #ede7f6; color: #5b3a99; }
.mk.paid { background: var(--ok); color: #fff; }

/* The Status box on a job: To Do, Done, Paid or Skip */
.status-actions { align-items: center; }
.status-box { display: flex; align-items: center; gap: 8px; flex: 1 1 220px; margin: 0; font-weight: 600; }
.status-box select { flex: 1; min-height: 44px; font-weight: 700; border-width: 2px; }
.status-box.st-todo select { border-color: var(--brand-2); }
.status-box.st-done select { border-color: var(--ok); color: var(--ok); }
.status-box.st-paid select { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.status-box.st-skip select { border-color: #999; color: #666; }

/* The month on a computer, like Aworka's: every job in its day, the service above it, a box
   that's taller the longer the job takes (13px an hour), and the day's jobs and total underneath.
   The list under the month is only for phones, whose days are too narrow for this. */
.msvc, .mfoot { display: none; }
@media (min-width: 700px) {
  .mlist { gap: 2px; }
  .msvc { display: block; margin-top: 3px; text-align: center; font-size: .7rem; font-weight: 700; line-height: 1.2; color: var(--c, var(--muted)); filter: brightness(.8); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mlist > .msvc:first-child { margin-top: 0; }
  .mchip { align-items: flex-start; min-height: calc(7px + var(--h, 0) * 13px); padding-top: 3px; padding-bottom: 3px; }
  /* a long job's box has room for the name to run onto more lines */
  .mchip > span { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--l, 1); line-clamp: var(--l, 1); }
  .mfoot { display: block; margin-top: auto; padding-top: 3px; text-align: center; font-size: .72rem; color: var(--muted); }
  .mpanel { display: none; }
}

/* ---------- Inbox: the Gmail emails, as Quotes and Customers ---------- */
.nav a { position: relative; }
.nav-n { position: absolute; top: 6px; left: calc(50% + 4px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: .68rem; line-height: 18px; text-align: center; }
.nav-n[hidden] { display: none; }
.bad-note { margin-top: 0; padding: 8px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.chip.new { background: var(--danger-soft); color: var(--danger); }
.inbox-seg { margin-bottom: 12px; }
.seg-n { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--danger); color: #fff; font-size: .75rem; line-height: 20px; }
.mail-row { align-items: flex-start; }
.mail-row.unanswered { box-shadow: inset 4px 0 0 var(--danger); }
.mail-row .t, .mail-subj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-subj { font-weight: 600; font-size: .92rem; }
.mail-row .s { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.mail-row .tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.mail-msg.ours { background: var(--brand-soft); border-color: transparent; margin-left: 24px; }
.chip.draft { background: var(--warn-soft); color: var(--warn); }
.draft-note { display: flex; gap: 8px; align-items: center; background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 8px 10px; margin: 0 0 10px; font-weight: 600; }
.mail-who { margin-top: -6px; overflow-wrap: anywhere; }
.mail-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 6px; }
.mail-quoted summary { cursor: pointer; margin-top: 8px; }
.mail-files { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.mail-files .btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-foot { margin-top: 12px; }

/* The conveyor belt on a computer: New, Replied, Quoted, Booked, Done, with emails dragged along. */
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: stretch; }
.bcol { display: flex; flex-direction: column; gap: 8px; min-height: 340px; padding: 8px; border-radius: var(--radius); background: #eaefed; border-top: 4px solid var(--c, #9aa6a2); transition: background .1s; }
.bcol-new { --c: var(--danger); }
.bcol-quoted { --c: #7a52b8; }
.bcol-booked { --c: var(--brand); }
.bcol-done { --c: var(--ok); }
.bcol h3 { display: flex; align-items: center; gap: 6px; margin: 2px 4px 2px; font-size: .95rem; }
.bcount { min-width: 22px; padding: 0 7px; border-radius: 99px; background: #fff; color: var(--muted); font-size: .78rem; line-height: 22px; text-align: center; }
.bcol.over { background: var(--brand-soft); outline: 2px dashed var(--brand); outline-offset: -2px; }
.bcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: grab; user-select: none; }
.bcard:hover { border-color: #b9c6c1; }
.bcard:focus-visible { outline: 2px solid var(--brand); }
.bcard.unanswered { box-shadow: inset 4px 0 0 var(--danger); padding-left: 12px; }
.bcard.dragging { opacity: .35; }
.bcard-top { gap: 6px; flex-wrap: nowrap; }
.bcard .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bcard .mail-subj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.bcard .s { font-size: .82rem; color: var(--muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.bcard .tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.bempty { padding: 22px 8px; border: 2px dashed #cdd6d2; border-radius: 10px; color: var(--muted); font-size: .85rem; text-align: center; }
.mail-stage { flex: 1 1 100%; }
.mail-stage.st-new select { border-color: var(--danger); color: var(--danger); }
.mail-stage.st-quoted select { border-color: #7a52b8; color: #5b3a99; }
.mail-stage.st-booked select { border-color: var(--brand); color: var(--brand); }
.mail-stage.st-done select { border-color: var(--ok); color: var(--ok); }
