:root {
  --bg: #f4f5ef; --card: #fdfefb; --ink: #1f2a25; --muted: #66736b; --line: #dfe4d8;
  --accent: #3f6b57; --accent-ink: #ffffff; --good: #2f7a4f; --bad: #b42318;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
h1 { font-size: 24px; margin: 0; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 12px; }
header.top { background: #3f6b57; color: #eef4ee; display: flex; align-items: center; gap: 24px; padding: 12px 24px; flex-wrap: wrap; }
header.top .brand { font-weight: 700; font-size: 17px; color: inherit; text-decoration: none; }
header.top nav { display: flex; gap: 4px; flex: 1; }
header.top nav a { color: #cfe0d5; text-decoration: none; padding: 6px 12px; border-radius: 6px; }
header.top nav a.on, header.top nav a:hover { background: #2f5444; color: #fff; }
#syncState { color: #cfe0d5; font-size: 13px; text-decoration: none; }
#syncState.error { color: #fff; font-weight: 700; text-decoration: underline; }
main { max-width: 1240px; margin: 0 auto; padding: 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 16px; }
.btn { display: inline-block; font: inherit; font-weight: 600; cursor: pointer; border: 1px solid #cdd5c6; background: #fdfefb; color: var(--ink); padding: 8px 14px; border-radius: 8px; text-decoration: none; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
.muted { color: var(--muted); }
.pagehead { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.pagehead .spacer { flex: 1; }
.back { display: inline-block; font-size: 13px; margin-bottom: 10px; }
.projhead { margin-bottom: 14px; }
.projhead .name { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.projhead .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; margin-bottom: -1px; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .spacer { flex: 1; }
.tabs .side { font-size: 13px; padding-bottom: 6px; }
.stages { margin-bottom: 18px; }
.stagegrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px; }
.stages .due { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 12px; color: var(--muted); }
.stages .due input { padding: 4px 6px; font-size: 13px; min-width: 0; flex: 1; }
.stagegrid > * { min-width: 0; }
.stages .due.late { color: var(--bad); font-weight: 600; }
.stages .due.late input { border-color: var(--bad); }
.stagegrid button { width: 100%; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 8px 10px; border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 8px; }
.stagegrid button:hover { border-color: var(--accent); }
.stagegrid button.done { background: #dfe8dc; color: var(--ink); }
.stagegrid button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.phase-err { margin: 8px 2px 0; padding: 8px 10px; border-radius: 8px; background: #fbe9e7; color: var(--bad); font-size: 13px; font-weight: 600; }
/* Phone: a compact stepper instead of the phase grid. */
.phasem { display: none; }
@media (max-width: 600px) {
  .stagegrid { display: none; }
  .phasem { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 10px 4px; }
  .stepper { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(var(--steps, 5), minmax(0, 1fr)); }
  .stepper li { position: relative; }
  .stepper li + li::before { content: ''; position: absolute; top: 14px; right: 50%; width: 100%; height: 2px; background: var(--line); }
  .stepper li.done + li::before, .stepper li.done + li.on::before { background: var(--accent); }
  .stepper button { position: relative; z-index: 1; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 0 0 4px; font: inherit; cursor: pointer; color: var(--muted); }
  .stepper .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--card); border: 2px solid var(--line); }
  .stepper .lbl { font-size: 12px; font-weight: 600; }
  .stepper li.done .dot { background: #dfe8dc; border-color: var(--accent); color: var(--accent); }
  .stepper li.done .lbl { color: var(--ink); }
  .stepper li.on .dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 4px #dfe8dc; }
  .stepper li.on .lbl { color: var(--accent); font-weight: 700; }
  .pdates { border-top: 1px solid var(--line); }
  .pdate { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 2px; font-size: 14px; font-weight: 600; }
  .pdate + .pdate, details .pdate { border-top: 1px solid var(--line); }
  .pdate input { width: 150px; flex: none; padding: 5px 8px; font-size: 14px; }
  .pdate.late { color: var(--bad); }
  .pdate.late input { border-color: var(--bad); }
  .pdate b { font-size: 12px; margin-left: 4px; }
  .pdates details { border-top: 1px solid var(--line); }
  .pdates summary { padding: 9px 2px; font-size: 13px; color: var(--muted); cursor: pointer; }
  .pdates details .pdate { font-weight: 500; color: var(--muted); }
}
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: #e9eee3; color: #5c4d43; white-space: nowrap; }
.pill.in_progress { background: #dcefe0; color: var(--good); }
.pill.complete { background: #2f7a4f; color: #fff; }
/* "All projects": one section per stream. Each section is tinted in its stream's color and opens with a
   solid color band that sticks to the top of the screen while you scroll through that stream, so the
   switch from one stream to the next is obvious at a glance. */
.lane { --lane: var(--accent); --lane-bg: #eaf0ea; --lane-edge: rgba(63, 107, 87, .22);
  background: var(--lane-bg); border: 1px solid var(--lane-edge); border-radius: 12px; padding: 0 14px 14px; }
.lane + .lane { margin-top: 28px; }
.lane.shop, .plist.s-shop { --lane: #9a6a36; }
.lane.shop { --lane-bg: #f4ede4; --lane-edge: rgba(154, 106, 54, .22); }
.lanehead { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 -14px 14px; padding: 11px 16px; background: var(--lane); color: #fff; border-radius: 11px 11px 0 0;
  box-shadow: 0 2px 6px rgba(31, 42, 37, .12); }
.lanehead h2 { margin: 0; font-size: 16px; color: inherit; display: flex; align-items: center; gap: 8px; }
.lanehead h2 span { min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: rgba(255, 255, 255, .22);
  color: inherit; font-size: 13px; font-weight: 700; letter-spacing: 0; display: inline-flex; align-items: center; justify-content: center; }
.lanehead a { font-size: 13px; color: #fff; opacity: .92; white-space: nowrap; }
.lanehead a:hover { opacity: 1; }
.lane .col { background: rgba(255, 253, 248, .55); }
.lane .job { border-left: 3px solid var(--lane); }
.tabs.streams small { font-weight: 600; color: var(--muted); margin-left: 4px; }
.tabs.streams .tshort { display: none; }
/* Frozen projects: the link beside the stream tabs, and the banner on a frozen project's page. */
.tabs .frozenlink { color: #9a6a36; }
.note.frozen { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: #f4ede4; color: #9a6a36; margin: 0 0 14px; font-size: 14px; }
table.frozenlist td { vertical-align: top; }
.picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.picker .card + .card { margin-top: 0; }
.pick { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; }
.pick:hover { border-color: var(--accent); }

/* board */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stats .card { margin-top: 0; }
.stat b { display: block; font-size: 22px; }
.board { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.board.b-four { grid-template-columns: repeat(4, minmax(200px, 1fr)); }
.col { background: #e9eee3; border-radius: var(--radius); padding: 10px; min-height: 120px; }
.col h2 { margin: 4px 4px 10px; display: flex; justify-content: space-between; }
.job { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; text-decoration: none; color: inherit; }
.job:hover { border-color: var(--accent); }
.job[draggable] { cursor: grab; }
.job.dragging { opacity: .4; }
.col.over { outline: 2px dashed var(--accent); outline-offset: -2px; background: #dfe8dc; }
.job b { display: block; }
.job .row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.job .foot { margin-top: 6px; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.job .foot span { white-space: nowrap; }
.job .amt { color: var(--ink); font-weight: 600; }
.plist { display: none; }
.empty { text-align: center; padding: 56px 20px; }
table.list { width: 100%; border-collapse: collapse; }
table.list td, table.list th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
table.list th { font-size: 12px; color: var(--muted); font-weight: 600; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal .dow { padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
.cal .day { min-height: 92px; padding-bottom: 6px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal .day:nth-child(7n + 1) { border-left: 0; }
.cal .day.other { background: #f8f1e4; }
.cal .day.other .num { opacity: .45; }
.cal .num { display: inline-block; margin: 5px 6px 3px; font-size: 13px; min-width: 22px; text-align: center; border-radius: 99px; padding: 1px 4px; }
.cal .today .num { background: var(--accent); color: #fff; font-weight: 700; }
.cal .bar { display: block; height: 20px; line-height: 20px; margin: 0 -1px 3px 0; padding: 0 6px; font-size: 12px; font-weight: 600; color: #fff; text-decoration: none; white-space: nowrap; }
.cal .bar.label { position: relative; z-index: 1; }
.cal .bar.s { border-radius: 5px 0 0 5px; margin-left: 4px; }
.cal .bar.e { border-radius: 0 5px 5px 0; margin-right: 4px; }
.cal .bar.s.e { border-radius: 5px; }
.cal .bar.gap { visibility: hidden; }
.cal .bar.past { opacity: .45; }
.st-ideation { background: #2f7d4f; } .st-design { background: #2c5f9e; } .st-build { background: #c2610c; } .st-install { background: #6f42a3; }
/* month grid: the first day of a new phase is set apart by a white notch */
.cal .bar.turn { box-shadow: inset 3px 0 0 #fff; position: relative; z-index: 1; }
/* calendar view switch */
.seg { display: inline-flex; border: 1px solid #cdd5c6; border-radius: 8px; overflow: hidden; margin-right: 6px; }
.seg button { font: inherit; font-weight: 600; font-size: 14px; border: 0; background: #fdfefb; color: var(--muted); padding: 8px 12px; cursor: pointer; }
.seg button + button { border-left: 1px solid #cdd5c6; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
/* timeline: one row per project, a chevron per phase */
.tl { padding: 12px 16px 6px; }
/* phone: the timeline scrolls sideways; names stay put while the bars move under them */
.tl.swipe { padding-left: 0; padding-right: 0; overflow: hidden; }
.tl.swipe .tl-scroll { overflow-x: auto; overscroll-behavior-x: none; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tl.swipe .tl-scroll::-webkit-scrollbar { display: none; }
.tl.swipe .tl-canvas { padding: 0 10px; box-sizing: border-box; will-change: transform; }
.tl.swipe .tl-name { position: sticky; left: 10px; width: calc(var(--view) - 20px); box-sizing: border-box; }
.tl-canvas.bump-l { animation: tl-bump-l .4s ease-out; }
.tl-canvas.bump-r { animation: tl-bump-r .4s ease-out; }
@keyframes tl-bump-l { 40% { transform: translateX(14px); } }
@keyframes tl-bump-r { 40% { transform: translateX(-14px); } }
.tl-weeks, .tl-days, .tl-track, .tl-marks { display: grid; grid-template-columns: repeat(var(--days, 30), minmax(0, 1fr)); }
.tl-head { position: relative; padding-top: 22px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.tl-weeks { font-size: 12px; font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.tl-weeks span { border-left: 2px solid var(--line); padding-left: 5px; white-space: nowrap; overflow: hidden; }
.tl-todaytag { position: absolute; top: 0; transform: translateX(-50%); background: #9be3a8; color: #14532d; box-shadow: 0 0 0 1px #5fbf73; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; white-space: nowrap; }
.tl-todaytag::after { content: ""; position: absolute; left: 50%; bottom: -4px; margin-left: -4px; border: 4px solid transparent; border-bottom: 0; border-top-color: #5fbf73; }
.tl-days { font-size: 12px; color: var(--muted); }
.tl-wkline { grid-row: 1; border-left: 1px dashed #d9c9b2; }
.tl-days span { text-align: center; line-height: 1.15; font-weight: 600; }
.tl-days small { display: block; font-size: 10px; font-weight: 500; opacity: .75; }
.tl-days .wkend { color: #b3a596; }
.tl-days .today { color: var(--accent); }
.tl-row { padding: 10px 0 8px; border-bottom: 1px solid var(--line); }
.tl-row:last-child { border-bottom: 0; }
.tl-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 6px; }
.tl-name > a { font-weight: 700; color: var(--ink); text-decoration: none; }
.tl-name > a:hover { color: var(--accent); }
.tl-now { font-size: 13px; color: var(--muted); }
.stagechip { display: inline-block; color: #fff; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; }
.tl-track { position: relative; height: 26px; background: #f6eee1; border-radius: 6px; }
.tl-wkend { grid-row: 1; background: #efe4d3; }
.tl-wkend:first-child { border-radius: 6px 0 0 6px; }
.tl-seg { grid-row: 1; position: relative; display: flex; align-items: center; min-width: 0; color: #fff; text-decoration: none; font-size: 12px; font-weight: 700;
  padding: 0 4px 0 14px; margin-left: -9px;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%, 9px 50%); }
.tl-seg span { overflow: hidden; white-space: nowrap; text-overflow: clip; }
.tl-seg.first { margin-left: 0; padding-left: 7px; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); border-radius: 6px 0 0 6px; }
.tl-seg.last { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 9px 50%); border-radius: 0 6px 6px 0; }
.tl-seg.first.last { clip-path: none; border-radius: 6px; }
.tl-seg.past { opacity: .4; }
.tl-seg:hover { filter: brightness(1.1); }
.tl-today { position: absolute; top: -4px; bottom: -4px; z-index: 1; pointer-events: none; display: flex; justify-content: center; }
/* Today shows as a dark tick above and below the bar, joined by a faint line through it so the phase name stays readable. */
.tl-today::before { content: ""; width: 2px; border-radius: 2px;
  background: linear-gradient(var(--ink) 0 6px, rgba(255, 253, 248, .6) 6px calc(100% - 6px), var(--ink) calc(100% - 6px)); }
.tl-todaykey { background: var(--ink); width: 3px; }
.tl-marks { margin-top: 3px; font-size: 11px; font-weight: 600; color: var(--muted); }
.tl-marks { overflow: hidden; }
.tl-mark { grid-row: 1; white-space: nowrap; border-left: 2px solid currentColor; padding-left: 4px; line-height: 1.2; }
.tl-mark.end { border-left: 0; border-right: 2px solid currentColor; padding: 0 4px 0 0; text-align: right; }
@media (max-width: 600px) {
  .tl { padding: 10px 10px 4px; }
  .tl-days { display: none; }   /* too narrow for a number per day; the week labels and Today tag carry the dates */
  .tl-weeks { font-size: 11px; }
  .tl-weeks span { padding-left: 3px; }
  .tl-wkend { display: none; }
  .tl-marks { display: none; }   /* the row's "next" line already gives the date */
  .tl-seg { font-size: 11px; padding-left: 12px; }
  .tl-name { gap: 2px 8px; }
  .tl-now { flex-basis: 100%; }
  .seg button { padding: 7px 9px; font-size: 13px; }
}
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 10px 2px 0; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.late { color: var(--bad); font-weight: 600; }

/* editor */
.cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: minmax(0, 1fr); } .board { grid-template-columns: repeat(5, 240px); } .board.b-four { grid-template-columns: repeat(4, 240px); } }
fieldset { border: 0; padding: 0; margin: 0 0 22px; }
fieldset:last-child { margin-bottom: 0; }
.grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.f { display: block; grid-column: span 2; }
.f.w3 { grid-column: span 3; } .f.w6 { grid-column: span 6; }
.f > span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input, select, textarea { font: inherit; color: inherit; width: 100%; padding: 7px 9px; border: 1px solid #cdd5c6; border-radius: 7px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid #e3aa9d; outline-offset: 0; border-color: var(--accent); }
textarea { min-height: 70px; resize: vertical; }
.combo { position: relative; }
.combo input { padding-right: 28px; text-overflow: ellipsis; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%237a6a62' stroke-width='1.8'/%3E%3C/svg%3E") no-repeat right 9px center; }
.combo-list { position: absolute; z-index: 20; margin: 0; padding: 4px; list-style: none; background: #fff; border: 1px solid #cdd5c6; border-radius: 7px; box-shadow: 0 8px 24px rgba(31, 42, 37, .16); max-height: 264px; overflow-y: auto; }
.combo-list li { padding: 6px 8px; border-radius: 5px; cursor: pointer; }
.combo-list li[aria-selected="true"] { font-weight: 600; }
.combo-list li.active { background: var(--accent); color: var(--accent-ink); }
.combo-list li.none { color: var(--muted); cursor: default; }
.ph { display: grid; grid-template-columns: 1fr 78px 92px; gap: 8px; align-items: center; padding: 5px 0; }
.ph input[type=number] { text-align: right; }
.ph .hint { font-size: 12px; color: var(--muted); }
.tot { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.tot small { color: var(--muted); }
.tot.grand { font-size: 20px; font-weight: 700; border-top: 2px solid var(--ink); margin-top: 8px; padding-top: 10px; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.history { list-style: none; margin: 12px 0 0; padding: 0; font-size: 13px; color: var(--muted); }
.history li { display: flex; justify-content: space-between; padding: 2px 0; }
.note { font-size: 13px; padding: 8px 10px; border-radius: 7px; background: #e9eee3; margin: 0 0 10px; }
.note.err { background: #f8dcd7; color: var(--bad); }
.note.ok { background: #dcefe0; color: var(--good); }

/* design notes */
.design { max-width: 860px; }
.design textarea { field-sizing: content; min-height: 84px; }
.design .brief { min-height: 140px; }
.entry { border-top: 1px solid var(--line); padding: 14px 0; }
.entry:last-child { padding-bottom: 0; }
.entry .actions { margin-bottom: 8px; }
.entry .actions input, .entry .actions select { width: auto; }
.entry .spacer { flex: 1; }
.links { font-size: 13px; overflow-wrap: anywhere; }
.links a { display: block; margin-top: 6px; }

/* quote */
.quote { max-width: 780px; margin: 0 auto; padding: 44px; }
.quote .qhead { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.quote .qhead h1 { font-size: 28px; }
.quote .pre { white-space: pre-line; }
.quote table { width: 100%; border-collapse: collapse; margin: 18px 0; }
.quote td { padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.quote td:last-child { text-align: right; white-space: nowrap; }
.quote tr.grand td { font-size: 19px; font-weight: 700; border-bottom: 0; border-top: 2px solid var(--ink); }
.quote dl { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; margin: 0; }
.quote dt { color: var(--muted); } .quote dd { margin: 0; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1f2a25; color: #ffffff; padding: 10px 18px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; }
#toast.show { opacity: 1; }

@media print {
  header.top, .noprint, #toast { display: none !important; }
  body { background: #fff; } main { padding: 0; }
  .quote { border: 0; padding: 0; max-width: none; }
}

/* sign in / out (added with the move to Cloudflare) */
header.top form { margin: 0; }
header.top .signout { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: #cfe0d5; cursor: pointer; }
header.top .signout:hover { color: #fff; text-decoration: underline; }
.login { max-width: 420px; margin: 48px auto 0; }
.login h1 { margin-bottom: 14px; }

/* small-batch product runs */
.f.w4 { grid-column: span 4; }
.qbvariants { display: flex; flex-wrap: wrap; gap: 10px; }
.qbv { display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; width: 170px; font-size: 13px; }
.qbv span { font-weight: 600; color: var(--ink); }
.qbv small { color: var(--muted); font-weight: 400; }
.qbv .qbctl { display: flex; }
.qbv .qbctl .btn, .qbgroup, .qbv .qshort { display: none; }
/* Phone: the product picker and date full width, then one compact row per variant (name and price on the left,
   - qty + on the right, like the run page's Units to make), grouped by their first option when they share one. */
@media (max-width: 600px) {
  #batchForm .f { grid-column: 1 / -1; }
  .qbvariants { flex-direction: column; flex-wrap: nowrap; gap: 0; }
  .qbgroup { display: block; margin: 10px 0 2px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
  .qbgroup:first-child { margin-top: 2px; }
  .qbv { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; width: auto; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
  .qbv:last-child { border-bottom: 0; }
  .qbv .qbname { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
  .qbv .qbname > span, .qbv .qbname small { font-weight: inherit; }
  .qbv .qshort { display: inline; }
  .qbv .qlong { display: none; }
  .qbv small { font-size: 13px; }
  .qbv .qbctl { display: grid; grid-template-columns: 40px 52px 40px; gap: 6px; }
  .qbv .qbctl .btn { display: block; padding: 6px 0; font-size: 18px; line-height: 1.2; }
  .qbv .qbctl input { text-align: center; padding: 6px 4px; }
  .qbv.some .qbctl input { border-color: var(--accent); font-weight: 700; }
  .qbsubmit { flex-direction: column; align-items: stretch; gap: 6px; }
  .qbsubmit .btn { width: 100%; padding: 12px; font-size: 16px; }
  .qbsubmit #qbTotal { text-align: center; order: -1; }
}
.cols > * { min-width: 0; }
.qty { display: grid; grid-template-columns: minmax(0, 1fr) 36px 72px 36px 56px; gap: 6px; align-items: center; padding: 4px 0; }
.qty input { text-align: center; }
.qty .btn.small { padding: 4px 0; font-size: 16px; line-height: 1.2; }
#units #addVariant { flex: 0 1 auto; min-width: 0; max-width: 100%; text-overflow: ellipsis; }
#quickBatch { margin-bottom: 20px; }
#quickBatch .qbhead { margin-bottom: 12px; }
#quickBatch.closed .qbhead { margin-bottom: 0; }
#quickBatch.closed > :not(.qbhead) { display: none; }
.qbtoggle { font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; background: none; border: 0; padding: 4px 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.qbtoggle:hover { color: var(--ink); }
.qbchev { display: inline-block; transition: transform .15s; }
.qbtoggle[aria-expanded="true"] .qbchev { transform: rotate(90deg); }

/* to-do lists */
.taskgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.taskgrid .card + .card { margin-top: 0; }
.taskproj { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; }
.taskproj:hover { border-color: var(--accent); }
.taskproj .name { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.progress { height: 6px; background: #e9eee3; border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--good); }
.addtask { display: flex; gap: 8px; margin-bottom: 6px; }
.addtask input { flex: 1; }
.addtask textarea { flex: 1; min-height: 0; resize: none; overflow-y: auto; max-height: 40vh; line-height: 1.35; field-sizing: content; }
.addtask .btn { align-self: flex-start; }
ul.tasks { list-style: none; margin: 0; padding: 0; }
ul.tasks li.none { padding: 10px 2px; font-size: 14px; }
/* No text selection or iPhone callout menu, so a long press can pick a task up. */
li.task { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); background: var(--card); cursor: pointer;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
li.task input[type=checkbox] { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--good); cursor: pointer; }
li.task .text { flex: 1; overflow-wrap: anywhere; }
li.task.done .text { text-decoration: line-through; color: var(--muted); }
li.task.done { opacity: .6; }
li.task .when { font-size: 12px; color: var(--muted); white-space: nowrap; }
li.task .x { background: none; border: 0; font: inherit; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
li.task .x:hover { color: var(--bad); }
li.task.lifted { opacity: 1; background: #fff; border-radius: 8px; box-shadow: 0 6px 18px rgba(31, 42, 37, .22); position: relative; z-index: 2; cursor: grabbing; }
.hint { font-size: 12px; margin: 10px 0 0; }
.tasklog { max-height: 360px; overflow-y: auto; }
.tasklog li { gap: 12px; }
.tasklog li span:last-child { white-space: nowrap; }

/* phones, and the home-screen app (manifest.webmanifest). The header runs under the iPhone's
   status bar there, so it pads itself by the screen's safe areas. */
header.top { padding-top: max(12px, env(safe-area-inset-top)); padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
main { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
#toast { bottom: max(20px, env(safe-area-inset-bottom)); }
@media (max-width: 600px) {
  header.top { gap: 6px 12px; padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); }
  header.top .brand { flex: 1; }
  header.top nav { order: 3; flex: 1 0 100%; justify-content: space-between; gap: 2px; }
  header.top nav a { padding: 7px 8px; font-size: 14px; white-space: nowrap; }
  header.top .widenav { display: none; }   /* "New project" is just "New", to fit five links */
  #syncState { font-size: 12px; }
  main { padding: 16px max(12px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  /* iPhone zooms the page into any box with text under 16px when it's tapped. */
  input, select, textarea { font-size: 16px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stats .card { padding: 12px; }
  .stat b { font-size: 19px; }
  /* Projects page: the stream tabs as one row of pills with short names. Swipes sideways if it can't fit. */
  .tabs.streams { position: relative; flex-wrap: nowrap; gap: 6px; overflow-x: auto; border-bottom: 0; margin: 0 calc(-1 * max(12px, env(safe-area-inset-left))) 14px; padding: 2px max(12px, env(safe-area-inset-left)); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs.streams::-webkit-scrollbar { display: none; }
  /* A soft fade on the right edge hints that the row keeps going. */
  .tabs.streams { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent); }
  .tabs.streams .spacer { display: none; }
  .tabs.streams .tlong { display: none; }
  .tabs.streams .tshort { display: inline; }
  .tabs.streams a { flex: none; display: inline-flex; align-items: center; min-height: 38px; margin: 0; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font-size: 14px; white-space: nowrap; }
  .tabs.streams a small { min-width: 20px; height: 20px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--line); color: var(--ink); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
  .tabs.streams a.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  .tabs.streams a.on small { background: rgba(255, 255, 255, .22); color: inherit; }
  .tabs.streams a.frozenlink { margin-left: 4px; background: #f4ede4; border-color: #cdd5c6; color: #9a6a36; }
  .tabs.streams a.frozenlink small { background: #d6e2f1; color: #9a6a36; }
  /* Projects page: a compact list per stream instead of the five-column board. */
  .board { display: none; }
  .plist { display: block; }
  .pstrip { display: flex; flex-wrap: wrap; gap: 4px 9px; font-size: 11.5px; color: var(--ink); margin-bottom: 10px; }
  .pstrip span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
  .pstrip span.zero { color: var(--muted); opacity: .6; }
  .pstrip i, .pgroup h3 i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
  .pstrip span.zero i { opacity: .35; }
  .pgroup + .pgroup { margin-top: 12px; }
  .pgroup h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
  .pgroup h3 span { font-weight: 600; }
  .prow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 9px 12px; background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--lane, var(--accent)); border-radius: 8px; text-decoration: none; color: inherit; font-size: 13px; }
  .prow + .prow { margin-top: 6px; }
  .prow .pmain, .prow .pside { display: flex; flex-direction: column; min-width: 0; }
  .prow .pmain b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .prow .pmain .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .prow .pside { align-items: flex-end; gap: 3px; }
  .prow .amt { font-weight: 600; }
  .prow .pdue { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 8px; border-top: 1px dashed var(--line); margin-top: 5px; padding-top: 5px; }
  .prow .soon { color: #a35a00; font-weight: 600; }
  .pnone { margin: 0; font-size: 13px; }
  /* Each stream runs edge to edge on a phone; its color band pins under the status bar while you're in it. */
  .lane { margin: 0 calc(-1 * max(12px, env(safe-area-inset-left))); padding: 0 max(12px, env(safe-area-inset-left)) 16px;
    border-radius: 0; border-width: 1px 0; }
  .lane + .lane { margin-top: 22px; }
  .lanehead { top: env(safe-area-inset-top, 0px); margin: 0 calc(-1 * max(12px, env(safe-area-inset-left))) 12px;
    padding: 10px max(14px, env(safe-area-inset-left)); border-radius: 0; }
  .lanehead h2 { font-size: 15px; }
  .lanehead.stuck { box-shadow: 0 3px 8px rgba(31, 42, 37, .18); }
  /* A solid bar behind the status bar, colored for the stream at the top of the screen (see markStuckBands),
     so cards and the outgoing band slide underneath it instead of showing behind the clock. */
  #statusCover { position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top, 0px); z-index: 30; pointer-events: none; }
  .lanehead .lopen { display: none; }
  .stats { margin-bottom: 14px; }
  .stats .card { padding: 9px 12px; }
  .stat b { font-size: 17px; }
  .stat span { font-size: 12px; }
  .card { padding: 14px; }
  .quote { padding: 20px; }
  .quote .qhead { flex-direction: column; gap: 12px; }
  .cal .day { min-height: 64px; }
  .cal .bar { font-size: 11px; padding: 0 3px; }
  .login { margin-top: 24px; }
  h1 { font-size: 21px; }
  .pagehead { gap: 6px; }
  .pagehead .btn { padding: 7px 11px; }
  .quote .qhead > * { text-align: left !important; }
  @media (max-width: 360px) { header.top nav a { padding: 7px 4px; font-size: 13px; } }
  /* A batch run's units: the variant name on its own line, the - qty + controls under it. */
  .qty { grid-template-columns: 44px 64px 44px auto; justify-content: start; gap: 6px 8px; padding: 6px 0; }
  .qty > span { grid-column: 1 / -1; }
  .qty .btn.small { padding: 6px 0; }
  #units .actions > * { flex: 1 1 100%; }
  /* The frozen list stacks each project's details instead of squeezing six columns. */
  table.frozenlist, table.frozenlist tbody, table.frozenlist tr, table.frozenlist td { display: block; }
  table.frozenlist tr:first-child { display: none; }
  table.frozenlist tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.frozenlist td { border: 0; padding: 2px 0; }
  table.frozenlist td:last-child { padding-top: 8px; }
}
/* Tasks page: frozen and finished projects below the active ones. */
.tasksection { margin-top: 28px; }
.tasksection h2 span { font-weight: 600; margin-left: 4px; }
.taskproj.frozen { border-left: 3px solid #9a6a36; }
.taskproj.finished { opacity: .8; }
.taskproj.finished .progress span { background: #8a9a8e; }
/* Active projects can be pressed and held to move them; no link preview or text selection gets in the way. */
.taskgrid.reorder .taskproj { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.taskproj.lifted { position: relative; z-index: 2; border-color: var(--accent); box-shadow: 0 8px 22px rgba(31, 42, 37, .25); transform: scale(1.02); cursor: grabbing; }
.orderhint { margin-top: 10px; }
.orderhint .link { font-size: inherit; }
.todoall { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.todoall .card + .card { margin-top: 0; }
/* Tasks page: the combined shopping list tab. */
.shopsum { margin: 0 0 14px; font-size: 14px; }
.shopgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; align-items: start; }
.shopgrid .card + .card { margin-top: 0; }
.shophead { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.shophead a { color: inherit; text-decoration: none; }
.shophead a:hover { color: var(--accent); }
.shophead .muted { font-size: 13px; }
.shopgroup .addtask { margin: 10px 0 0; }
@media (max-width: 600px) { .shopgrid { grid-template-columns: 1fr; } }
/* Shopping list by species: one checklist per species, a column each for thickness, width, length and how many. */
.shoptop { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin-bottom: 14px; }
.shoptop .shopsum { margin: 0; flex: 1 1 260px; }
.seg { display: inline-flex; border: 1px solid #cdd5c6; border-radius: 8px; overflow: hidden; flex: none; }
.seg button { font: inherit; font-size: 14px; font-weight: 600; border: 0; background: var(--card); color: var(--muted); padding: 7px 14px; cursor: pointer; }
.seg button + button { border-left: 1px solid #cdd5c6; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.species { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; align-items: start; }
.species .card + .card { margin-top: 0; }
.spgroup h3 { margin: 0 0 8px; font-size: 17px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.spgroup h3 .muted { font-size: 13px; font-weight: 600; }
.sphead, ul.sprows li.task:not(.other) { display: grid; grid-template-columns: 24px 1fr 1fr 1.2fr 1.2fr; gap: 2px 8px; align-items: center; }
.sphead { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 0 4px 4px; border-bottom: 1px solid var(--line); }
ul.sprows li.task .dim { font-weight: 600; font-variant-numeric: tabular-nums; }
ul.sprows li.task .for { grid-column: 2 / -1; font-size: 12px; }
ul.sprows li.task.other { flex-wrap: wrap; }
ul.sprows li.task.other .for { flex-basis: 100%; padding-left: 30px; }
ul.sprows li.task.done .dim { text-decoration: line-through; color: var(--muted); }
@media (max-width: 600px) {
  .species { grid-template-columns: 1fr; }
  .sphead, ul.sprows li.task:not(.other) { grid-template-columns: 22px 0.8fr 0.8fr 1fr 1.2fr; gap: 2px 6px; }
  .seg { width: 100%; } .seg button { flex: 1; }
}
/* A sheet good with no thickness written: flagged so it gets filled in before the trip to the store. */
ul.sprows .need { color: var(--bad); font-weight: 700; }
/* Scanning a receipt: the photo, then each line to tick, fix or leave out. */
.receiptimg { display: block; max-width: 100%; max-height: 320px; margin: 14px 0 0; border: 1px solid var(--line); border-radius: 8px; object-fit: contain; }
.scanning { margin: 14px 0 0; font-weight: 600; }
.scanhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.scanhead h2 { margin: 0; }
ul.scanlines { list-style: none; margin: 8px 0 10px; padding: 0; }
ul.scanlines li { display: grid; grid-template-columns: 24px 1fr 96px 28px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
ul.scanlines li input[type=checkbox] { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
ul.scanlines li input[type=number] { text-align: right; }
ul.scanlines li.off input:not([type=checkbox]) { color: var(--muted); text-decoration: line-through; }
ul.scanlines li.added { grid-template-columns: 24px 1fr 96px; }
ul.scanlines li.added input { color: var(--muted); }
ul.scanlines .addedto { grid-column: 2 / -1; font-size: 12px; color: var(--good); font-weight: 600; }
ul.scanlines .link { font-size: 20px; text-decoration: none; color: var(--muted); }
@media (max-width: 600px) { ul.scanlines li { grid-template-columns: 24px 1fr 80px 24px; gap: 6px; } }
/* A project's material purchases. */
ul.purchases { list-style: none; margin: 0; padding: 0; font-size: 14px; }
ul.purchases li { display: grid; grid-template-columns: minmax(0, 1fr) auto 20px; overflow-wrap: anywhere; gap: 8px; align-items: start; padding: 6px 0; border-bottom: 1px solid var(--line); }
ul.purchases .amt { font-weight: 600; font-variant-numeric: tabular-nums; }
ul.purchases .link { text-decoration: none; color: var(--muted); font-size: 18px; line-height: 1; }
.over { color: var(--bad); font-weight: 600; }
/* How much of a project's budget is spent. */
.meter { height: 8px; border-radius: 99px; background: #e9eee3; overflow: hidden; margin: 8px 0 4px; }
.meter span { display: block; height: 100%; background: var(--good); border-radius: inherit; }
.meter.over span { background: var(--bad); }

/* A project's costs: budget and spending, then every receipt with its photo. */
.pl-sec { margin: 14px 0 2px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
#pnl h2 + .pl-sec { margin-top: 4px; }
.tot.grand.profit span:last-child { color: var(--good); }
.tot.grand.loss span { color: var(--bad); }
.tot.grand.perhour { font-size: 18px; border-top-width: 1px; }
.tot.grand.perhour.under span:last-child { color: var(--bad); }
#pnl .f small { font-weight: 400; color: var(--muted); }
ul.rgroups, ul.rlog { list-style: none; margin: 0; padding: 0; }
ul.rgroups > li, ul.rlog > li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
ul.rlog > li { grid-template-columns: 64px minmax(0, 1fr) auto; }
.thumb { display: block; width: 64px; height: 84px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.nophoto { display: flex; align-items: center; justify-content: center; text-align: center; width: 64px; height: 84px; border: 1px dashed var(--line); border-radius: 6px; font-size: 11px; color: var(--muted); }
.rinfo { min-width: 0; font-size: 14px; }
.rtop { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.rinfo ul.purchases li { grid-template-columns: minmax(0, 1fr) auto 20px; padding: 4px 0; }
.rinfo ul.purchases li:last-child { border-bottom: 0; }
.rprojects { font-size: 13px; margin-top: 3px; }
ul.rlog .amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.photoview { position: fixed; inset: 0; z-index: 100; background: rgba(20, 14, 12, .92); display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); cursor: zoom-out; }
.photoview img { max-width: 100%; max-height: calc(100% - 40px); object-fit: contain; background: #fff; border-radius: 4px; }
.photoview .cap { color: #f3e9dc; font-size: 13px; margin-top: 10px; text-align: center; }
.photoview .cap a { color: #fff; }
.photoview .photoacts { display: flex; gap: 8px; margin-top: 10px; }
.photoview .photoacts .btn { background: #fff; }
.printhead { display: none; }
@media print {
  .printhead { display: block; margin-bottom: 14px; }
  #summary { display: block; }
  #summary .card { border: 0; padding: 0; margin: 0 0 18px; }
  .thumb { width: 150px; height: auto; border: 0; }
  .thumb img { height: auto; object-fit: contain; }
  ul.rgroups > li { grid-template-columns: 150px minmax(0, 1fr); break-inside: avoid; }
}
#pnl .tot > :last-child, ul.rlog .amt { white-space: nowrap; }
.tot.grand.aftertax { font-size: 18px; border-top-width: 1px; }
.tot.grand.aftertax.loss span:last-child { color: var(--bad); }
.tot.grand small { font-size: 13px; font-weight: 400; }
/* Export for QuickBooks: two dates side by side, even on a phone. */
.qbrange { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 420px; }
#qbCard { margin-bottom: 16px; }
/* Receipt notes and general business expenses. */
.checkline { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 12px; font-size: 14px; cursor: pointer; }
.checkline input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.checkline small { display: block; }
.rnote { font-size: 13px; font-style: italic; color: var(--ink); margin: 3px 0; white-space: pre-wrap; }
.rgeneral { margin-top: 4px; font-size: 13px; }
.rgeneral ul.purchases li { grid-template-columns: minmax(0, 1fr) auto 20px; padding: 3px 0; }
.rnotebtn { font-size: 12px; margin-top: 2px; }
/* A receipt with no photo: the box is a button to add one. */
button.nophoto { flex-direction: column; gap: 4px; background: none; font: inherit; font-size: 11px; font-weight: 600; line-height: 1.2; color: var(--accent); cursor: pointer; padding: 4px; }
button.nophoto svg { opacity: .85; }
button.nophoto > * { pointer-events: none; }
button.nophoto:hover { border-color: var(--accent); background: #f4f5ef; }
button.nophoto.over { border: 2px solid var(--accent); background: #e9eee3; }

/* Getting around. The header's own links: Projects, Calendar, Tasks, Receipts, Settings, then + New project.
   On a phone those links move to a tab bar at the bottom, in reach of a thumb. */
header.top .hicon { display: none; color: #eef4ee; padding: 6px; border-radius: 8px; line-height: 0; }
header.top .hicon.on, header.top .hicon:hover { background: #2f5444; }
header.top .newbtn { display: inline-flex; align-items: center; gap: 2px; background: #eef4ee; color: #2f5444; font-weight: 700; text-decoration: none; padding: 6px 14px; border-radius: 8px; white-space: nowrap; }
header.top .newbtn span[aria-hidden] { font-size: 19px; line-height: 1; font-weight: 600; }
header.top .newbtn:hover, header.top .newbtn.on { background: #fff; }
nav.tabbar { display: none; }
.back { padding: 4px 0; }
.shopping .for a, .sprows .for a { color: inherit; text-decoration-color: #cdd5c6; }
@media (max-width: 600px) {
  header.top { flex-wrap: nowrap; gap: 4px; }
  header.top nav.topnav { display: none; }
  header.top .hicon { display: inline-flex; }
  header.top .newbtn { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 50%; margin-left: 4px; }
  header.top .newbtn span[aria-hidden] { font-size: 26px; font-weight: 500; margin-top: -2px; }
  header.top .newbtn .widenav { display: none; }
  nav.tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    background: rgba(255, 253, 248, .96); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
    padding: 4px max(4px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left)); }
  nav.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 0 3px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; border-radius: 10px; }
  nav.tabbar svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  nav.tabbar a.on { color: var(--accent); }
  nav.tabbar a.on svg { stroke-width: 2.3; }
  main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  #toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  body.typing nav.tabbar { display: none; }
  body.typing main { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
}
@media print { nav.tabbar { display: none !important; } }
@media (max-width: 600px) { .pagehead .wideonly { display: none; } }   /* the tab bar and the + in the header do these on a phone */

/* ---------- project hub ---------- */
.projtabs a small { font-size: 12px; font-weight: 700; color: var(--accent); margin-left: 5px; }
.sidem { display: none; }
/* The Now strip: what a project under way needs today. */
#nowStrip { margin-bottom: 14px; }
.card.now { border-left: 4px solid var(--accent); }
.nowtop { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.nowdue { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.nowdue b { font-size: 17px; }
.nowdue.soon b, .nowdue.soon span:last-child { color: #a35a00; }
.nowdue.late b, .nowdue.late span:last-child { color: var(--bad); font-weight: 600; }
.nowtop .actions { display: flex; gap: 8px; flex-wrap: wrap; }
ul.nowtasks { margin: 10px 0 0; }
ul.nowtasks li.task.done .text { text-decoration: line-through; color: var(--muted); }
.nownone { margin: 10px 0 0; font-size: 14px; }
.nowlinks { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; font-size: 14px; }
.nowlinks .spacer { flex: 1; }
.stages.flash { animation: flash 1.6s ease-out; border-radius: var(--radius); }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 4px rgba(63, 107, 87, .35); } 100% { box-shadow: 0 0 0 4px rgba(63, 107, 87, 0); } }
/* The quote form folds up once a job is under way. */
.foldbar { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.foldbar > span:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.foldbar .muted { font-size: 13px; }
.foldbar .foldword { color: var(--accent); font-weight: 600; font-size: 14px; text-decoration: underline; flex: none; }
.cols:not(.folded) .foldbar { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.cols.folded #form fieldset, .cols.folded #panel { display: none; }
/* The project's shopping list beside the lumber calculator. */
.shopmini { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.shopmini h3 { margin: 0 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.shopmini form.addtask { margin-top: 8px; }
.shopmini .hint { margin: 6px 0 0; }

/* ---------- shortcuts ---------- */
button.card.stat { font: inherit; color: inherit; text-align: left; cursor: pointer; display: block; width: 100%; }
button.card.stat:hover:not(:disabled) { border-color: var(--accent); }
button.card.stat:disabled { cursor: default; }
button.card.stat[aria-expanded="true"] { border-color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); }
#statList { margin: -8px 0 20px; }
.statlist ul { list-style: none; margin: 0; padding: 0; }
.statlist li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 2px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.statlist li:last-child { border-bottom: 0; }
.statlist li .muted { grid-column: 1; grid-row: 2; font-size: 13px; }
.statlist li .amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.lanehead .lprod { margin-left: auto; }
.scannudge { position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; z-index: 30; display: flex; align-items: center; gap: 12px;
  background: #1f2a25; color: #ffffff; padding: 10px 12px 10px 16px; border-radius: 12px; box-shadow: 0 8px 24px rgba(31, 42, 37, .3); white-space: nowrap; max-width: calc(100vw - 24px); }
.scannudge[hidden] { display: none; }
.scannudge span { overflow: hidden; text-overflow: ellipsis; }
.needdates { margin-top: 16px; }
.needdates p { margin: 0 0 8px; font-size: 14px; }
.needdates ul { list-style: none; margin: 0; padding: 0; }
.needdates li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
/* Quick find */
header.top .hicon.find { display: inline-flex; background: none; border: 0; cursor: pointer; }
.finder { position: fixed; inset: 0; z-index: 60; background: rgba(31, 42, 37, .35); display: flex; justify-content: center; align-items: flex-start;
  padding: calc(max(10px, env(safe-area-inset-top)) + 54px) 12px 12px; }
.finder[hidden] { display: none; }
.findbox { width: min(560px, 100%); background: var(--card); border-radius: 12px; box-shadow: 0 16px 40px rgba(31, 42, 37, .3); overflow: hidden; }
.findbox input { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 14px 16px; font-size: 17px; background: transparent; outline: none; }
#findResults { list-style: none; margin: 0; padding: 4px 0; max-height: 60vh; overflow-y: auto; }
#findResults a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 10px; padding: 9px 16px; color: inherit; text-decoration: none; }
#findResults a:hover, #findResults a.first { background: #e9eee3; }
#findResults a .muted { font-size: 13px; grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#findResults a .pill { grid-column: 2; grid-row: 1 / 3; align-self: center; }
.findhead { padding: 8px 16px 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.findnone { padding: 12px 16px; font-size: 14px; }

@media (max-width: 600px) {
  /* The project's tabs: one row that swipes sideways, pinned under the status bar while you scroll. */
  .projtabs { position: sticky; top: 0; z-index: 20; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px; border-bottom: 0;
    margin: 0 calc(-1 * max(12px, env(safe-area-inset-left))) 14px; padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-left)) 8px;
    background: rgba(250, 245, 236, .96); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
  .projtabs::-webkit-scrollbar { display: none; }
  .projtabs a { flex: none; display: inline-flex; align-items: center; min-height: 36px; margin: 0; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px;
    background: var(--card); color: var(--ink); font-size: 14px; white-space: nowrap; }
  .projtabs a.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  .projtabs a.on small { color: inherit; }
  .projtabs .spacer, .projtabs .side { display: none; }
  .sidem { display: flex; justify-content: flex-end; margin: -6px 0 12px; }
  .nowlinks .spacer { display: none; }
  .nowlinks > a:first-child { flex: 1 0 100%; }
  .nowtop .actions { flex: 1 0 100%; }
  .nowtop .actions .btn.primary { flex: 1; text-align: center; }
  .scannudge { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .stats button.card.stat { padding: 9px 12px; }
}
.projheadwrap { display: contents; }   /* lets the phone tab row stay pinned for the whole page */

/* Cut list (Design notes page) */
.cutlist .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cutsum { font-size: 13px; }
.cutdrop { display: flex; flex-direction: column; gap: 2px; margin: 12px 0; padding: 14px 16px; border: 2px dashed #cdd5c6; border-radius: 10px; background: #fdfefb; cursor: pointer; text-align: center; }
.cutdrop span { font-size: 13px; }
.cutdrop.over { border-color: var(--accent); background: #e9eee3; }
.cutcheck { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 0 0 12px; background: #fdfefb; }
.cutcheck.bad { border-color: var(--bad); }
.cutcheck p { margin: 0 0 8px; font-size: 14px; }
.cutcheck ul { list-style: none; margin: 0 0 10px; padding: 0; }
.cutcheck li { display: grid; grid-template-columns: 22px 56px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.cutcheck li.off .nm, .cutcheck li.off .dims { color: var(--muted); text-decoration: line-through; }
.cutcheck li input[type=checkbox] { width: 20px; height: 20px; margin: 0; accent-color: var(--good); }
.cutcheck li input[type=number] { width: 56px; padding: 4px 6px; font-size: 16px; min-height: 0; height: 34px; }
.cutcheck .dims { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cutcheck .actions .btn[disabled] { opacity: .5; }
ul.cuts li.cuthead { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 14px 4px 4px; border-bottom: 1px solid var(--line); }
ul.cuts li.cuthead:first-child { padding-top: 4px; }
li.cut .qty { display: inline; font-variant-numeric: tabular-nums; }
li.cut .dims { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink, inherit); margin-left: 4px; }
li.cut .sp, .cutcheck .sp { font-size: 12px; color: var(--muted); margin-left: 4px; }
@media (max-width: 600px) {
  .cutcheck li { grid-template-columns: 22px 52px minmax(0, 1fr); }
  .cutcheck li .dims { grid-column: 3; margin-top: -4px; color: var(--muted); }
  li.cut .dims { display: block; margin-left: 0; }
}
@media (max-width: 600px) { li.cut .when { font-size: 11px; white-space: normal; max-width: 64px; text-align: right; } }
.cutnamed { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: 0 0 8px; border-radius: 8px; background: #e9eee3; cursor: pointer; font-size: 14px; }
.cutnamed input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--good); }
.cutnamed .muted { display: block; font-size: 13px; }
.cutcheck li.none { display: block; }

/* ---------- accounts and households ---------- */
.small { font-size: 13px; }
.link.danger { color: var(--bad); }
.f small.hint { display: block; color: var(--muted); margin: 4px 0 0; }
.login form { margin: 0; }
.login .f { margin-bottom: 12px; }
.grid > .actions { grid-column: 1 / -1; }
.people { list-style: none; padding: 0; margin: 14px 0; border-top: 1px solid var(--line); }
.people li { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.people .who small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.people .acts { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.linkshare { display: grid; gap: 8px; margin: 12px 0 0; font-size: 14px; }
.linkshare input { width: 100%; font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
.linkshare .actions { margin: 0; }
.linkshare small { color: var(--muted); }
@media (max-width: 600px) { #accountCard .f.w3 { grid-column: span 6; } }
