/* The Arbor App.
 *
 * Visual language carried over from the 5 Oct concept demo, which Gary
 * navigated without instruction. Two deliberate changes:
 *
 *   1. System fonts, not Google Fonts. Nothing is fetched from a third party
 *      on a customer's phone — no fonts, no analytics, no scripts. Design
 *      rule 3 is about advertising; this is the same instinct applied to the
 *      network. "Barlow Condensed" is used if the device already has it.
 *   2. No phone frame. The demo drew one because it ran on a laptop. On a
 *      phone, the phone is the frame.
 *
 * --brand is set at runtime from the customer's own branding, and --on-brand
 * is computed for contrast, so a customer who picks a pale yellow still gets
 * readable text. Rule 4: their business name is the hero.
 */

:root {
  --ground:#E7E6E1; --panel:#FFFFFF; --sunk:#F4F3EF;
  --ink:#15191B; --ink-2:#4A5255; --ink-3:#7C8588;
  --line:#DCDBD4; --line-2:#BFBEB4;
  --pine:#1F5D4C; --pine-soft:#DDEBE5;
  --amber:#8A5A12; --amber-soft:#F7EBD6;
  --red:#8E3527; --red-soft:#F8E6E2;
  --steel:#3A5570; --steel-soft:#E1E8EF;

  --brand:#1F5D4C; --on-brand:#FFFFFF; --brand-on-surface:#1F5D4C;
  /* The field both logos sit on. Trade logos are drawn for light
   * backgrounds — most have white baked in — so they get a white panel
   * rather than floating on the brand colour. */
  --cap:#FFFFFF;

  --disp:"Barlow Condensed","Haettenschweiler","Arial Narrow",system-ui,sans-serif;
  --body:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,system-ui,sans-serif;
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;

  --tap:44px;
  color-scheme:light;
}

@media (prefers-color-scheme:dark){ :root:not([data-theme="light"]){
  --cap:#ECEAE4;
  --cap:#ECEAE4;
  --ground:#121513; --panel:#1C201E; --sunk:#242825;
  --ink:#ECEEE9; --ink-2:#BCC2BD; --ink-3:#8C948E;
  --line:#333936; --line-2:#4A524D;
  --pine:#7FC3AB; --pine-soft:#1B3029;
  --amber:#DCA85C; --amber-soft:#332913;
  --red:#E58A78; --red-soft:#331F1B;
  --steel:#8FB0CE; --steel-soft:#1B2630;
  --brand-on-surface:#7FC3AB;
  color-scheme:dark;
}}
:root[data-theme="dark"]{
  --cap:#ECEAE4;
  --cap:#ECEAE4;
  --ground:#121513; --panel:#1C201E; --sunk:#242825;
  --ink:#ECEEE9; --ink-2:#BCC2BD; --ink-3:#8C948E;
  --line:#333936; --line-2:#4A524D;
  --pine:#7FC3AB; --pine-soft:#1B3029;
  --amber:#DCA85C; --amber-soft:#332913;
  --red:#E58A78; --red-soft:#331F1B;
  --steel:#8FB0CE; --steel-soft:#1B2630;
  --brand-on-surface:#7FC3AB;
  color-scheme:dark;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--panel); color:var(--ink);
  font-family:var(--body); font-size:16px; line-height:1.5;
  -webkit-font-smoothing:antialiased;
  -webkit-text-size-adjust:100%;
  min-height:100vh; min-height:100dvh;
  display:flex; flex-direction:column;
}
img{max-width:100%;display:block}
[hidden]{display:none!important}
button{font:inherit;color:inherit}
a{color:var(--brand-on-surface)}

/* ---------------------------------------------------------- the header -- */
/* Their business name, their logo, their colour. The point of the whole thing. */
/* ------------------------------------------------------------ the header ---
 * Theirs, not ours. Tall, in their colour, with their logo on a badge that
 * hangs over the bottom edge so it reads as their mark on the page rather
 * than a logo filed in a corner. The Arbor Mech mark sits small and top
 * right: present, clearly secondary.
 */
.brand{
  background:var(--brand); color:var(--on-brand);
  /* The bottom padding is the crest's room. The badge hangs below this edge
     and rises above it, so without it the logo sits on top of the subline. */
  padding:calc(env(safe-area-inset-top,0px) + 22px) 16px 48px;
  position:sticky; top:0; z-index:20;
  /* The crest hangs past this edge. */
  overflow:visible;
  min-height:152px;
  display:flex; flex-direction:column; justify-content:flex-end;
  margin-bottom:26px;
}
/* A wash of their own logo across the header, barely there. Gives the bar
   some of their texture without competing with their name. */
.brand-tint{
  position:absolute; inset:0; pointer-events:none; overflow:hidden;
  background-image:var(--brand-logo, none);
  background-repeat:no-repeat; background-position:right -40px center;
  background-size:auto 190%;
  opacity:.07; filter:grayscale(1) contrast(.6);
}
.brand > *{position:relative}

/* The name clears the Arbor Mech chip on the right, and -- when their logo
   is a badge rather than a wordmark -- sits to the right of it. */
.brand .who{min-width:0; padding-right:58px; transition:padding-left .12s ease}
.brand.has-badge .who{padding-left:136px}
/* A phone has no width to spare. At 124px the name wrapped to three lines;
   the badge gives some back rather than the name losing a line. */
@media (max-width:430px){.brand.has-badge .who{padding-left:102px}}
@media (max-width:360px){.brand.has-badge .who{padding-left:92px}}
.brand .who b{
  display:block; font-family:var(--disp); font-size:1.75rem; font-weight:700;
  line-height:1.03; text-transform:uppercase; letter-spacing:.005em;
  overflow-wrap:anywhere;
}
@media (max-width:360px){.brand .who b{font-size:1.5rem}}
.brand .who span{
  display:block; font-size:.75rem; opacity:.88; font-family:var(--mono);
  letter-spacing:.04em; margin-top:5px;
}
/* The workshop's name inside the subline. More specific than `.brand .who b`,
 * which is the customer's name and would otherwise make this 1.75rem and
 * uppercase on its own line. Here it is the same size as the words around it
 * and simply carries more weight. */
.brand .who span b{
  display:inline; font-family:inherit; font-size:inherit; line-height:inherit;
  text-transform:none; letter-spacing:inherit; font-weight:700; opacity:1;
}

/* Arbor Mech's own mark. Small, top right, on a white chip so it reads on
   any brand colour. Ours is the one that gets out of the way. */
.brand .mark{
  position:absolute; top:calc(env(safe-area-inset-top,0px) + 14px); right:14px;
  width:38px; height:38px; object-fit:contain; border-radius:50%;
  background:#fff; padding:3px; box-shadow:0 1px 4px rgba(0,0,0,.18);
}

/* Their badge, breaking out of the top-left corner: larger than the Arbor
   Mech chip by some way, high in the header, and hanging over both the left
   edge and the bottom. The name sits to its right. */
.crest{
  position:absolute; left:-6px; bottom:-26px;
  width:132px; height:104px; border-radius:11px;
  background:var(--cap); box-shadow:0 4px 14px rgba(0,0,0,.26);
  display:grid; place-items:center; overflow:hidden; padding:9px;
  font-family:var(--disp); font-weight:700; font-size:1.8rem;
  letter-spacing:.01em; color:var(--brand-on-surface);
}
@media (max-width:430px){.crest{width:98px; height:88px; border-radius:10px}}
@media (max-width:360px){.crest{width:88px; height:80px}}
/* max, not 100%. As a centred grid item a width/height of 100% is
   indeterminate, so the image fell back to its intrinsic size and spilled
   out of a short badge -- Ironbark's logo was 116px tall in a 62px box and
   lost its bottom third. */
.crest img{max-width:100%; max-height:100%; width:auto; height:auto;
  object-fit:contain}
/* A wordmark cannot go in the corner -- at that width it would take the
   whole bar. It runs along the bottom instead, under the name, which is
   the shape it was drawn for. */
.crest.wide{
  left:16px; width:min(72vw, 250px); height:72px; bottom:-26px;
  padding:10px 14px; border-radius:9px;
}
@media (max-width:360px){.crest.wide{width:min(76vw, 210px); height:54px}}
/* The header's own margin clears the overhang -- no change to main, whose
   padding rule comes later in this file and would win anyway. */
.view.on > :first-child{margin-top:0}

/* --------------------------------------------------------- the page wash ---
 * Their logo, very large and very faint, behind everything. On a phone a
 * suggestion of texture; on a wide screen it fills the gutters either side
 * of the column, which is where the app stops looking like a form and
 * starts looking like theirs.
 *
 * Fixed, so it does not scroll; behind everything, so it never intercepts a
 * tap; and low enough in contrast that text over it is unaffected.
 */
.pagewash{
  position:fixed; inset:0; z-index:-1; pointer-events:none; overflow:hidden;
  background-color:var(--brand-wash, transparent);
}
/* One element per gutter, each sized to hold the WHOLE logo.
 *
 * Two background layers on a single full-width element could not do this:
 * sized to the viewport's height a wordmark is far wider than the gutter, so
 * each side showed a different crop of it -- Melbourne Treeworks read
 * "OURNE WORKS" on the left and "MELBO TREEW" on the right, each the half
 * you would not expect. Contained inside a gutter-shaped box, both sides
 * show the mark whole. */
.pagewash::before, .pagewash::after{
  content:""; position:absolute; top:0; bottom:0;
  width:max(0px, calc((100vw - 640px) / 2));
  background-image:var(--brand-logo, none);
  background-repeat:no-repeat; background-position:center;
  background-size:min(84%, 420px) auto;
  opacity:.14; filter:saturate(.75);
}
.pagewash::before{left:0}
.pagewash::after{right:0}

/* Below that there is no gutter, so the wash goes behind the content --
   large, soft and well out of the way of the text. */
@media (max-width:759px){
  .pagewash::before{
    width:100%; left:0;
    background-size:min(150%, 560px) auto; background-position:center 22%;
    opacity:.05; filter:blur(1px) saturate(.6);
  }
  .pagewash::after{display:none}
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]) .pagewash::before,
  :root:not([data-theme="light"]) .pagewash::after{opacity:.09; filter:saturate(.5)}
}
:root[data-theme="dark"] .pagewash::before,
:root[data-theme="dark"] .pagewash::after{opacity:.09; filter:saturate(.5)}

/* ------------------------------------------------------------ layout ---- */
main{flex:1;padding:16px 16px 24px;max-width:640px;width:100%;margin:0 auto}
.view{display:none}
.view.on{display:block;animation:in .18s ease-out}
@keyframes in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.view.on{animation:none}}

h2.sec{
  font-family:var(--mono);font-size:.66rem;letter-spacing:.14em;text-transform:uppercase;
  /* Theirs. Grey said "a form"; this is one of the places the colour costs
     nothing and is noticed. Status colours stay semantic -- see .chip. */
  color:var(--brand-on-surface);margin:22px 0 9px;font-weight:700;
}
h2.sec:first-child{margin-top:4px}

/* ----------------------------------------------------------- machines --- */
.mach{
  width:100%;text-align:left;background:var(--sunk);
  border:1px solid var(--line);border-left:4px solid var(--line-2);
  padding:12px 13px;margin-bottom:9px;border-radius:4px;cursor:pointer;
  display:grid;grid-template-columns:1fr auto auto;gap:3px 10px;align-items:start;
  min-height:var(--tap);
}
.mach:hover{border-color:var(--brand-on-surface)}
.mach:focus-visible{outline:2px solid var(--brand-on-surface);outline-offset:2px}
.mach .nm{grid-column:1;grid-row:1;font-weight:650;font-size:1rem;line-height:1.25;
  overflow-wrap:anywhere}
.mach .mt{grid-column:1/3;grid-row:2;font-family:var(--mono);font-size:.72rem;
  color:var(--ink-3)}
.mach .chip{grid-column:2;grid-row:1}
.mach .pholder{grid-column:1/3;grid-row:3}
.mach.ok{border-left-color:var(--pine)}
.mach.soon{border-left-color:var(--amber)}
.mach.over{border-left-color:var(--red)}
.mach.in{border-left-color:var(--steel)}
.mach.unknown{border-left-color:var(--line-2)}
/* A span wrapping the image, so the "Illustration" tag can sit on it. */
.mach .thumb{
  grid-column:3;grid-row:1/4;align-self:center;position:relative;
  width:68px;height:52px;border-radius:4px;overflow:hidden;
  background:var(--panel);display:block;flex:none;
}
.mach .thumb img{width:100%;height:100%;object-fit:cover;display:block}
/* A drawing sits on its background rather than filling the frame. */
.mach .thumb.is-drawn{background:var(--sunk);border:1px solid var(--line)}
.mach .thumb.is-drawn img{object-fit:contain}

.chip{
  font-family:var(--mono);font-size:.62rem;letter-spacing:.07em;text-transform:uppercase;
  font-weight:700;padding:.24rem .45rem;white-space:nowrap;align-self:start;
  border:1px solid currentColor;border-radius:2px;
}
/* Status colours are NOT the customer's brand colour and must not become
 * it. Green means up to date, amber means due, red means overdue. A
 * customer whose logo is red would otherwise read "up to date" in red. */
.chip.ok{color:var(--pine);background:var(--pine-soft)}
.chip.soon{color:var(--amber);background:var(--amber-soft)}
.chip.over{color:var(--red);background:var(--red-soft)}
.chip.in{color:var(--steel);background:var(--steel-soft)}
.chip.unknown{color:var(--ink-3);background:var(--sunk)}
/* Not seen in a while. Deliberately not red and not amber: two years without
 * a visit usually means sold, retired or going elsewhere, and a warning
 * colour would be telling the customer off for something that is probably
 * not true. */
.chip.stale{color:var(--ink-2);background:var(--sunk);border:1px solid var(--line)}

/* ------------------------------------------------------------ detail ---- */
.back{
  background:none;border:0;padding:8px 0;margin:0 0 6px;color:var(--ink-3);
  font-family:var(--mono);font-size:.75rem;cursor:pointer;min-height:var(--tap);
}
.back:hover{color:var(--ink)}
.title{
  font-family:var(--disp);font-size:2rem;text-transform:uppercase;font-weight:600;
  line-height:1.02;margin:2px 0 8px;overflow-wrap:anywhere;
}
.hero{width:100%;aspect-ratio:16/9;object-fit:cover;border-radius:5px;margin:10px 0 14px;background:var(--sunk)}
.kv{display:grid;grid-template-columns:auto 1fr;gap:7px 16px;margin:0;font-size:.94rem}
.kv dt{color:var(--ink-3);font-family:var(--mono);font-size:.74rem;align-self:center}
.kv dd{margin:0;font-weight:550;text-align:right}

.btn{
  display:block;width:100%;background:var(--brand);color:var(--on-brand);
  border:0;border-radius:4px;padding:14px;margin:16px 0 4px;
  font-weight:650;font-size:1rem;cursor:pointer;min-height:var(--tap);
}
.btn:hover{filter:brightness(1.08)}
.btn:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.btn.ghost{background:none;color:var(--ink-2);border:1px solid var(--line-2)}
.btn[disabled]{opacity:.55;cursor:default}

/* ----------------------------------------------------------- logbook ---- */
.log{border-left:2px solid var(--line);margin:4px 0 0 5px;padding-left:16px;
     display:flex;flex-direction:column;gap:16px}
.ent{position:relative}
.ent::before{
  content:"";position:absolute;left:-21px;top:6px;width:9px;height:9px;border-radius:50%;
  background:var(--brand);box-shadow:0 0 0 3px var(--panel);
}
.ent .d{font-family:var(--mono);font-size:.7rem;color:var(--ink-3)}
.ent .t{font-weight:600;font-size:.95rem;margin-top:1px}
.ent p{margin:4px 0 0;font-size:.9rem;color:var(--ink-2)}
.ent ul{margin:5px 0 0;padding-left:17px;font-size:.87rem;color:var(--ink-2)}
.ent .cost{font-family:var(--mono);font-size:.8rem;color:var(--ink-3);margin-top:5px}
.ent .shots{display:flex;gap:6px;margin-top:8px;flex-wrap:wrap}
.ent .shots img{width:88px;height:66px;object-fit:cover;border-radius:3px}

/* ------------------------------------------------------------- slots ---- */
.slot{
  display:flex;width:100%;justify-content:space-between;align-items:center;gap:12px;
  background:var(--sunk);border:1px solid var(--line);border-radius:4px;
  padding:13px;margin-bottom:8px;cursor:pointer;text-align:left;min-height:var(--tap);
}
.slot:hover{border-color:var(--brand-on-surface)}
.slot b{font-weight:650}
.slot span{font-family:var(--mono);font-size:.72rem;color:var(--ink-3)}

/* -------------------------------------------------------------- notes --- */
.note{
  background:var(--brand-soft, var(--sunk));
  border:1px solid var(--brand-line, var(--line));border-left:3px solid var(--brand);
  padding:11px 13px;font-size:.87rem;color:var(--ink-2);margin:14px 0;border-radius:3px;
}
.empty{
  text-align:center;color:var(--ink-3);padding:34px 18px;
  border:1px dashed var(--line-2);border-radius:5px;font-size:.92rem;
}
.empty b{display:block;color:var(--ink-2);font-size:1rem;margin-bottom:5px;font-weight:600}
.problem{background:var(--red-soft);color:var(--red);border:1px solid var(--red);
         padding:11px 13px;border-radius:3px;font-size:.9rem;margin:12px 0}
.ok-msg{background:var(--pine-soft);color:var(--pine);border:1px solid var(--pine);
        padding:11px 13px;border-radius:3px;font-size:.9rem;margin:12px 0}

textarea,input[type=email],input[type=text]{
  width:100%;font:inherit;font-size:16px;padding:11px;border:1px solid var(--line-2);
  border-radius:4px;background:var(--panel);color:var(--ink);
}
textarea{min-height:120px;resize:vertical}
label,.lbl{display:block;font-size:.85rem;color:var(--ink-2);margin:12px 0 5px;font-weight:550}
label.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);
  white-space:nowrap;margin:0}

/* --------------------------------------------------------------- tabs --- */
nav.tabs{
  position:sticky;bottom:0;display:flex;background:var(--panel);
  border-top:1px solid var(--line);z-index:20;
  padding-bottom:env(safe-area-inset-bottom,0px);
}
nav.tabs button{
  flex:1;background:none;border:0;padding:9px 4px 7px;cursor:pointer;position:relative;
  display:flex;flex-direction:column;align-items:center;gap:3px;
  font-size:.66rem;color:var(--ink-3);font-family:var(--mono);letter-spacing:.05em;
  text-transform:uppercase;min-height:var(--tap);
}
nav.tabs button svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;
  stroke-linecap:round;stroke-linejoin:round}
nav.tabs button[aria-selected=true]{color:var(--brand-on-surface);font-weight:700}

/* ------------------------------------------------------------ sign in --- */
.signin{max-width:420px;margin:0 auto;padding:12vh 20px 40px;text-align:left}
.signin h1{font-family:var(--disp);text-transform:uppercase;font-size:2.4rem;
           line-height:1;margin:0 0 6px;font-weight:700}
.signin p.lede{color:var(--ink-2);margin:0 0 24px}
.muted{color:var(--ink-3);font-size:.82rem}
.devlink{background:var(--amber-soft);border:1px solid var(--amber);color:var(--amber);
         padding:11px;border-radius:3px;font-size:.8rem;margin-top:14px;word-break:break-all}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* contact */
.contact-row{display:flex;gap:9px;margin-top:4px}
.contact-row a{
  flex:1;display:flex;flex-direction:column;align-items:center;gap:4px;
  background:var(--sunk);border:1px solid var(--line);border-radius:4px;
  padding:13px 8px;text-decoration:none;color:var(--ink);min-height:var(--tap);
  font-weight:600;font-size:.92rem;
}
.contact-row a:hover{border-color:var(--brand-on-surface)}
.contact-row a span{font-family:var(--mono);font-size:.7rem;color:var(--ink-3);font-weight:400;
  overflow-wrap:anywhere;text-align:center}
.contact-row svg{width:21px;height:21px;fill:none;stroke:var(--brand);stroke-width:1.8;
  stroke-linecap:round;stroke-linejoin:round}

/* booking extras */
.extra{display:flex;gap:11px;align-items:flex-start;background:var(--sunk);
  border:1px solid var(--line);border-radius:4px;padding:11px 13px;margin-bottom:7px;
  cursor:pointer;min-height:var(--tap)}
.extra:hover{border-color:var(--brand-on-surface)}
.extra input{width:20px;height:20px;margin:1px 0 0;flex:none;
  accent-color:var(--brand-on-surface)}
.extra b{font-weight:600;font-size:.94rem;display:block}
.extra span{font-size:.8rem;color:var(--ink-3)}

/* the pointer back to the real record */
.ent .src{font-family:var(--mono);font-size:.68rem;color:var(--ink-3);margin-top:6px}
.ent .jobno{display:inline-block;font-family:var(--mono);font-size:.72rem;font-weight:700;
  color:var(--brand-on-surface);background:var(--sunk);border:1px solid var(--line);
  border-radius:2px;padding:.1rem .35rem;margin-right:6px}

/* pilot mode: content still being trialled, visibly so */
.ent ul.trial li{color:var(--amber)}
.ent .trialnote{font-family:var(--mono);font-size:.66rem;color:var(--amber);
  letter-spacing:.04em;margin-top:4px}

/* How many in-app messages are waiting, on the Account tab. Empty renders
   as nothing at all: a badge showing zero is a badge asking to be ignored. */
nav.tabs .badge{display:none}
nav.tabs .badge:not(:empty){display:inline-grid;place-items:center;
  position:absolute;top:4px;margin-left:26px;min-width:17px;height:17px;
  padding:0 4px;border-radius:999px;background:var(--red);color:#fff;
  font-family:var(--mono);font-size:.62rem;font-style:normal;line-height:1}

/* The workshop's answer, under the thing it answers. Marked as coming
   from a person: being replied to is the whole point of the Tell us tab. */
.note .reply{margin:9px 0 0;padding:8px 0 0 11px;border-left:3px solid var(--pine);
  border-top:1px solid var(--line)}
.note .reply .who{display:block;font-family:var(--mono);font-size:.66rem;
  letter-spacing:.05em;text-transform:uppercase;color:var(--ink-3);margin-bottom:3px}
.note .reply p{margin:0;color:var(--ink)}

/* Getting it onto their phone.
   Sits above the tab bar rather than over the content: an app that covers
   what you came to look at is an app you close. */
.installbar{
  position:fixed; left:0; right:0; bottom:var(--tabbar, 58px); z-index:40;
  background:var(--panel); border-top:1px solid var(--line);
  box-shadow:0 -4px 18px rgba(0,0,0,.10);
  padding:13px 16px calc(13px + env(safe-area-inset-bottom, 0px));
}
.installbar[hidden]{display:none}
.installbar .line b{display:block;font-size:1rem}
.installbar .line span{display:block;font-size:.86rem;color:var(--ink-2);margin-top:3px}
.installbar .row{display:flex;gap:9px;margin-top:11px}
.installbar .row .btn{width:auto;flex:1 1 auto;margin:0;padding:11px 14px;font-size:.92rem}
.installbar .steps b{display:block;font-size:1rem;margin-bottom:9px}
.installbar .step{display:flex;align-items:center;gap:11px;margin-bottom:9px;
  font-size:.9rem;color:var(--ink)}
.installbar .step svg{width:26px;height:26px;flex:none;fill:none;
  stroke:var(--brand-on-surface);stroke-width:1.8;
  stroke-linecap:round;stroke-linejoin:round}
.installbar .step .num{width:26px;height:26px;flex:none;display:grid;
  place-items:center;border-radius:50%;background:var(--brand);
  color:var(--on-brand);font-family:var(--mono);font-size:.8rem;font-weight:700}
.installbar .steps p{margin:10px 0 0;font-size:.84rem;color:var(--ink-2)}

/* Checks the owner keeps, whoever does the testing. */
.compliance{margin:22px 0 0}
.comprow{background:var(--panel);border:1px solid var(--line);border-radius:5px;
  margin-bottom:7px;overflow:hidden}
.comprow > summary{cursor:pointer;list-style:none;padding:11px 13px;
  display:grid;grid-template-columns:1fr auto;gap:2px 9px;align-items:baseline;
  min-height:var(--tap)}
.comprow > summary::-webkit-details-marker{display:none}
.comprow > summary b{font-size:.98rem}
.comprow .cstate{font-family:var(--mono);font-size:.66rem;letter-spacing:.04em;
  text-transform:uppercase;padding:.14rem .45rem;border-radius:3px;justify-self:end}
.comprow .cstate.over{color:var(--red);background:var(--red-soft)}
.comprow .cstate.soon{color:var(--amber);background:var(--amber-soft)}
.comprow .cstate.ok{color:var(--pine);background:var(--pine-soft)}
.comprow .cstate.unknown{color:var(--ink-3);background:var(--sunk)}
.comprow .cdetail{font-size:.85rem;color:var(--ink-2);grid-column:1}
.comprow .cours{font-family:var(--mono);font-size:.62rem;letter-spacing:.04em;
  text-transform:uppercase;color:var(--amber);justify-self:end}
.compbody{padding:0 13px 13px;border-top:1px solid var(--line)}
.cfield{display:block;margin-top:10px}
.cfield > span{display:block;font-size:.78rem;color:var(--ink-2);margin-bottom:3px}
.cfield input{width:100%;font:inherit;font-size:.92rem;padding:9px 10px;
  border:1px solid var(--line);border-radius:4px;background:var(--panel);
  color:var(--ink);min-height:var(--tap)}
.compbody .row{display:flex;gap:9px;margin-top:12px}
.compbody .row .btn{width:auto;flex:1 1 auto;margin:0;padding:10px 14px;font-size:.9rem}
.compliance > .btn{margin-top:10px}
/* Whose job this is. The booking button further up the screen is for
   servicing; none of the testing below it is ours, and the two must not
   blur into somebody waiting on us for an inspection we cannot do. */
.compliance .notours{margin:0 0 12px;padding:10px 12px;font-size:.88rem;
  color:var(--ink);background:var(--steel-soft);border-left:3px solid var(--steel);
  border-radius:0 4px 4px 0}
.compbody .meta{margin:12px 0 0;font-size:.84rem;color:var(--ink-2)}

/* The one thing to do, above the list of things that are wrong. */
.startwith{background:var(--panel);border:1px solid var(--line);
  border-left:4px solid var(--red);border-radius:6px;padding:14px 15px;margin:0 0 16px}
.startwith.clear{border-left-color:var(--pine)}
.startwith .eyebrow{display:block;font-family:var(--mono);font-size:.66rem;
  letter-spacing:.07em;text-transform:uppercase;color:var(--ink-3);margin-bottom:5px}
.startwith b{display:block;font-size:1.12rem;line-height:1.25}
.startwith .det{margin:3px 0 0;font-weight:600;color:var(--red)}
.startwith.clear .det{color:var(--pine)}
.startwith p{margin:6px 0 0;font-size:.88rem;color:var(--ink-2)}
.startwith .row{display:flex;gap:9px;flex-wrap:wrap;margin-top:12px}
.startwith .row .btn{width:auto;flex:1 1 auto;margin:0;padding:11px 14px;font-size:.92rem}

/* ALL / yard / yard, for the few customers with more than one premises */
.yards{display:flex;gap:7px;flex-wrap:wrap;margin:0 0 14px}
.yards .yard{display:inline-flex;align-items:center;gap:7px;width:auto;margin:0;
  background:var(--sunk);color:var(--ink-2);border:1px solid var(--line);
  border-radius:999px;padding:7px 13px;font-size:.84rem;font-weight:600;
  min-height:var(--tap);cursor:pointer}
.yards .yard .n{font-family:var(--mono);font-size:.72rem;color:var(--ink-3)}
.yards .yard.on{background:var(--brand);color:var(--on-brand);border-color:var(--brand)}
.yards .yard.on .n{color:var(--on-brand);opacity:.75}

/* the service year */
.legend{display:flex;flex-wrap:wrap;gap:7px 12px;margin:0 0 16px}
.legend span{display:inline-flex;align-items:center;gap:5px;font-size:.76rem;color:var(--ink-2)}
.legend i{width:11px;height:11px;border-radius:3px;display:inline-block;flex:none}

.mon{border-top:1px solid var(--line);padding:11px 0 4px}
.mon:first-of-type{border-top:0}
.mon > h3{
  margin:0 0 8px;font-family:var(--mono);font-size:.7rem;letter-spacing:.12em;
  text-transform:uppercase;color:var(--ink-3);font-weight:600;
}
.mon.now > h3{color:var(--brand-on-surface)}
.mon.empty{padding:7px 0}
.mon.empty > h3{margin:0;opacity:.55}

.cal-row{
  display:grid;grid-template-columns:4px 1fr auto;gap:0 11px;align-items:center;
  background:var(--sunk);border:1px solid var(--line);border-radius:4px;
  padding:10px 12px 10px 0;margin-bottom:7px;overflow:hidden;min-height:var(--tap);
  width:100%;text-align:left;cursor:pointer;
}
.cal-row:hover{border-color:var(--brand-on-surface)}
.cal-row .bar{grid-column:1;grid-row:1/3;width:4px;align-self:stretch;border-radius:0}
.cal-row .nm{grid-column:2;grid-row:1;font-weight:600;font-size:.94rem;line-height:1.25;
  overflow-wrap:anywhere}
.cal-row .sub{grid-column:2;grid-row:2;font-family:var(--mono);font-size:.7rem;
  color:var(--ink-3)}
.cal-row .when{grid-column:3;grid-row:1/3;font-family:var(--mono);font-size:.72rem;
  color:var(--ink-3);white-space:nowrap;align-self:center;text-align:right}
.cal-row.projected{background:transparent;border-style:dashed;opacity:.8}
.cal-row.in_workshop .nm{color:var(--steel)}

.tell-date{display:flex;gap:8px;align-items:center;margin-top:8px;flex-wrap:wrap}
.tell-date input{flex:1;min-width:150px;font:inherit;font-size:16px;padding:10px;
  border:1px solid var(--line-2);border-radius:4px;background:var(--panel);color:var(--ink)}
.tell-date button{background:var(--brand);color:var(--on-brand);border:0;border-radius:4px;
  padding:10px 15px;font-weight:600;cursor:pointer;min-height:var(--tap)}

/* the add-a-machine picker: the same click-through as the workshop app */
.pick{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-bottom:6px}
.pick button{
  background:var(--sunk);border:1px solid var(--line);border-radius:5px;
  padding:15px 13px;text-align:left;cursor:pointer;min-height:68px;
  display:flex;flex-direction:column;justify-content:center;gap:5px;
  font-weight:650;font-size:.96rem;line-height:1.25;overflow-wrap:anywhere;
}
.pick button:hover{border-color:var(--brand-on-surface)}
.pick button .ic{font-size:1.3rem;line-height:1}
/* Our drawing of the machine, not an emoji of something adjacent to it. */
.pick button .pick-art{
  width:100%; max-width:112px; height:54px; object-fit:contain;
  display:block; margin:0 auto 2px;
}
@media (max-width:340px){.pick button .pick-art{height:46px}}
@media (max-width:340px){.pick{grid-template-columns:1fr}}

/* a machine the customer added that we have not seen yet */
.chip.placeholder{color:var(--ink-3);background:var(--sunk)}
.mach.is-placeholder{border-left-style:dashed}
.pholder{
  font-family:var(--mono);font-size:.66rem;letter-spacing:.05em;color:var(--ink-3);
  border:1px dashed var(--line-2);border-radius:2px;padding:.1rem .35rem;
  display:inline-block;margin-top:6px;
}

/* ------------------------------------------------- the month calendar --- */
.calnav{display:flex;align-items:center;gap:10px;margin:2px 0 12px}
.calnav b{
  flex:1;text-align:center;font-family:var(--disp);font-size:1.45rem;
  text-transform:uppercase;font-weight:600;letter-spacing:.01em;
}
.calnav button{
  width:42px;height:42px;flex:none;border:1px solid var(--line-2);border-radius:5px;
  background:var(--sunk);font-size:1.3rem;line-height:1;cursor:pointer;color:var(--ink-2);
}
.calnav button:hover:not(:disabled){border-color:var(--brand-on-surface);color:var(--ink)}
.calnav button:disabled{opacity:.3;cursor:default}

.dow{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;margin-bottom:5px}
.dow span{
  text-align:center;font-family:var(--mono);font-size:.62rem;letter-spacing:.08em;
  color:var(--ink-3);text-transform:uppercase;
}
.grid{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}
.grid .day{
  aspect-ratio:1;border-radius:5px;border:1px solid var(--line);
  background:var(--sunk);display:grid;place-items:center;
  font-size:.86rem;font-weight:550;color:var(--ink-2);
  padding:0;cursor:default;position:relative;
}
.grid .day.blank{background:none;border-color:transparent}
.grid .day.has{cursor:pointer}
.grid .day.has:hover{outline:2px solid var(--brand-on-surface);outline-offset:1px}
/* a booking that is actually on the books */
.grid .day.filled{color:#fff;border-color:transparent;font-weight:700}
/* one we expect, from how often the machine is done */
.grid .day.dotted{border:2px dashed var(--dot,var(--line-2));background:none;font-weight:600}
.grid .day.today{box-shadow:inset 0 0 0 2px var(--ink)}
.grid .day .n{position:relative;z-index:1}

.keyswatch{
  display:inline-block;width:13px;height:13px;border-radius:3px;vertical-align:-2px;
  margin-right:3px;
}
.keyswatch.filled{background:var(--ink-3)}
.keyswatch.dotted{border:2px dashed var(--ink-3)}

#cal-day{margin-top:14px}
#cal-day .dayhead{
  font-family:var(--mono);font-size:.68rem;letter-spacing:.12em;text-transform:uppercase;
  color:var(--ink-3);margin-bottom:8px;
}

/* fleet, grouped */
h2.sec.grp{margin-top:20px}
h2.sec.grp:first-of-type{margin-top:6px}
#fleet-heading{
  font-family:var(--body);font-size:.92rem;letter-spacing:0;text-transform:none;
  color:var(--ink-2);font-weight:550;margin-bottom:14px;
}

/* ----------------------------------------------- the reading round ----- */
/* Designed for a phone held in one cold hand, in a yard, in the sun:
 * big targets, big numbers, a numeric keypad, nothing fiddly. */
.rd{
  background:var(--sunk);border:1px solid var(--line);border-left:4px solid var(--line-2);
  border-radius:5px;padding:13px;margin-bottom:11px;
}
.rd.done{border-left-color:var(--pine);background:var(--pine-soft)}
.rd .who{display:flex;align-items:baseline;gap:9px;flex-wrap:wrap;margin-bottom:3px}
.rd .who b{font-size:1.02rem;font-weight:650;line-height:1.2;overflow-wrap:anywhere}
.rd .who span{font-family:var(--mono);font-size:.68rem;color:var(--ink-3)}
.rd .was{font-family:var(--mono);font-size:.72rem;color:var(--ink-3);margin-bottom:9px}
.rd .fields{display:flex;gap:10px}
.rd .field{flex:1;display:flex;flex-direction:column;gap:4px}
.rd .field label{
  margin:0;font-family:var(--mono);font-size:.64rem;letter-spacing:.1em;
  text-transform:uppercase;color:var(--ink-3);font-weight:600;
}
.rd input{
  width:100%;font-size:1.65rem;font-weight:650;font-variant-numeric:tabular-nums;
  padding:12px 13px;border:1px solid var(--line-2);border-radius:5px;
  background:var(--panel);color:var(--ink);min-height:62px;
  -moz-appearance:textfield;
}
.rd input::-webkit-outer-spin-button,.rd input::-webkit-inner-spin-button{
  -webkit-appearance:none;margin:0}
.rd input:focus{outline:3px solid var(--brand-on-surface);outline-offset:1px;
  border-color:var(--brand-on-surface)}
.rd input::placeholder{font-weight:400;color:var(--ink-3);font-size:1.1rem}

#round-save{position:sticky;bottom:12px;box-shadow:0 6px 18px rgba(0,0,0,.18)}
#round-count{font-variant-numeric:tabular-nums}

/* the early-booking nudge */
.ahead{
  background:var(--amber-soft);border:1px solid var(--amber);border-left:3px solid var(--amber);
  color:var(--amber);padding:11px 13px;border-radius:3px;font-size:.88rem;margin:14px 0;
}
.ahead b{display:block;margin-bottom:3px}

/* ------------------------------------------------- equipment artwork --- */
/* Drawings that stand in until there is a photo. They are coloured and
 * shaded enough to be taken for a photo at a glance, so every one of them
 * carries a visible "Illustration" tag and an obvious way to add a real
 * photo instead. See prompts/04-equipment-artwork.md, step 4. */

.illus-tag{
  position:absolute; left:7px; bottom:7px;
  font-family:var(--mono); font-size:.58rem; letter-spacing:.09em;
  text-transform:uppercase; font-weight:700;
  background:rgba(21,25,27,.72); color:#fff;
  padding:.18rem .4rem; border-radius:2px; pointer-events:none;
}
/* The thumbnail wrapper and the hero both need to position the tag. */
/* At 68px the word does not fit and shouting it adds nothing — the hero
 * carries the full tag. Here a corner mark is enough to say "drawn", and
 * the image still has its alt text for anyone who cannot see it. */
.mach .thumb .illus-tag{
  left:auto; right:0; bottom:0; font-size:0; line-height:0;
  width:0; height:0; padding:0; border-radius:0;
  border-style:solid; border-width:0 0 15px 15px;
  border-color:transparent transparent rgba(21,25,27,.55) transparent;
  background:none;
}

.hero-box{margin:10px 0 14px}
figure.hero{margin:0; position:relative; border-radius:5px; overflow:hidden;
            background:var(--sunk)}
figure.hero img{display:block; width:100%; aspect-ratio:16/9; object-fit:cover}
/* A drawing is on a transparent canvas, so it sits rather than fills. */
figure.hero.is-drawn{background:var(--sunk); border:1px solid var(--line)}
figure.hero.is-drawn img{object-fit:contain; padding:4px}

.hero-actions{display:flex; gap:8px; margin-top:8px; flex-wrap:wrap}
.hero-actions button, .hero-actions label{
  flex:1; min-width:140px; min-height:var(--tap); margin:0;
  background:var(--sunk); border:1px solid var(--line-2); border-radius:4px;
  padding:11px 13px; font-size:.9rem; font-weight:600; color:var(--ink-2);
  cursor:pointer; text-align:center;
}
.hero-actions button:hover, .hero-actions label:hover{
  border-color:var(--brand-on-surface); color:var(--ink)}
.hero-actions input[type=file]{position:absolute; width:1px; height:1px;
  overflow:hidden; clip:rect(0 0 0 0)}
.hero-actions input[type=file]:focus-visible + label{outline:2px solid var(--brand-on-surface);
  outline-offset:2px}

.art-panel{
  background:var(--sunk); border:1px solid var(--line); border-radius:5px;
  padding:13px; margin:14px 0;
}
.art-panel > p{margin:0 0 11px; font-size:.87rem; color:var(--ink-2)}

/* The picker. Real buttons, a visible label on each, 44px targets, and a
 * selected state that does not rely on colour alone. */
.art-pick{display:grid; grid-template-columns:1fr 1fr; gap:9px}
@media (min-width:460px){.art-pick{grid-template-columns:repeat(3,1fr)}}
.art-pick button{
  display:flex; flex-direction:column; align-items:center; gap:6px;
  background:var(--panel); border:1px solid var(--line); border-radius:5px;
  padding:9px 7px; cursor:pointer; min-height:var(--tap);
  font-size:.76rem; font-weight:600; line-height:1.25; text-align:center;
  color:var(--ink-2);
}
.art-pick button img{width:100%; height:auto; aspect-ratio:16/9;
  object-fit:contain; pointer-events:none}
.art-pick button:hover{border-color:var(--brand-on-surface)}
.art-pick button:focus-visible{outline:2px solid var(--brand-on-surface); outline-offset:2px}
.art-pick button[aria-pressed="true"]{
  border-color:var(--brand-on-surface); border-width:2px; padding:8px 6px;
  background:var(--pine-soft); color:var(--ink); font-weight:700;
}
/* Not colour alone: the chosen one is ticked. */
.art-pick button[aria-pressed="true"] span::before{content:"\2713\00a0"; color:var(--brand-on-surface)}

/* ------------------------------------- the status sentence, and booking ---
 * Every state ends in something the customer can do. A status with no action
 * is just a worry. */
.status-say{
  margin:8px 0 0; font-size:.95rem; line-height:1.45; color:var(--ink-2);
}
.status-say.over{color:var(--red); font-weight:600}
.status-say.soon{color:var(--amber-ink, var(--ink)); font-weight:600}
.status-say.stale, .status-say.unknown{color:var(--ink-2)}

.book-contacts{display:flex; gap:9px; margin-top:9px; flex-wrap:wrap}
/* Side by side: three full-width buttons stacked is a lot of screen for
 * what is one decision. flex-basis 0 makes them share the row evenly
 * instead of each claiming its text width and wrapping. */
.book-contacts .btn{flex:1 1 0; min-width:0; width:auto; text-align:center;
  text-decoration:none; display:inline-flex; align-items:center;
  justify-content:center; min-height:var(--tap); padding-left:10px;
  padding-right:10px}
.btn.ghost{
  background:var(--panel); color:var(--ink); border:1px solid var(--line);
  font-weight:600;
}
.btn.ghost:hover{border-color:var(--brand-on-surface)}
@media (max-width:360px){.book-contacts{flex-direction:column}}

/* ------------------------------------- the logbook, one entry at a time ---
 * A machine with thirty visits was a wall of text. Each entry is a <details>
 * now: the closed row says what it was and how much is inside, and tapping
 * opens it. The newest is open on arrival so the screen is not a stack of
 * closed boxes. */
.ent > summary{
  cursor:pointer; list-style:none; padding:3px 26px 3px 0; position:relative;
  min-height:var(--tap); display:flex; flex-direction:column;
  justify-content:center; border-radius:4px;
}
.ent > summary::-webkit-details-marker{display:none}
/* A chevron that turns, drawn in CSS so there is no image to load. */
.ent > summary::after{
  content:""; position:absolute; right:7px; top:50%;
  width:7px; height:7px; margin-top:-5px;
  border-right:2px solid var(--ink-3); border-bottom:2px solid var(--ink-3);
  transform:rotate(45deg); transition:transform .15s ease;
}
.ent[open] > summary::after{transform:rotate(-135deg); margin-top:-2px}
.ent > summary:hover{background:var(--sunk)}
.ent > summary:focus-visible{outline:2px solid var(--brand-on-surface); outline-offset:2px}
.ent-sum{font-size:.78rem; color:var(--ink-3); margin-top:2px}
.ent[open] .ent-sum{display:none}       /* it is all visible below now */
.ent-body{padding-bottom:4px}

/* "What we did": the checklist off the service report. */
.ent-h{
  font-family:var(--mono); font-size:.68rem; letter-spacing:.06em;
  text-transform:uppercase; color:var(--ink-3);
  margin:9px 0 3px; font-weight:600;
}
.ent ul.did{margin:0; padding-left:0; list-style:none}
.ent ul.did li{
  font-size:.88rem; color:var(--ink-2); padding:2px 0 2px 17px; position:relative;
}
.ent ul.did li::before{
  content:""; position:absolute; left:2px; top:.62em;
  width:5px; height:9px; border-right:2px solid var(--pine);
  border-bottom:2px solid var(--pine); transform:rotate(45deg);
}
@media (prefers-reduced-motion:reduce){
  .ent > summary::after{transition:none}
}

/* A chipper's two counters do not agree, and reading the wrong one is the
 * usual cause of a figure that comes back lower than ours. */
.gauge-note{
  margin:7px 0 0; font-size:.84rem; line-height:1.45; color:var(--ink-2);
  padding-left:11px; border-left:2px solid var(--line-2);
}
/* A reading we have taken but not yet believed. Amber, not red: the customer
 * has not done anything wrong, and they are often right. */
.reading-check{
  margin:7px 0 0; font-size:.84rem; line-height:1.45;
  color:var(--amber); font-weight:600;
}

/* "Not one of these?" -- every other drawing, behind one tap. The machine's
 * own type is a guess from its name, so this is the way out of a wrong one. */
.art-more{margin-top:10px}
.art-more > summary{
  cursor:pointer; list-style:none; font-size:.86rem; font-weight:600;
  color:var(--ink-2); padding:9px 0; min-height:var(--tap);
  display:flex; align-items:center;
}
.art-more > summary::-webkit-details-marker{display:none}
.art-more > summary::before{content:"+ "; color:var(--brand-on-surface); font-weight:700}
.art-more[open] > summary::before{content:"\2212 "}
.art-more > summary:hover{color:var(--ink)}
.art-more > summary:focus-visible{outline:2px solid var(--brand-on-surface); outline-offset:2px}

/* Taking a machine off the fleet, and putting it back. */
.archive{margin-top:14px}
.archive > summary{
  cursor:pointer; list-style:none; font-size:.86rem; color:var(--ink-3);
  padding:10px 0; min-height:var(--tap); display:flex; align-items:center;
}
.archive > summary::-webkit-details-marker{display:none}
.archive > summary:hover{color:var(--ink-2)}
.archive > summary:focus-visible{outline:2px solid var(--brand-on-surface); outline-offset:2px}
.archive p{margin:0 0 9px; font-size:.86rem}

.archive-list{margin-top:20px; border-top:1px solid var(--line); padding-top:4px}
.archive-list > summary{
  cursor:pointer; list-style:none; font-size:.84rem; color:var(--ink-3);
  padding:11px 0; min-height:var(--tap); display:flex; align-items:center;
  font-family:var(--mono); letter-spacing:.03em;
}
.archive-list > summary::-webkit-details-marker{display:none}
.archive-list > summary:hover{color:var(--ink-2)}
.gone-row{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:9px 0; border-top:1px solid var(--line);
}
.gone-row b{display:block; font-size:.94rem; color:var(--ink-2); font-weight:600}
.gone-row .mt{display:block; font-size:.78rem; color:var(--ink-3); margin-top:2px}
.gone-row .btn{flex:none; padding:8px 13px; min-height:var(--tap)}

/* The logo they have set, shown back to them at a size worth judging. */
.own-logo-now{
  background:var(--cap); border:1px solid var(--line); border-radius:7px;
  padding:12px; margin-bottom:10px; display:grid; place-items:center;
}
.own-logo-now img{max-width:100%; max-height:84px; object-fit:contain; display:block}

/* ------------------------------------------------- staff looking in ------
 * Fixed to the top and pushing the page down rather than floating over it,
 * so it cannot be scrolled past. Amber, not red: nothing is wrong, but you
 * are not where you think you are. */
.viewing-bar{
  position:fixed; top:0; left:0; right:0; z-index:60;
  background:var(--amber); color:#fff; font-size:.8rem; line-height:1.35;
  padding:9px 14px; display:flex; align-items:center; gap:12px;
  justify-content:space-between; flex-wrap:wrap;
  box-shadow:0 1px 6px rgba(0,0,0,.25);
}
.viewing-bar a{
  color:#fff; font-weight:700; text-decoration:underline; white-space:nowrap;
  min-height:var(--tap); display:inline-flex; align-items:center;
}
body.is-viewing{padding-top:46px}
body.is-viewing .brand{top:46px}
@media (max-width:420px){body.is-viewing{padding-top:62px} body.is-viewing .brand{top:62px}}
