/* InstaBid contractor platform — shared finish system. Deuce 2026-09-02 */
/* Palette = instabid/Branding-Creative/brand.md, "as shipped" table. Read off the live
   site, not from memory. Amber is #e3b53c — John picked it 8/11 from three live candidates:
   "the medium one — not the darker warmest, not the brighter yellowest." */
:root{--floor:#101119;--floor2:#0b0c12;--surf:#0B1120;--surf2:#101A2E;
--line:#1C2942;--line2:#26364F;
--blue:#4a7bff;--rblue:#2F6BFF;--electric:#3e65ce;
--amber:#e3b53c;--amber-hot:#f5c94f;--amber-dim:#806a24;
--green:#37d39b;--red:#f5837a;--purple:#8b6cf6;--teal:#2dd4bf;
--text:#edeef4;--dim:#a2a9bc;--faint:#9098ad;
/* 2026-09-13 — John: "I hate that hazy, my eyes are trying to read that almost grayed-out
   gray text." Measured: brand.md's --dim was 6.31 contrast on the card and --faint was 5.05,
   barely over the 4.5 floor. My 9/11 retoken made grey text DIMMER than what it replaced
   (the old --dim was 7.64). Same hue and saturation, lightness raised until --dim hits 8.01
   and --faint 6.53. Hue is brand; the light is for a man with $5 readers. */
--glow:0 0 0 1px rgba(74,123,255,.45),0 8px 28px -8px rgba(74,123,255,.45);
--card:0 24px 60px -22px rgba(0,0,0,.65);
--door:#264AA0;--door-glow:0 0 46px rgba(47,107,255,.08);
--glow-amber:0 0 17px rgba(227,181,60,.27);
/* the translucent wash John singled out on the New Lead banner */
--wash:linear-gradient(135deg,rgba(74,123,255,.10),rgba(74,123,255,.02));
--wash-edge:rgba(74,123,255,.22)}
*{box-sizing:border-box}
body{margin:0;background:var(--floor);color:var(--text);font:16px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,sans-serif;
background-image:radial-gradient(circle,rgba(150,175,235,.085) 1px,transparent 1px);background-size:15px 15px}
.tnum{font-variant-numeric:tabular-nums}
.shell{display:grid;grid-template-columns:272px minmax(0,1fr);min-height:100vh} /* 10/04: plain 1fr won't shrink below its content, so every screen side-scrolled at 768-1100px */
.rail{position:sticky;top:0;height:100vh;background:var(--floor2);border-right:1px solid var(--line);
padding:14px 12px;display:flex;flex-direction:column;gap:2px}
.brand{display:flex;align-items:center;gap:9px;padding:6px 10px 20px}
.brand .m{width:29px;height:29px;border-radius:8px;display:grid;place-items:center;font-weight:800;font-size:14px;color:#fff;
background:linear-gradient(180deg,#5c88ff,#3563e8);box-shadow:0 4px 14px -4px rgba(74,123,255,.7)}
.brand b{font-size:17px;letter-spacing:-.2px}
.grp{font-size:10.5px;letter-spacing:.15em;color:var(--faint);font-weight:700;padding:14px 10px 6px}
.rail a{display:flex;align-items:center;gap:11px;min-height:40px;padding:0 10px;border-radius:9px;color:var(--dim);
text-decoration:none;font-size:15px;font-weight:500;transition:background .15s,color .15s}
.rail a:hover{background:rgba(140,165,225,.05);color:var(--text)}
.rail a.on{background:rgba(74,123,255,.11);color:#fff;box-shadow:inset 3px 0 0 var(--blue),var(--glow)}
.ico{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
.rail .n{margin-left:auto;min-width:21px;height:21px;display:grid;place-items:center;background:#2f5ae0;color:#fff;
border-radius:11px;font-size:12px;font-weight:700;box-shadow:0 0 12px -2px rgba(74,123,255,.65)}
.me{margin-top:auto;display:flex;align-items:center;gap:9px;padding:11px 8px 4px;border-top:1px solid var(--line);font-size:12.5px;color:var(--dim)}
.me .av{width:27px;height:27px;border-radius:50%;background:var(--purple);display:grid;place-items:center;color:#fff;font-weight:700;font-size:11px}
main{padding:24px 34px 90px;max-width:1160px;width:100%;box-sizing:border-box;min-width:0} /* 10/04: width:100% was only in the phone block (9/16 fix); at 768-1100px main still sized from content and 4 screens side-scrolled 70-184px */
h1{font-size:27px;letter-spacing:-.6px;margin:0 0 3px}
/* 10/04 MATCH on staging: the app loads Tailwind's reset (h1-h6{font-weight:inherit}). The mock
   only looked bold because the BROWSER default made it bold — this sheet never said so. Say it. */
h1,h2,h3,h4{font-weight:700}
.sub{color:var(--faint);font-size:14.5px;margin:0}
.top{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:20px;flex-wrap:wrap}
.back{color:var(--faint);font-size:14px;text-decoration:none;display:inline-block;margin-bottom:12px}
.back:hover{color:var(--blue)}
/* tabs */
.tabs{display:flex;gap:2px;border-bottom:1px solid var(--line);margin:18px 0 22px;flex-wrap:wrap}
.tabs button{border:0;background:none;color:var(--dim);font:inherit;font-size:15px;font-weight:600;padding:11px 17px;
cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-1px;display:flex;align-items:center;gap:8px}
.tabs button:hover{color:var(--text)}
.tabs button.on{color:#fff;border-bottom-color:var(--blue);text-shadow:0 0 20px rgba(74,123,255,.6)}
.tabs .b{min-width:19px;height:19px;display:grid;place-items:center;border-radius:10px;font-size:11px;font-weight:700;
background:rgba(140,165,225,.12);color:var(--faint)}
.tabs button.on .b{background:#2f5ae0;color:#fff}
.pane{display:none}.pane.on{display:block}
/* chips */
.chips{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}
.chip{border:1px solid var(--line);background:var(--surf);color:var(--dim);border-radius:999px;padding:7px 15px;
font:inherit;font-size:14px;font-weight:600;cursor:pointer;display:flex;align-items:center;gap:7px}
.chip:hover{border-color:var(--line2);color:var(--text)}
.chip.on{background:rgba(74,123,255,.13);border-color:rgba(74,123,255,.4);color:#fff}
.chip .c{font-size:11px;font-weight:700;opacity:.75}
/* panels + rows */
/* John 9/11 #5: "the blue border on hover is great — try that on the section border
   and under header, always on." Same value the cards use on hover, made resting state.
   Hover still goes one step brighter so the card never stops answering the mouse. */
.panel{background:var(--surf);border:1px solid #264AA0;border-radius:13px;overflow:clip;
margin-bottom:36px;box-shadow:var(--card)}
.ph{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 20px;border-bottom:1px solid #264AA0;flex-wrap:wrap}
.ph b{font-size:16.5px}.ph .hint{font-size:12.5px;color:var(--faint)}
.cols,.r{display:grid;gap:16px;align-items:center;padding:12px 20px}
.cols{position:sticky;top:0;z-index:2;background:rgba(16,17,25,.94);backdrop-filter:blur(8px);
border-bottom:1px solid var(--line);font-size:11px;letter-spacing:.1em;color:var(--faint);font-weight:700;text-transform:uppercase}
.r{border-bottom:1px solid var(--line)}.r:last-child{border-bottom:0}
.r:hover{background:rgba(140,165,225,.03)}
.nm{font-weight:500;font-size:15px;letter-spacing:-.1px}
.cl{font-size:12.5px;color:var(--faint)}
.tag{font-size:11px;font-weight:600;color:var(--faint);background:rgba(140,165,225,.08);border:1px solid var(--line);
border-radius:5px;padding:1px 6px;margin-left:7px}
.money{color:var(--amber);font-weight:500;font-size:15px}
.right{text-align:right}
.note{color:var(--faint);font-size:13px;padding:12px 20px}
/* status */
.st{font-size:12px;font-weight:700;padding:4px 10px;border-radius:6px;justify-self:start;white-space:nowrap}
.st.ok{background:rgba(52,211,153,.11);color:var(--green);border:1px solid rgba(52,211,153,.24)}
.st.wait{background:rgba(245,166,35,.10);color:#f0b45c;border:1px solid rgba(245,166,35,.22)}
.st.new{background:rgba(74,123,255,.13);color:#8fabff;border:1px solid rgba(74,123,255,.26)}
.st.no{background:rgba(140,165,225,.08);color:var(--faint);border:1px solid var(--line)}
/* buttons + fields */
.btn{border:0;border-radius:9px;padding:10px 17px;min-height:42px;font:inherit;font-weight:700;font-size:14px;cursor:pointer;
display:inline-flex;align-items:center;gap:8px;white-space:nowrap;text-decoration:none}
.btn.p{background:linear-gradient(180deg,#5c88ff,#3563e8);color:#fff;box-shadow:0 6px 20px -6px rgba(74,123,255,.55)}
.btn.m{background:linear-gradient(180deg,#f7b23f,#d98a10);color:#241802;box-shadow:0 6px 20px -6px rgba(245,166,35,.5)}
.btn.g{background:transparent;color:var(--dim);border:1px solid var(--line2)}
.btn.sm{min-height:36px;padding:7px 14px;font-size:14px}
.fi{background:var(--floor2);border:1px solid var(--line2);border-radius:9px;padding:10px 13px;color:var(--text);
font:inherit;font-size:15px;font-weight:500;width:100%}
.fi:focus{border-color:var(--blue);outline:none;box-shadow:0 0 0 3px rgba(74,123,255,.2)}
.lab{font-size:11px;letter-spacing:.11em;font-weight:700;color:var(--faint);text-transform:uppercase;margin-bottom:6px;display:block}
.search{position:relative;flex:1;min-width:220px;max-width:420px}
.search input{width:100%;background:var(--surf);border:1px solid var(--line);border-radius:10px;padding:11px 54px 11px 38px;
color:var(--text);font:inherit;font-size:14.5px}
.search input:focus{border-color:var(--blue);outline:none;box-shadow:0 0 0 3px rgba(74,123,255,.18)}
.search svg{position:absolute;left:13px;top:12px;width:16px;height:16px;stroke:var(--faint);fill:none;stroke-width:1.8}
.kbd{position:absolute;right:11px;top:10px;font-size:11px;color:var(--faint);border:1px solid var(--line);
border-radius:5px;padding:2px 6px;background:var(--floor2)}
/* grids */
.two{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.stat{background:var(--surf);border:1px solid var(--line);border-radius:12px;padding:15px 17px}
.stat .k{font-size:11px;letter-spacing:.09em;color:var(--faint);text-transform:uppercase;font-weight:700}
.stat .v{font-size:25px;font-weight:700;letter-spacing:-.7px;margin:5px 0 2px}
.stat .v.money{color:var(--amber)}.stat .v.good{color:var(--green)}
.stat .m{font-size:12.5px;color:var(--faint)}
/* focus fold */
.focusable.focus .r:not(.open){opacity:.18;filter:saturate(.4);pointer-events:none}
.focusable .r{transition:opacity .2s,filter .2s,background .12s}
.r.open{background:rgba(74,123,255,.055);box-shadow:inset 3px 0 0 var(--blue)}
.r.open .hidewhenopen{display:none}
.ef{background:var(--floor2);border:1px solid var(--line2);border-radius:8px;padding:9px 12px;color:var(--text);
font:inherit;font-weight:500;font-size:15px;width:100%}
.ef:focus{border-color:var(--blue);outline:none;box-shadow:0 0 0 3px rgba(74,123,255,.2)}
.ef.p{text-align:right;color:var(--green)}
.fold{display:none;grid-column:1/-1}
.fold.on{display:block;animation:fd .2s ease-out}
@keyframes fd{from{opacity:0}to{opacity:1}}
.foldbar{display:flex;align-items:center;gap:16px;flex-wrap:wrap;padding:0 20px 14px;
background:rgba(74,123,255,.055);box-shadow:inset 3px 0 0 var(--blue)}
.prov{color:var(--faint);font-size:12.5px}.prov b{color:var(--green);font-weight:700}
.foldbar .acts{margin-left:auto;display:flex;gap:8px}
/* toggles */
.tog{width:44px;height:25px;border-radius:13px;background:var(--surf2);border:1px solid var(--line2);position:relative;
cursor:pointer;flex:none;transition:background .18s,border-color .18s}
.tog::after{content:"";position:absolute;top:2px;left:2px;width:19px;height:19px;border-radius:50%;background:var(--faint);
transition:transform .18s,background .18s}
.tog.on{background:rgba(74,123,255,.35);border-color:rgba(74,123,255,.55)}
.tog.on::after{transform:translateX(19px);background:#fff}
/* 10/07: the switch is 25px tall, a thumb needs 44. An invisible ::before grows the TOUCH area to 45px without changing the look. */
.tog::before{content:"";position:absolute;inset:-11px -2px}
/* 10/07 EN/ES switch (John: "Deuce should be fixing Spanish"). Desktop: bottom of the rail, above the company block.
   Phone: the rail is a tab bar with no room, so it lives in Settings › Company › Language. Same ?locale= link
   production already uses; production remembers it per contractor (contractor_profiles.locale). */
.lang{display:flex;gap:4px;padding:10px 8px 0;margin-top:auto}
.rail .lang a{display:flex;align-items:center;flex:1;justify-content:center;gap:0;margin:0;box-shadow:none;text-align:center;font-size:13px;font-weight:700;letter-spacing:.06em;color:var(--faint);text-decoration:none;
padding:8px 0;border-radius:8px;border:1px solid var(--line)}
.rail .lang a.on{color:var(--text);background:rgba(74,123,255,.14);border-color:rgba(74,123,255,.45);box-shadow:none}
.rail .lang a:hover{color:var(--text)}
.lang + .me{margin-top:10px}
.langpick{display:flex;gap:10px}.langpick a{flex:1;max-width:160px;text-align:center;padding:12px 0;border-radius:10px;border:1px solid var(--line2);
color:var(--dim);font-weight:600;font-size:15px;text-decoration:none;min-height:44px;box-sizing:border-box}
.langpick a.on{color:var(--text);border-color:rgba(74,123,255,.55);background:rgba(74,123,255,.10)}
/* save bar */
.savebar{position:fixed;left:272px;right:0;bottom:0;display:flex;align-items:center;gap:16px;padding:12px 34px;
background:rgba(16,22,36,.97);border-top:1px solid var(--line2);backdrop-filter:blur(12px);
box-shadow:0 -10px 34px -14px rgba(0,0,0,.85);transform:translateY(100%);transition:transform .3s ease-out;z-index:20}
.savebar.up{transform:translateY(0)}
.savebar:not(.up){visibility:hidden;transition:transform .25s,visibility 0s .25s} /* 10/04: a parked bar's top border peeked above the phone tab bar */
.savebar .d{width:8px;height:8px;border-radius:50%;background:var(--amber);animation:p2 1.9s ease-in-out infinite}
@keyframes p2{0%,100%{box-shadow:0 0 0 0 rgba(245,166,35,.6)}50%{box-shadow:0 0 0 7px rgba(245,166,35,0)}}
.savebar .btn{margin-left:auto}
.live{display:inline-flex;align-items:center;gap:7px;padding:6px 12px;border-radius:999px;font-size:12.5px;font-weight:700;
background:rgba(52,211,153,.09);border:1px solid rgba(52,211,153,.28);color:var(--green)}
.live i{width:6px;height:6px;border-radius:50%;background:var(--green);animation:p 2.2s ease-in-out infinite}
@keyframes p{0%,100%{opacity:1;box-shadow:0 0 0 0 rgba(52,211,153,.55)}50%{opacity:.55;box-shadow:0 0 0 6px rgba(52,211,153,0)}}
:where(a,button,input,[tabindex]):focus-visible{outline:3px solid var(--blue);outline-offset:2px}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* ══════════════════════════════════════════════════════════════════════
   TRIAL-LAPSED STATE — one shell-level switch, not seven redraws.
   Rails sets  <body data-state="lapsed">  when !Current.user.can_produce?
   NEVER derive this from a date in JS: a paying customer with an expired
   trial date is NOT lapsed, and a missing profile FAILS OPEN. Ask the
   predicate. (Spec: Jack, trial_gate_test.rb, 23 tests green.)

   John's ruling: "let him stare at his dead board." The board stays FULLY
   ALIVE — reading, looking, remembering. Only PRODUCING dies.
   ══════════════════════════════════════════════════════════════════════ */

/* Mark a control .produces when it makes something new leave the building.
   Everything unmarked stays alive by default — so a screen I haven't
   touched degrades to "working", never to "dead". */
[data-state="lapsed"] .produces{
  opacity:.38; pointer-events:none; cursor:not-allowed;
  filter:grayscale(1);
}
/* The amber money colour must not survive on a dead control — a greyed
   button still glowing amber reads as "broken", not "switched off". */
[data-state="lapsed"] .produces .money{color:var(--faint)}

/* The one-line reason, sitting ON the dead control's container.
   A disabled button with no explanation is the bounce-with-a-flash we're
   replacing — the whole point is that he can SEE why. */
[data-state="lapsed"] .produces-wrap{position:relative}
/* Anchored RIGHT, not left: these controls sit at the right edge of a
   header row, and a left-anchored nowrap label runs off the screen.
   Caught by looking — it clipped mid-word in the first render. */
[data-state="lapsed"] .produces-wrap::after{
  content:attr(data-why); position:absolute; right:0; bottom:-22px;
  font-size:14px; color:#f0b45c; white-space:nowrap; letter-spacing:.01em;
}
/* Phones (Deuce MATCH 11/07, card 17tkhj55vnd): at 390 the button sits on the LEFT, so the right-anchored
   line ran off the left edge ("…bete para mandar presupuestos nuevos" in Spanish). Anchor left there. */
@media (max-width:640px){[data-state="lapsed"] .produces-wrap::after{right:auto;left:0}}

/* THE BANNER — one per screen, top of main. Not a modal: he has to be able
   to keep looking at his board underneath it. */
.lapsebar{display:none}
[data-state="lapsed"] .lapsebar{
  display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  background:rgba(245,166,35,.07); border:1px solid rgba(245,166,35,.28);
  border-radius:11px; padding:14px 17px; margin-bottom:20px;
}
.lapsebar>div:first-child{flex:1;min-width:280px}
.lapsebar b{font-size:15px}
.lapsebar span{color:var(--dim); font-size:14.5px}
.lapsebar .btn{margin-left:auto}

/* DAYS-LEFT banner — pre-lapse warning. trial_days_left is live in the app
   and NOTHING renders it today. Guard the nil: a subscribed or grandfathered
   account has no number, and "nil days left" must never print. */
.trialbar{display:none}
[data-state="trial"] .trialbar{
  display:flex; align-items:center; gap:12px;
  background:rgba(74,123,255,.07); border:1px solid rgba(74,123,255,.26);
  border-radius:11px; padding:12px 16px; margin-bottom:18px; font-size:14px;
}
[data-state="trial"] .trialbar .n{color:var(--blue); font-weight:700}

/* READ-ALIVE / WRITE-DEAD — My Prices is the trap. The page he is meant to
   stare at must NOT go dark; only the inputs stop taking edits.
   Jack's item #9: "viewable, he just can't keep editing it." */
[data-state="lapsed"] .panel input,
[data-state="lapsed"] .panel select,
[data-state="lapsed"] .panel textarea{
  pointer-events:none; background:transparent; border-color:transparent;
  color:var(--faint);
}

/* Card map + stat row — moved out of home.html's local <style> 9/04 so the
   phone media query below can actually reach them. A page-local style block
   loads AFTER the shared sheet and silently wins, which is why the dashboard
   stayed 3-across on a 390px screen while every other page collapsed. */
.cards{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:10px 0 32px}

/* ══════════════════════════════════════════════════════════════════════
   PHONE — breakpoint 768px.
   NOT invented: the live Rails app already collapses its nav at Tailwind's
   `md` (768px) via nav_controller.js. Matching it so the redesign agrees
   with what ships instead of introducing a second breakpoint system.

   The rail becomes a BOTTOM BAR, not a hamburger. A contractor is holding
   the phone one-handed on a jobsite — his thumb reaches the bottom, not the
   top-left corner. A hamburger also hides the nav, and on an installed PWA
   there is no browser chrome, so this bar is the ONLY way back.
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width:767px){
  .shell{grid-template-columns:1fr}
  /* A grid item defaults to min-width:auto, so it refuses to shrink below its
     own content and pushes the page wider than the screen. The horizontally
     scrolling .chips/.tabs strips make that content very wide, so without this
     the whole page side-scrolls — which is the exact defect I flagged in the
     live app. Measured: 466px wide inside a 390px screen before this line. */
  .shell>main{min-width:0}

  .rail{
    position:fixed; left:0; right:0; bottom:0; top:auto;
    height:auto; width:auto; flex-direction:row; gap:0;
    padding:0; border-right:none; border-top:1px solid var(--line);
    background:var(--floor2); z-index:50;
    padding-bottom:env(safe-area-inset-bottom); /* iPhone home indicator */
  }
  .brand,.grp,.me,.lang{display:none}           /* chrome the bar has no room for */
  .rail a{
    flex:1; flex-direction:column; justify-content:center; gap:3px;
    padding:9px 2px 8px; font-size:10.5px; letter-spacing:.01em;
    border-radius:0; text-align:center; min-height:54px;
  }
  .rail a .ico{width:21px;height:21px}
  .rail a.on{background:transparent; color:var(--blue); box-shadow:none}
  /* The count badge must ride ON the icon, not below the label — in a column
     flex it takes its own line and makes that one nav item taller than the
     other four, which reads as a broken bar. Caught by looking. */
  .rail a{position:relative}
  .rail a .n{position:absolute; top:5px; left:50%; margin-left:5px;
             font-size:9.5px; min-width:15px; height:15px; line-height:15px;
             padding:0 4px}

  main{padding:18px 15px 84px}

  /* Two-column form grids had NO phone rule. Settings rendered 496px of content
     inside a 390px screen — the only screen of the seven that side-scrolled.
     `.two` is shared; `.f2` is settings-local. Both collapse here so the next
     two-column block inherits the fix instead of repeating the bug. */
  .two,.f2{grid-template-columns:1fr}            /* clear the bar */

  /* Rows: the desktop column grid is set INLINE per row, so it needs
     !important to be overridden here. Name gets its own line, money stays
     hard right — his eye goes name, then number, same as on desktop. */
  .cols{display:none}
  .r{display:flex !important; flex-wrap:wrap; align-items:baseline;
     gap:5px 11px; padding:13px 15px}
  .r>div:first-child{flex:1 1 100%}
  .r .right,.r .money{margin-left:auto; text-align:right}

  /* The three-across cards (home > Today) must NOT inherit the old full-width
     row layout. That rule is `display:flex !important` with no flex-direction,
     so on a phone the cards snapped back to a row and ran off the right edge —
     buttons and half the sentence clipped. Scoped to `.rows .r` on purpose:
     estimates/job/people still use bare `.r` as real rows and must not move. */
  .rows{grid-template-columns:1fr; gap:12px; padding:14px}
  .rows .r{display:flex !important; flex-direction:column; align-items:stretch;
           flex-wrap:nowrap; gap:9px; padding:15px 16px}
  .rows .r>div:first-child{flex:0 0 auto}
  .rows .r .amt{margin-left:0; text-align:left}
  .rows .acts{flex-wrap:wrap}
  .rows .acts .do{flex:1 1 auto; min-width:130px}

  .top{flex-direction:column; align-items:flex-start; gap:12px}
  .top h1{font-size:25px}
  .tabs{overflow-x:auto; -webkit-overflow-scrolling:touch}
  .tabs::-webkit-scrollbar{display:none}
  .chips{overflow-x:auto; flex-wrap:nowrap; -webkit-overflow-scrolling:touch}
  .chips .chip{white-space:nowrap; flex:none}   /* stop 2-line ragged chips */
  .chips::-webkit-scrollbar{display:none}
  .cards{grid-template-columns:1fr}
  .stats{grid-template-columns:repeat(2,1fr)}
  .savebar{left:0;right:0;bottom:62px;border-radius:0}
  .lapsebar{flex-direction:column; align-items:flex-start}
  .lapsebar .btn{margin-left:0}
}


/* ── DAY ONE ────────────────────────────────────────────────────────────────
   A brand-new contractor has no estimates, no customers, nothing sent. Every
   screen's first impression is an empty box unless we write one. Rule: never
   say "no data" — say the ONE thing to do next, and give him the button.
   Demo: add ?empty=1 to any mock URL. Rails sets <body data-data="empty">. */
.day-one{display:none}
[data-data="empty"] .day-one{display:block}
[data-data="empty"] .when-data{display:none !important}
.day-one{background:var(--surf);border:1px solid #264AA0;border-radius:13px;
  box-shadow:var(--card);padding:34px 30px;text-align:center;margin-bottom:26px}
.day-one .big{font-size:20px;font-weight:700;letter-spacing:-.3px;margin-bottom:7px}
.day-one p{color:var(--dim);font-size:14.5px;max-width:52ch;margin:0 auto 18px}
.day-one .acts{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}

span.day-one{padding:0;margin:0;border:0;background:none;box-shadow:none;text-align:left}
[data-data="empty"] span.day-one{display:inline}


/* ── THE $5 READING GLASSES LAW ─────────────────────────────────────────────
   brand.md: "real reading text never goes below 14px." John, 2026-09-13:
   "us contractors eat sawdust for years — we squint all day keeping dirt out
   of our eyes, we don't want to squint at this." Audited all 7 screens; every
   class below carried real sentences at 12–13.5px. Mono eyebrows (.grp, .k)
   stay small ON PURPOSE — wide tracking reads differently and they're labels,
   not reading. Count what's actually being read, not what's small. */
.hint,.cl,.live,.mkhome,.back,.do,.chip,.stp,.why,.sub,
.me,.me span,.rows .r .cl,.rows .r .why{font-size:14px}
.pill{font-size:13px}
.s .m,.c span{font-size:14px}
.day-one p{font-size:15px}

/* The unit chip was 11px. "each" vs "per roll" vs "per ft" is the difference between
   a right bid and a wrong one — that is load-bearing text, not decoration. And the
   SELECTED PART is the actual thing he's buying; it read as a footnote next to the
   16px item name. Both up, part brought to near-parity. John 9/13. */
.tag{font-size:13px !important;color:var(--dim)}
.r .cl{font-size:15px}


/* ── John 9/13, wide-monitor pass ──────────────────────────────────────────
   "super spread apart, difficult to be like what the fuck am I looking at."
   And: he scrolled past LABOR twice and could not find it, because the section
   heading was SMALLER than the line items it was introducing. Headings now
   outrank their contents — amber, bigger, with a real rule above them. */
main{max-width:1040px;padding-left:40px;padding-right:40px;padding-bottom:130px}

/* the sticky header was 11px grey — he didn't know it was there */
.cols{padding:18px 20px;font-size:13px;letter-spacing:.12em;color:var(--text);
  background:rgba(16,17,25,.97);border-bottom:1px solid #264AA0}

/* a section heading must outrank the rows under it */
.sect{padding:26px 20px 12px;margin-top:10px;border-top:2px solid var(--amber);
  font-size:17px;letter-spacing:.1em;color:var(--amber)}
.sect .sect-sub{font-size:19px;color:var(--amber)}
.subsect{padding:16px 20px 8px;font-size:14px;letter-spacing:.09em;color:var(--dim);
  background:rgba(140,165,225,.05);border-top:1px solid var(--line)}

/* "Click any line to change it. Your numbers win." — the promise of the product,
   set at hint-size. It earns 15px. */
.ph .hint{font-size:15px;color:var(--dim)}


/* ── THE READING FLOOR, enforced ───────────────────────────────────────────
   Audited all 7 screens at 1440px: 333 pieces of real reading text were still
   under 14px, concentrated in six shared classes. This block sits LAST on
   purpose — earlier rules in this sheet can't undercut it. Mono/tracked labels
   (.grp, .k, .cols, .tag) are deliberately exempt; they're labels, not reading. */
.cl,.note,.prov,.st,.why,.hint,.sub,.live,.mkhome,.back,.stp{font-size:14px}
.btn{font-size:14.5px}
.chip{font-size:14.5px}
.panel b,.ph b{font-size:16.5px}
.s .m,.c span,.rows .r .cl{font-size:14px}
.r .cl{font-size:15px}


/* Page-local <style> blocks load after this sheet, so a bare `.btn{font-size:13px}`
   in job.html or prices.html beats anything written here at equal specificity.
   brand.md's documented answer: win on `html body` specificity, never on !important.
   (.tag stays 13px on purpose — "each" / "per roll" is a unit label, not reading.) */
html body .btn,
html body .do,
html body .stp,
html body .chip{font-size:14.5px}
html body .cl,
html body .note,
html body .prov,
html body .st,
html body .why,
html body .hint{font-size:14px}
html body .r .cl{font-size:15px}

/* stragglers found by the 1440px audit — each edited at its winning selector */
.s .m{font-size:14px}
.cols .sub,.ph .sub{font-size:14px}


/* ── John 9/14, the long pass ──────────────────────────────────────────────
   "they look like a line that snuck in between the line items", "these two
   lines aren't meeting", "the outside border is thinner than the line item
   lines", "the buttons look like I hacked it together with HTML." */

/* outer border was thinner than its own row rules — doubled */
html body .panel{border-width:2px;border-color:#264AA0}

/* ONE gold line, not a blue one and a gold one with a gap between.
   The gold rides the sticky header, so when you scroll it stays with you. */
html body .cols{border-bottom:2px solid var(--amber)}

/* wider rail, and the content re-centred in what's left */
main{max-width:1100px;padding-left:65px;padding-right:65px;margin-left:auto;margin-right:auto;
  /* 🔴 width:100% is NOT optional. John 9/16: "parts and materials one size,
     labor different size, charges different size." Cause: main had no width,
     so it sized from CONTENT — a tab with a narrow table produced a narrower,
     re-centred page than a tab with a wide one, on the SAME screen. max-width
     caps it; only width fills it. Same defect that broke every phone layout. */
  width:100%;box-sizing:border-box}

/* buttons come up out of the dead field and sit beside the totals */
.footrow{display:flex;align-items:flex-start;gap:28px;padding:22px 20px 24px;flex-wrap:wrap}
.footrow .btnrow{display:flex;gap:12px;flex-wrap:wrap;padding:0;margin:0;border:0;flex:1}
.footrow .btnrow .btn{min-height:44px}
.footrow .sums{margin:0 !important;padding:0 !important;flex:0 0 340px;max-width:340px !important}
@media (max-width:860px){ .footrow{flex-direction:column} .footrow .sums{flex:1 1 auto;width:100%} }


/* ══ THE SYSTEM ═══════════════════════════════════════════════════════════
   John 9/14: "it should look like a templated system — one's super wide and
   crazy, another's all scrunched. Pick a system and go with it."
   Measured drift before writing this: h1 was 34px on estimates and 27px on the
   other six; row padding ran 12/15/18px; chips 0/38/49px. Every value below is
   set ONCE here. Page-local blocks must not redefine them — if a screen needs
   something different, it earns a modifier class, not a private copy. ═════ */

/* page header block */
html body main>.top{align-items:flex-end;margin-bottom:34px;padding-bottom:26px;
  border-bottom:1px solid var(--line)}
html body h1{font-size:34px;letter-spacing:-.8px;margin:0 0 6px}
html body .sub{font-size:16px}
html body main>.top .btn{min-height:48px;padding:13px 24px;font-size:15.5px}

/* filter chips — one size everywhere */
html body .chips{gap:10px;margin-bottom:30px}
html body .chip{min-height:46px;padding:11px 20px;font-size:15.5px;border-radius:11px}
html body .chip .c{font-size:14px;margin-left:9px;padding:2px 8px;border-radius:9px;
  background:rgba(140,165,225,.14)}
html body .chip.on .c{background:rgba(74,123,255,.30)}

/* search */
html body .search{min-height:52px;max-width:480px}
/* 480, not the old 420: measured 2026-09-16, the parts-search placeholder needs
   421px and had 418 — it clipped "GFCI" to "GFC" on the one screen where search
   is the primary tool (95 rows in Plumbing). Raised at the system, not patched
   on one page, so every search gets the headroom. */
html body .search input{font-size:16px}

/* panels and rows */
html body .panel{margin-bottom:30px}
html body .ph{padding:20px 22px}
html body .ph b{font-size:17px;letter-spacing:.04em}
html body .cols{border-bottom:2px solid var(--amber)}
html body .r{padding-top:18px;padding-bottom:18px}
html body .nm{font-size:16px}

/* tabs */
html body .tabs{margin:22px 0 28px}
html body .tabs button{font-size:16px;padding:13px 18px}

/* ── THE ROW FAMILY — one rhythm, every rowlike thing ─────────────────────
   Earned 2026-09-16 measuring settings.html: it carried FOUR private row
   paddings (.tr 12px, .sw 14px, .conn 15px) against the system's 18px —
   three dialects on ONE screen, which is the exact drift the block above
   exists to stop. The private copies lived in the page's own <style>, which
   loads after this sheet, so they silently won.
   MECHANISM: a new rowlike component must JOIN this selector. It does not get
   its own padding. If it needs a different rhythm it earns a modifier class. */
html body .r,
html body .sw,
html body .conn,
html body .tr{padding:18px 20px}
html body .sw,
html body .conn{gap:16px}
html body .tr{gap:12px}

/* sticky column header must be OPAQUE.
   Earned same day: .cols sat at rgba(...,.97) + backdrop-blur, so rows ghosted
   through the header at 3% and smeared — read as a dirty seam 60 rows deep.
   A sticky header is a surface, not a scrim. */
html body .cols{background:#101119;backdrop-filter:none}


/* ══ THE TABLE TEMPLATE — ONE grid, every table, every screen ═════════════
   John 9/16: "you're not following any kind of template — between the material
   page and the labor page the entire width changes. Parts and materials one
   size, labor different size, charges different size. Just make a template and
   use that, use the same dimensions every page."
   He was right: the mocks carried NINETEEN distinct grid-template-columns.
   THE TEMPLATE IS THREE COLUMNS: name | detail | right(money/action).
   A fourth piece of data does NOT earn a fourth column — it goes in the name
   cell's sub-line (.cl), which is already how every screen shows secondary
   text. Anything needing a real 4th/5th column uses .t4 / .t5 below, and those
   are the ONLY other options. No inline grid-template-columns. Ever. ═════ */
html body .cols,
html body .r{grid-template-columns:minmax(0,2.2fr) minmax(0,1.4fr) minmax(0,1fr)}
html body .cols.t4,
html body .r.t4{grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr)}
html body .cols.t5,
html body .r.t5{grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr)}
html body .cols.ta,
html body .r.ta{grid-template-columns:minmax(0,1fr) auto}


/* ══ .post — THE ONE EARNED EXCEPTION TO THE TABLE TEMPLATE ═══════════════
   Jack, 2026-09-16: "Photos do NOT fit a table at all. It's a post with a
   caption, an author, a seen-chip and N thumbnails. I'm not inventing a
   private class — earn me one, or tell me the shape you want."
   He is right and he asked the right way. A photo post is a CARD, not
   name|detail|right. This is the shape. Draws and the daily log DO fit the
   3-col table and must use it — this class is for photo posts only. ════ */
html body .post{border-bottom:1px solid var(--line);padding:18px 20px}
html body .post:last-child{border-bottom:0}
html body .posthead{display:flex;align-items:center;gap:12px;margin-bottom:10px}
html body .post .who{font-size:16px;font-weight:600}
html body .post .when{font-size:14px;color:var(--faint)}
html body .post .cap{font-size:15.5px;color:var(--dim);margin-bottom:12px;line-height:1.5}
html body .post .shots{display:grid;grid-template-columns:repeat(auto-fill,minmax(124px,1fr));gap:8px}
html body .post .shots img{width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:8px;
  border:1px solid var(--line);display:block}
/* comments thread UNDER the post they answer — never a detached chat box */
html body .post .thread{margin:12px 0 0;padding:12px 0 0;border-top:1px solid var(--line)}
html body .post .thread .msg{font-size:15px;color:var(--dim);padding:6px 0;line-height:1.5}
html body .post .thread .msg b{color:var(--text);font-weight:600}

/* seen chip — THREE states. seen_at NULL is a DIFFERENT FACT from a timestamp,
   so this is never a boolean. Jack's call, and he's right. */
html body .seen{margin-left:auto;font-size:12px;letter-spacing:.08em;text-transform:uppercase;
  font-weight:700;padding:5px 11px;border-radius:9px;white-space:nowrap}
html body .seen.unseen{background:rgba(74,123,255,.16);color:#9db8ff}   /* seen_at IS NULL */
html body .seen.done{background:rgba(140,165,225,.10);color:var(--faint)} /* seen_at set */
html body .seen.reply{background:rgba(227,181,60,.18);color:var(--amber)} /* owes a reply — loudest */

/* 10/04 TABLET / SMALL LAPTOP (768–1023px) — with the 272px rail, main is only ~500–750px here.
   3-up tiles and two-up cards demand more than that and shoved the page 66–184px sideways
   (home, settings; measured at 800 + 900). Two tiles across, cards stacked. */
@media (min-width:768px) and (max-width:1023px){
  html body .cards,html body .cards.k12{grid-template-columns:repeat(2,minmax(0,1fr))}
  html body .two{grid-template-columns:1fr}
  html body .tabs{min-width:0;max-width:100%;overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}
  html body .tabs button{flex:0 0 auto}
}
/* 10/04 MATCH: the app's floating chat bubble (#fa-bubble, "Stella lite") isn't in any mock.
   On a phone it sat ON the bottom tab bar's Settings tab. Lift it above the bar there. */
@media (max-width:767px){ html body #fa-bubble{bottom:calc(84px + env(safe-area-inset-bottom,0px)) !important;right:14px !important} }
/* 10/04 MATCH (Job): deuce_mobile_and_type.css gave .pill a 44px tap-target min-height. A status pill
   ("In review") is a label, not a button. It rendered as a 44px box with its text in the corner. */
html body .pill{min-height:0;display:inline-block;line-height:1.5}
/* 10/04 MATCH (Job): the chat bubble sat ON the savebar's "Save changes" button (desktop + phone),
   the same collision as the tour. While any savebar is up, the bubble rides above it. */
body:has(.savebar.up) #fa-bubble{bottom:96px !important;transition:bottom .2s}
@media (max-width:767px){ body:has(.savebar.up) #fa-bubble{bottom:calc(170px + env(safe-area-inset-bottom,0px)) !important} }
/* 10/04 MATCH (Prices): the phone block's `.r{display:flex !important}` beat every row the page hid
   (inline display:none, [hidden]), so the 50-row cap showed all 451 on a phone. A hidden row stays hidden. */
@media (max-width:767px){
  html body .r[hidden], html body .r[style*="display: none"], html body .r[style*="display:none"]{display:none !important}
}
/* 10/04: iPhone Safari ZOOMS the page when you tap a field under 16px (15.99 zooms; CSS can't turn it off).
   .fi was 15px, so 225 fields across every screen zoomed on tap. Caught on New estimate, NOT by my MATCH
   gate, which never ran the ui-qa-sweep zoom check. Phone only; desktop keeps 15px. */
@media (max-width:767px), (pointer:coarse){ /* pointer:coarse = iPads + touch laptops: iPad Safari zooms too */
  html body input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]),
  html body select, html body textarea, html body .fi, html body .ef{font-size:16px !important}
  html body select.fi, html body select{min-height:44px} /* 10/13 MATCH: the add-a-part bar selects were 42px on a phone (my mock, copied as-is); a thumb needs 44 */
  html body .btn, html body .btn.sm{min-height:44px} /* 10/04 final sweep: "New template" 36px, "Add a part" 42px; a thumb needs 44 */
}
/* ══ PHONE RE-ASSERT — MUST STAY THE LAST BLOCK IN THIS FILE ══════════════
   MECHANISM, and it bit twice: the @media(max-width:767px) block sits at
   line 242, but THE SYSTEM block and THE ROW FAMILY were appended after it.
   Later + equal-or-higher specificity beats a media query — a media query is
   NOT a priority, it is only a condition. So:
     · line 428  main{padding-left:65px}      stomped  main{padding:18px 15px}
     · row family html body .r{padding:18px}  stomped  .r{padding:13px 15px}
   Measured on settings.html at 390px: 50px of side-scroll before I touched it
   (THE-LIST said "phone side-scroll fixed, all 7 screens clean" — it was not),
   and 78px after my row rule landed on top of it.
   Anything appended to this file from here on goes ABOVE this block, or it
   will silently break the phone again. ══════════════════════════════════ */
@media (max-width:767px){
  /* width:100% is the actual lever, and min-width:0 alone was NOT enough.
     main is a grid item of .shell; without an explicit width its used width
     resolved from CONTENT (1100px, its own max-width) instead of the 390px
     track, so every block inside inherited a 1100px containing block and the
     page side-scrolled 710px. .shell>main{min-width:0} only permits shrinking;
     it does not cause it. Proven live: setting width:100% took the overflow
     710 -> 0 and let .chips scroll internally as it was always meant to. */
  html body main{padding:18px 15px calc(150px + env(safe-area-inset-bottom,0px));width:100%;box-sizing:border-box} /* 10/13: 84px only cleared the tab bar; + the 48px chat bubble + 18px air so the LAST button on a screen can scroll clear of the bubble (Keel fa8e1d6) */
  html body .r,
  html body .sw,
  html body .conn,
  html body .tr{padding:13px 15px}
  html body .ph{padding:14px 15px}
  html body .two,html body .f2,html body .trades,html body .tiers{grid-template-columns:1fr}
  html body .search{max-width:none}
  /* the import routes: icon + text stack, button drops under */
  html body .route{grid-template-columns:auto 1fr}
  /* a 3-up tier grid squashed to 128px cards on a 390px screen — pre-existing,
     unusable, and the Plan tab is where he decides to pay us. One per row. */
  html body #parts .ph{position:static}
  html body #parts .cols{top:0}
  /* the system sets main>.top{align-items:flex-end} so the action button sits on
     the h1 baseline. Stacked into one column on phone that right-aligns the
     title and subhead. Caught by looking, not by the overflow number. */
  html body main>.top{align-items:flex-start;flex-direction:column;gap:12px;
    margin-bottom:22px;padding-bottom:18px}

  /* 🔴 THE PHONE SIDE-SCROLL, ROOT CAUSE — found by bisection 2026-09-16.
     prices.html pushed 710px past a 390px screen and it was ONE element: the
     .chips strip (8 chips, 1070px intrinsic). The mobile block above already
     says these strips are meant to scroll horizontally — but a flex container
     still contributes its MIN-CONTENT width to the grid track unless you give
     it min-width:0. overflow-x:auto alone does nothing; the element scrolls
     internally AND still shoves the page. .shell>main{min-width:0} was set,
     .chips/.tabs never were, so the overflow just moved one level down.
     Bisection receipt: hiding .chips took main 1100px -> 390px on the nose. */
  html body .tabs,
  html body .chips{min-width:0;max-width:100%;overflow-x:auto;flex-wrap:nowrap;
    scrollbar-width:none;-webkit-overflow-scrolling:touch}
  html body .tabs::-webkit-scrollbar,
  html body .chips::-webkit-scrollbar{display:none}
  html body .chip,
  html body .tabs button{flex:0 0 auto}
}
