/* ═══ JOB DETAILS — the office pop-up for one job ═══════════════════════════
   Built 29 Sep 2026 from _prototype-jobdetail.html (his pick: layout A, one page).
   He called the old one "the hierarchy is so bad": every fact was a row of the same
   weight, the report links were four grey words in a line, and the fixes for a stuck
   job sat in a box at the bottom with instructions in it.
   Four sizes only: 28 title · 19 heading · 15 body · 13 small. Space separates,
   not boxes. Everything is named jd- so no other screen can reach in.
   ═══════════════════════════════════════════════════════════════════════════ */

.modal.jd-modal{max-width:780px;padding:28px 32px 32px}
@media (max-width:600px){.modal.jd-modal{padding:12px 16px 28px}}

.jd-28{font-size:28px;font-weight:500;letter-spacing:-.02em;line-height:1.15;margin:0;overflow-wrap:anywhere}
.jd-19{font-size:19px;font-weight:500;letter-spacing:-.01em;line-height:1.35;margin:0}
.jd-13{font-size:13px;color:var(--ink-faint)}
.jd-modal svg.jd-i{width:18px;height:18px;flex-shrink:0}

/* a quiet word-button: grey, round, for the secondary actions that sit beside a heading */
.jd-quiet{display:inline-flex;align-items:center;gap:6px;min-height:34px;padding:0 12px;border:0;border-radius:17px;
  background:none;color:var(--accent);font:600 13px 'Inter',sans-serif;cursor:pointer;white-space:nowrap}
.jd-quiet:hover{background:var(--accent-soft)}
.jd-addday{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap}
.jd-addday .dfw>input[type=text]{min-height:36px;height:36px;padding:0 38px 0 12px;width:140px;font:14px 'Inter',sans-serif;
  color:var(--ink);border:1px solid var(--rule);border-radius:8px;background:var(--surface)}
.jd-addday .dfw>input[type=text]:focus{outline:none;border-color:var(--accent)}
.jd-ofc{font-weight:600;color:var(--ink)}

/* ── a file on its way up: name, bar, what is happening ── */
.jd-ups{display:flex;flex-direction:column;gap:10px;margin:0 0 16px}
.jd-up{border:1px solid var(--rule);border-radius:10px;padding:10px 12px;background:var(--surface)}
.jd-up .top{display:flex;gap:10px;align-items:baseline;justify-content:space-between}
.jd-up .nm{font-size:14px;font-weight:500;color:var(--ink);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.jd-up .sz{font-size:12px;color:var(--ink-faint);flex-shrink:0}
.jd-up .bar{height:6px;border-radius:3px;background:var(--field);margin:8px 0 6px;overflow:hidden}
.jd-up .bar i{display:block;height:100%;width:0;background:var(--ink);border-radius:3px;transition:width .2s}
.jd-up .st{display:flex;align-items:center;gap:8px;min-height:24px;font-size:13px;color:var(--ink-soft)}
.jd-up .st .lbl{flex:1;min-width:0}
.jd-up.done .bar i{background:var(--good)}
.jd-up.done .lbl{color:var(--good)}
.jd-up.fail,.jd-up.cancel{border-color:var(--alert)}
.jd-up.fail .bar i,.jd-up.cancel .bar i{background:var(--alert)}
.jd-up.fail .lbl{color:var(--alert)}
.jd-up.proc .bar i{animation:jdUpPulse 1.1s ease-in-out infinite}
@keyframes jdUpPulse{50%{opacity:.45}}
@media (prefers-reduced-motion:reduce){.jd-up.proc .bar i{animation:none}.jd-up .bar i{transition:none}}
.jd-upx{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:0;border-radius:14px;background:none;color:var(--ink-faint);cursor:pointer}
.jd-upx:hover{background:var(--field);color:var(--ink)}
.jd-upx svg{width:16px;height:16px}
.jd-quiet.dim{color:var(--ink-faint)}
/* the office: the family's ghost (grey words, a grey wash on hover), not red words beside the red main */
:where(body:not(.role-tech):not(.role-driver)) .jd-quiet,
:where(body:not(.role-tech):not(.role-driver)) .jd-quiet:hover{color:var(--ink-soft);background:none}
@media (hover:hover) and (pointer:fine){:where(body:not(.role-tech):not(.role-driver)) .jd-quiet:hover{background:var(--bt-neu);color:var(--ink)}}
:where(body:not(.role-tech):not(.role-driver)) .jd-quiet:active{background:var(--bt-neu-p)}

/* ── the head ── */
.jd-hd{display:flex;gap:16px;align-items:flex-start}
.jd-hd .jd-main{flex:1;min-width:0}
.jd-acts{display:flex;gap:8px;align-items:center;flex-shrink:0}
/* ⚠ RESTYLE (21 Oct 2026): the dark main is the field side's only now; the office takes the family's red */
:where(body.role-tech,body.role-driver) .jd-acts .btn-line.strong{background:var(--ink);color:var(--on-ink);border-color:var(--ink)}
:where(body.role-tech,body.role-driver) .jd-acts .btn-line.strong:hover{opacity:.88}
/* the round Close and ⋯ (m3.css .m3-icon, 40 square): the family's 44 floor made them 40x44 ovals */
:where(body:not(.role-tech):not(.role-driver)) .btn-line.m3-icon{min-height:40px}
/* the title is the family's pop-up title (24, 22 on a phone) */
:where(body:not(.role-tech):not(.role-driver)) .jd-modal .jd-28{font-size:24px;font-weight:600;letter-spacing:-.01em;line-height:1.2}
@media (max-width:600px){:where(body:not(.role-tech):not(.role-driver)) .jd-modal .jd-28{font-size:22px!important}}
.jd-kind{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--ink-soft);margin-bottom:8px}
.jd-kind .edge{width:3px;height:14px;border-radius:2px;background:var(--kind)}
.jd-kind .no{color:var(--ink-faint);font-variant-numeric:tabular-nums}
.jd-mach{font-size:15px;color:var(--ink-soft);margin-top:6px}
@media (max-width:600px){.jd-hd{flex-direction:column-reverse;gap:4px}.jd-acts{align-self:flex-end}}

/* the status: a square and a word, the way the app draws every status. A manager presses it to change it. */
.jd-stwrap{position:relative;display:inline-block;margin-top:14px}
.jd-status{display:inline-flex;align-items:center;gap:8px;font:500 15px 'Inter',sans-serif;color:var(--ink);
  border:0;background:none;padding:6px 10px 6px 0;border-radius:8px}
button.jd-status{cursor:pointer}
.jd-status .sw{width:10px;height:10px;background:var(--st)}
.jd-status .when{font-weight:400;color:var(--ink-soft)}
.jd-status .chev{color:var(--ink-faint);display:inline-flex}
button.jd-status:hover .chev{color:var(--ink)}

/* ── menus: one look for the status, the ⋯ of a day and the people of a day ── */
.jd-menu{position:absolute;z-index:30;top:calc(100% + 4px);left:0;width:max-content;min-width:200px;
  background:var(--surface);border:1px solid var(--rule);border-radius:10px;
  box-shadow:0 12px 36px rgba(var(--shade-rgb),.16);padding:6px;text-align:left}
.jd-menu.right{left:auto;right:0}
.jd-menu[hidden]{display:none}
.jd-menu > button,.jd-menu > a{display:flex;align-items:center;justify-content:flex-start;gap:10px;width:100%;
  border:0;background:none;padding:9px 12px;border-radius:6px;font:400 15px 'Inter',sans-serif;color:var(--ink);
  cursor:pointer;white-space:nowrap;text-decoration:none;text-align:left}
.jd-menu > button:hover,.jd-menu > a:hover{background:var(--m3-state)}
.jd-menu > button .sw{width:10px;height:10px}
.jd-menu > button .tick{margin-left:auto;padding-left:16px;color:var(--ink-faint)}
.jd-menu > button.red{color:var(--accent)}
.jd-menu hr{border:0;border-top:1px solid var(--rule-soft);margin:6px 4px}

/* ── the problem and the facts ── */
.jd-problem{margin-top:28px}
.jd-facts{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:18px 24px;margin-top:20px}
.jd-fact{min-width:0}
.jd-fact.wide{grid-column:1/-1}
.jd-fact .l{font-size:13px;color:var(--ink-faint);margin-bottom:3px}
.jd-fact .v{font-size:15px;color:var(--ink);white-space:pre-line;overflow-wrap:anywhere}
.jd-fact .v.people{display:flex;align-items:center;gap:8px;white-space:normal}
.jd-fact .v .faint{color:var(--ink-faint)}
/* the day it was done: a date the office can press to change (8 Oct 2026) */
.jd-fact .v{position:relative}
.jd-dd{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer;text-decoration:underline dotted var(--ink-faint);text-underline-offset:4px}
.jd-dd:hover{text-decoration-style:solid;text-decoration-color:var(--ink)}
.jd-ddin{position:absolute;left:0;bottom:0;width:1px;height:1px;opacity:0;pointer-events:none;border:0;padding:0}

/* ── sections ── */
.jd-sec{margin-top:40px}
.jd-sec-hd{display:flex;align-items:center;gap:10px;margin-bottom:14px;flex-wrap:wrap}
.jd-sec-hd .jd-19{flex:1}

/* machines on an installation */
.jd-tbl{width:100%;border-collapse:collapse;font-size:15px}
.jd-tbl th{font-size:13px;font-weight:400;color:var(--ink-faint);text-align:left;padding:0 0 8px}
.jd-tbl th.n,.jd-tbl td.n{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.jd-tbl td{padding:10px 0;border-top:1px solid var(--rule-soft)}
.jd-bar{display:inline-block;width:80px;height:4px;border-radius:2px;background:var(--rule-soft);vertical-align:middle;margin-left:12px;overflow:hidden}
.jd-bar i{display:block;height:100%;background:var(--good)}
@media (max-width:600px){.jd-bar{width:40px;margin-left:8px}}

/* faces: the person's own picture (avatar.js fills any circle carrying data-av); initials until then */
.jd-faces{display:inline-flex;align-items:center;flex-shrink:0}
/* ⚠ A CIRCLE WITH INITIALS IN IT LINES UP BY ITS LETTERS, one with a picture by its bottom edge — so the
   same -6px put initials 7px under the words (he: 'the prototype makes it so neat'). Centred on the words
   instead, below, which is the same with a picture or without. */
.jd-face{width:22px;height:22px;border-radius:50%;color:#fff;font-size:10px;font-weight:600;
  display:inline-flex;align-items:center;justify-content:center;box-shadow:0 0 0 2px var(--surface);flex-shrink:0;
  background-position:center;background-size:cover}
.jd-faces .jd-face+.jd-face{margin-left:-7px}
.jd-face.lg{width:28px;height:28px;font-size:11px}
.jd-face.miss{opacity:.45}

/* ── visits: a calendar square per day, joined by a thin line ── */
.jd-visit{position:relative;display:grid;grid-template-columns:52px 1fr auto;gap:0 16px;align-items:center;padding:0 0 20px}
.jd-visit:last-child{padding-bottom:0}
.jd-visit:not(:last-child)::before{content:'';position:absolute;left:25.5px;top:58px;bottom:4px;width:1px;background:var(--rule)}
.jd-cal{width:52px;height:54px;border-radius:10px;background:var(--field);display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1}
.jd-cal .n{font-size:19px;font-weight:500;font-variant-numeric:tabular-nums}
.jd-cal .m{font-size:13px;color:var(--ink-faint);margin-top:4px}
.jd-visit.now .jd-cal{background:var(--warn-bg)}
.jd-visit.now .jd-cal .m{color:var(--warn)}
.jd-visit .body{min-width:0}
.jd-visit .top{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.jd-visit .d{font-size:15px;font-weight:500}
.jd-visit .d .wd{color:var(--ink-faint);font-weight:400}
.jd-visit .o{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--ink-soft)}
.jd-visit .o::before{content:'';width:7px;height:7px;border-radius:50%;background:var(--st)}
/* ⚠ ONE LINE OF TEXT. The names are a button and Map is a link, and drawn as boxes they sat
   2–4px under the time beside them — he asked why the time was not on the same line. */
.jd-who{font-size:13px;line-height:24px;color:var(--ink-soft);margin-top:4px}
.jd-who > .jd-face,.jd-who .jd-faces{vertical-align:middle;margin-right:6px;position:relative;top:-2px}
.jd-who .names{border:0;background:none;padding:0;margin:0;display:inline;font:inherit;line-height:inherit;color:var(--ink-soft);cursor:pointer}
.jd-who .names:hover{color:var(--ink)}
.jd-who a{color:var(--ink-soft);text-decoration:none;white-space:nowrap}
.jd-who a:hover{color:var(--ink);text-decoration:underline}
.jd-who a svg{width:14px;height:14px;vertical-align:-2px;margin-right:3px}
.jd-who .miss-note{color:var(--warn)}
.jd-rep{display:flex;align-items:center;gap:6px;position:relative}
.jd-rep a.btn-line{text-decoration:none}
.jd-rep .dead{font-size:13px;color:var(--accent);margin-right:4px;white-space:nowrap}
.jd-pwrap{position:relative;display:inline}
.jd-menu.people{min-width:260px;padding:8px}
.jd-menu.people .row{display:flex;align-items:center;gap:10px;padding:8px;font-size:15px;line-height:1.3}
.jd-menu.people .row .nm{flex:1}
.jd-menu.people .row .t{font-size:13px;color:var(--ink-soft);white-space:nowrap}
.jd-menu.people .row .t.miss{color:var(--warn)}
.jd-menu.people .row a{font-size:13px;color:var(--ink-soft);text-decoration:none;white-space:nowrap}
.jd-menu.people .row a:hover{color:var(--ink);text-decoration:underline}
.jd-menu.people .row a svg{width:14px;height:14px;vertical-align:-2px;margin-right:3px}
@media (max-width:600px){
  .jd-visit{grid-template-columns:52px 1fr;align-items:start}
  .jd-visit .body{padding-top:7px}
  .jd-rep{grid-column:2;margin-top:12px}
}

/* ── underline tabs: the days of the photos ── */
.jd-tabs{display:flex;gap:22px;border-bottom:1px solid var(--rule);margin-bottom:18px;overflow-x:auto;scrollbar-width:none}
/* more days than fit → an arrow at the end that has more, over a fade (jdTabsWire in jobdetail.js) */
.jd-tabwrap{position:relative;margin-bottom:18px}
.jd-tabwrap .jd-tabs{margin-bottom:0}
.jd-tabarr{position:absolute;top:0;bottom:1px;z-index:1;display:none;align-items:center;border:0;padding:0;cursor:pointer;color:var(--ink)}
.jd-tabarr.l{left:0;padding-right:30px;background:linear-gradient(90deg,var(--surface) 60%,transparent)}
.jd-tabarr.r{right:0;padding-left:30px;background:linear-gradient(270deg,var(--surface) 60%,transparent)}
.jd-tabwrap.more-l .jd-tabarr.l,.jd-tabwrap.more-r .jd-tabarr.r{display:flex}
.jd-tabarr span{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:var(--field);transition:background .12s var(--ease-out)}
.jd-tabarr:hover span{background:var(--field-h,var(--rule))}
.jd-tabarr svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.jd-tabs button{border:0;background:none;padding:10px 0 11px;font:400 15px 'Inter',sans-serif;color:var(--ink-soft);cursor:pointer;
  border-bottom:2px solid transparent;margin-bottom:-1px;white-space:nowrap}
.jd-tabs button:hover{color:var(--ink)}
.jd-tabs button.on{color:var(--ink);border-bottom-color:var(--ink);font-weight:500}

/* ── photos: no boxes; the note is edited where it is read ── */
.jd-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(168px,1fr));gap:20px 14px}
@media (max-width:600px){.jd-grid{grid-template-columns:1fr 1fr;gap:16px 10px}}
.jd-tile{position:relative;min-width:0}
.jd-tile.dragging{opacity:.3}
.jd-ph{position:relative;aspect-ratio:4/3;border-radius:8px;overflow:hidden;background:var(--field)}
.jd-ph[draggable="true"]{cursor:grab}
.jd-ph .pvth{display:block;width:100%;height:100%;border-radius:0}
.jd-ph img{-webkit-user-drag:none;user-select:none}
.jd-ph video{display:block;width:100%;height:100%;object-fit:cover;background:var(--stage)}
.jd-tools{position:absolute;left:0;right:0;top:0;display:flex;justify-content:space-between;padding:6px;
  opacity:0;transition:opacity .12s ease;pointer-events:none}
.jd-tile:hover .jd-tools,.jd-tile:focus-within .jd-tools{opacity:1;pointer-events:auto}
@media (hover:none){.jd-tools{opacity:1;pointer-events:auto}}
.jd-tools .mv{display:flex;gap:4px}
.jd-chip{width:30px;height:30px;border-radius:15px;border:0;background:rgba(0,0,0,.55);color:#fff;
  display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0}
.jd-chip:hover{background:rgba(0,0,0,.78)}
/* office: "Add day" sits under the red Edit, so it is a small outline, not a second red (one red per area) */
:where(body:not(.role-tech):not(.role-driver)) .jd-addday .btn-line.strong,
:where(body:not(.role-tech):not(.role-driver)) .jd-addday .btn-line.strong:hover{background:transparent;color:var(--ink);border-color:var(--bt-edge);
  min-height:32px;padding:0 14px;font-size:14px}
.jd-chip svg{width:16px;height:16px}
.jd-chip:disabled{opacity:.3;cursor:default}
.jd-cap{display:block;width:calc(100% + 12px);margin:6px -6px 0;border:1px solid transparent;background:none;border-radius:6px;
  padding:5px 6px;font:400 13px/1.45 'Inter',sans-serif;color:var(--ink);resize:none;overflow:hidden;min-height:30px}
textarea.jd-cap:hover{background:var(--field)}
textarea.jd-cap:focus{outline:none;background:var(--surface);border-color:var(--rule)}
textarea.jd-cap::placeholder{color:var(--ink-faint)}
div.jd-cap{white-space:pre-line;overflow-wrap:anywhere}
.jd-tile .day{font-size:13px;color:var(--ink-faint);margin-top:2px}
.jd-empty{font-size:15px;color:var(--ink-soft);padding:4px 0}

/* a file dragged in from the computer: the sign covers what can be seen of the pop-up */
.jd-dropsign{position:fixed;z-index:1001;border:2px dashed var(--ink-soft);border-radius:20px;
  background:color-mix(in srgb,var(--surface) 90%,transparent);display:flex;align-items:center;justify-content:center;
  font:500 19px 'Inter',sans-serif;color:var(--ink);pointer-events:none}
