/* Timberline CRM — one hand-written stylesheet, no framework.
   Layout: fixed sidebar + scrolling main, collapsing to a drawer on mobile. */

:root {
  --ink:        #1c2024;
  --ink-soft:   #63707d;
  --ink-faint:  #8b97a3;
  --line:       #e2e6ea;
  --line-soft:  #eef1f4;
  --page:       #f5f7f8;
  --card:       #ffffff;

  --accent:      #2f7a52;
  --accent-dark: #235f3f;
  --accent-soft: #e6f1ea;

  --danger:  #b4443c;
  --warn:    #9a6b12;
  --info:    #2b5b8c;

  --radius:  10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(20, 30, 40, .06), 0 1px 3px rgba(20, 30, 40, .04);

  --sidebar-w: 232px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .5rem; letter-spacing: -.005em; }
h3 { font-size: .95rem; margin: 0 0 .4rem; }
p  { margin: 0 0 .6rem; }

a { color: var(--accent-dark); }
.muted { color: var(--ink-soft); }
.tiny  { font-size: .78rem; line-height: 1.45; }
.linkish { color: var(--accent-dark); text-decoration: underline; }
.plainlink { color: inherit; text-decoration: none; }
.plainlink:hover { text-decoration: underline; }
.strong-link { color: var(--ink); font-weight: 600; text-decoration: none; }
.strong-link:hover { color: var(--accent-dark); text-decoration: underline; }

/* ---------- shell ---------- */

.shell { display: flex; min-height: 100vh; }
.nav-toggle { display: none; }

/* Both close controls exist only while the menu is a slide-over panel. On a
   desktop the sidebar is always visible and there is nothing to close. */
.nav-scrim { display: none; }
.sidebar__close { display: none; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: #1e2a24;
  color: #d6ded8;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: center; gap: .6rem; padding: 1rem 1rem .9rem; }
.brand--center { justify-content: center; padding: 0 0 1.2rem; color: var(--ink); }
.brand__mark {
  width: 32px; height: 32px; flex: 0 0 32px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700;
}
.brand__text strong { display: block; font-size: .95rem; color: #fff; line-height: 1.2; }
.brand--center .brand__text strong { color: var(--ink); }
.brand__text small { display: block; font-size: .72rem; color: #8fa397; }

.sidenav { flex: 1; padding: .25rem .5rem; overflow-y: auto; }
.sidenav__item {
  display: flex; align-items: center; gap: .55rem;
  padding: .5rem .6rem;
  margin-bottom: 1px;
  border-radius: var(--radius-sm);
  color: #cbd6ce;
  text-decoration: none;
  font-size: .9rem;
}
.sidenav__item:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidenav__item.is-active { background: var(--accent); color: #fff; font-weight: 600; }
.sidenav__icon { width: 1.1em; text-align: center; opacity: .85; font-size: .95em; }
.sidenav__count {
  margin-left: auto;
  background: var(--danger); color: #fff;
  border-radius: 999px;
  padding: 0 .4rem;
  font-size: .72rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.sidenav__item.is-active .sidenav__count { background: rgba(0,0,0,.28); }
.sidenav__count--quiet { background: rgba(255,255,255,.14); color: #cbd6ce; font-weight: 600; }

/* Priority and permit-status shortcuts, nested under their parent item.
   Indented and a shade quieter so the eye still reads Contacts and Permits as
   the destinations and these as ways into them, not as nine more sections. */
.sidenav__sub { margin: .1rem 0 .5rem 0; }
.sidenav__subitem {
  display: flex; align-items: center; gap: .55rem;
  padding: .28rem .6rem .28rem 2.05rem;
  border-radius: var(--radius-sm);
  color: #9fb0a5;
  text-decoration: none;
  font-size: .82rem;
}
.sidenav__subitem:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidenav__subitem.is-active { background: rgba(255,255,255,.10); color: #fff; font-weight: 600; }
.sidenav__subitem .sidenav__count { font-size: .68rem; }
.sidenav__divider { height: 1px; background: rgba(255,255,255,.09); margin: .6rem .6rem; }

.sidebar__foot { padding: .8rem 1rem 1rem; border-top: 1px solid rgba(255,255,255,.08); }
.whoami { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.whoami__name { font-size: .85rem; color: #e6ece8; }
.sidebar__note { font-size: .68rem; color: #7f9287; margin: .6rem 0 0; line-height: 1.5; }

.avatar {
  width: 26px; height: 26px; flex: 0 0 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  font-size: .7rem; font-weight: 700;
  letter-spacing: .02em;
}
.avatar--sm { width: 30px; height: 30px; flex-basis: 30px; font-size: .74rem; background: #48576b; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem 1.25rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
/* 44px, like every other tap target and like the × that closes this same menu.
   It was 29x34: the one control you need most on a phone, and the only one
   below the standard the rest of the app keeps. */
.nav-burger {
  display: none; font-size: 1.2rem; cursor: pointer;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  margin-left: -.35rem;   /* keep the glyph optically aligned with the edge */
}
.quicksearch { flex: 1; max-width: 520px; }
.quicksearch input {
  width: 100%; margin: 0;
  padding: .45rem .7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--page);
  font-size: .9rem;
}
.quicksearch input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.topbar__cta { margin-left: auto; }

.content { padding: 1.25rem; max-width: 1500px; }

.plain { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.plain__card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.75rem; width: 100%; max-width: 400px;
}
.plain__note { margin-top: 1rem; font-size: .78rem; color: var(--ink-soft); text-align: center; }

/* ---------- page furniture ---------- */

.pagehead {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.pagehead__actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
}
.card--celebrate { border-color: #bcd9c7; background: linear-gradient(#f2f9f4, #fff); }

.grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

/* ---------- KPI strip ---------- */

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: .6rem;
  margin-bottom: 1.1rem;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .7rem .8rem;
  text-decoration: none; color: inherit;
  box-shadow: var(--shadow);
}
a.kpi:hover { border-color: var(--accent); }
.kpi.is-active { border-color: var(--accent); background: var(--accent-soft); }
.kpi__value {
  display: block; font-size: 1.5rem; font-weight: 700;
  line-height: 1.1; font-variant-numeric: tabular-nums;
}
.kpi__label { display: block; font-size: .76rem; color: var(--ink-soft); margin-top: .15rem; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }
.tile {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .8rem .9rem;
  text-decoration: none; color: inherit; box-shadow: var(--shadow);
}
a.tile:hover, .tile--link:hover { border-color: var(--accent); }
.tile__value { display: block; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile__label { display: block; font-size: .78rem; color: var(--ink-soft); }
.tile__hint { display: block; font-size: .72rem; color: var(--ink-faint); margin-top: .25rem; }
.tiles--compact .tile { padding: .55rem .65rem; }
.tiles--compact .tile__value { font-size: 1.2rem; }

.spotlight {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .6rem; margin-bottom: 1.1rem;
}
.spotlight__item {
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: .55rem .75rem;
}
.spotlight__label {
  display: block; font-size: .68rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-faint); margin-bottom: .1rem;
}

/* ---------- the work queue ---------- */

.queue { margin-bottom: 1.5rem; }
.queue__head { margin-bottom: .5rem; }
.queue__head h2 { display: flex; align-items: center; gap: .45rem; }
.queue__emoji { font-size: 1.1em; }
.queue__count {
  background: var(--line-soft); color: var(--ink-soft);
  border-radius: 999px; padding: 0 .45rem;
  font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums;
}

.row {
  display: grid;
  grid-template-columns: minmax(200px, 1.4fr) minmax(140px, .9fr) minmax(200px, 1.3fr) minmax(240px, 1.1fr);
  gap: .85rem;
  align-items: start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .7rem .85rem;
  margin-bottom: .5rem;
  box-shadow: var(--shadow);
}
.row:hover { border-color: #c9d3cd; }
.row__who { display: flex; gap: .6rem; align-items: flex-start; min-width: 0; }
.row__name { font-weight: 600; color: var(--ink); text-decoration: none; display: block; }
.row__name:hover { color: var(--accent-dark); text-decoration: underline; }
.row__meta { font-size: .78rem; color: var(--ink-soft); margin-top: .1rem; word-break: break-word; }
.row__tags { display: flex; flex-wrap: wrap; gap: .25rem; align-content: flex-start; }
.row__why p { margin: .3rem 0 0; }
.row__note {
  font-size: .78rem; color: var(--ink-soft); font-style: italic;
  border-left: 2px solid var(--line); padding-left: .5rem; margin-top: .3rem !important;
}
.row__do { display: flex; flex-direction: column; gap: .35rem; }
.row__log { display: flex; gap: .3rem; flex-wrap: wrap; }
.row__log select { flex: 0 0 auto; max-width: 150px; margin: 0; }
.row__log input { flex: 1; min-width: 110px; margin: 0; }
.row__log .btn, .row__snooze .btn { margin: 0; }
.row__snooze { display: flex; gap: .3rem; align-items: center; }
.row__snooze select { margin: 0; font-size: .78rem; padding: .2rem .35rem; }

/* ---------- pipeline board ---------- */

.board {
  display: flex; gap: .7rem;
  overflow-x: auto; padding-bottom: .75rem;
  scroll-snap-type: x proximity;
}
.board__col {
  flex: 0 0 268px; min-width: 268px;
  background: #eceff1;
  border-radius: var(--radius);
  padding: .55rem;
  scroll-snap-align: start;
}
.board__head { display: flex; align-items: center; gap: .4rem; margin-bottom: .5rem; padding: 0 .15rem; }
.board__head h2 { margin: 0; font-size: .85rem; }
.board__count {
  background: #fff; border-radius: 999px; padding: 0 .4rem;
  font-size: .72rem; font-weight: 700; color: var(--ink-soft);
}
.board__due {
  margin-left: auto; font-size: .68rem; font-weight: 700;
  color: #fff; background: var(--danger);
  border-radius: 999px; padding: .05rem .4rem;
}
.board__cards { display: flex; flex-direction: column; gap: .45rem; }
.board__empty { font-size: .78rem; color: var(--ink-faint); text-align: center; padding: .6rem 0; margin: 0; }

.deal {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .55rem .6rem;
  box-shadow: var(--shadow);
}
.deal__top { display: flex; align-items: baseline; gap: .4rem; }
.deal__name { font-weight: 600; font-size: .88rem; color: var(--ink); text-decoration: none; flex: 1; }
.deal__name:hover { color: var(--accent-dark); text-decoration: underline; }
.deal__score {
  font-size: .7rem; font-weight: 700; color: var(--ink-soft);
  background: var(--line-soft); border-radius: 4px; padding: 0 .3rem;
  font-variant-numeric: tabular-nums;
}
.deal__contact { font-size: .75rem; color: var(--ink-soft); margin: .3rem 0; }
.deal__tags { display: flex; flex-wrap: wrap; gap: .2rem; margin: .3rem 0; }
.deal__next { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin: .35rem 0 .4rem; }
.deal__action { font-size: .74rem; font-weight: 600; }
.deal__move { display: flex; gap: .25rem; }
.deal__move select { flex: 1; min-width: 0; margin: 0; font-size: .74rem; padding: .2rem .3rem; }
.deal__move .btn { margin: 0; }

/* ---------- tags, badges ---------- */

.tag {
  display: inline-block;
  background: var(--line-soft); color: var(--ink-soft);
  border-radius: 4px; padding: .08rem .38rem;
  font-size: .72rem; font-weight: 600; white-space: nowrap;
}
.tag--tier-active { background: #e2f0e7; color: var(--accent-dark); }
.tag--tier-high   { background: #fdeee0; color: #8a4d14; }
.tag--tier-medium { background: #e9eef5; color: var(--info); }
.tag--tier-low    { background: var(--line-soft); color: var(--ink-soft); }
.tag--tier-new    { background: #eae7f5; color: #524484; }
.tag--tier-inactive { background: #eeeeee; color: var(--ink-faint); }
.tag--interest { background: #fbe9e7; color: #9c3d2e; }
.tag--won      { background: var(--accent-soft); color: var(--accent-dark); }
.tag--rival    { background: #f4f0e4; color: #6d6149; }

.health {
  display: inline-block; border-radius: 999px;
  padding: .1rem .5rem; font-size: .72rem; font-weight: 700; white-space: nowrap;
}
.health--healthy         { background: #e2f0e7; color: #1f5133; }
.health--needs-attention { background: #fdf2d8; color: var(--warn); }
.health--at-risk         { background: #fbe6d5; color: #8a4418; }
.health--critical        { background: #fadedd; color: #8c2c26; }
.health--dormant         { background: #e6e4e0; color: #4f4b45; }
.health--unknown         { background: #eceef1; color: #4a5361; }

.pill {
  display: inline-block; border-radius: 999px; padding: .1rem .45rem;
  font-size: .72rem; font-weight: 600; text-transform: capitalize;
}
.pill--create  { background: var(--accent-soft); color: var(--accent-dark); }
.pill--update  { background: #e8eef6; color: var(--info); }
.pill--merge   { background: #fbf0dc; color: var(--warn); }
.pill--skip    { background: var(--line-soft); color: var(--ink-soft); }
.pill--channel { background: #eceef1; color: #3c4654; text-transform: capitalize; }

.flag {
  font-size: .66rem; text-transform: uppercase; letter-spacing: .04em;
  background: #f0ece2; color: #6d6149;
  padding: .05rem .3rem; border-radius: 3px; margin-left: .25rem;
}
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: -.3rem 0 .8rem; }
.chip {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: .12rem .55rem; font-size: .78rem;
}
.chip__label {
  color: var(--ink-faint); font-size: .68rem; text-transform: uppercase;
  letter-spacing: .04em; margin-right: .2rem;
}

/* ---------- bar charts ---------- */

.bars { display: flex; flex-direction: column; gap: .3rem; }
.bars__row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr 40px; gap: .5rem; align-items: center; }
.bars__label { font-size: .8rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars__track { background: var(--line-soft); border-radius: 999px; height: 9px; overflow: hidden; }
.bars__fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; min-width: 2px; }
.bars__value { font-size: .8rem; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

.spark { display: flex; align-items: flex-end; gap: .25rem; height: 110px; margin-top: .5rem; }
.spark__col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.spark__bar { width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.spark__label { font-size: .6rem; color: var(--ink-faint); margin-top: .2rem; }

/* ---------- tables ---------- */

.scroll-x { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td {
  text-align: left; padding: .5rem .55rem;
  border-bottom: 1px solid var(--line-soft); vertical-align: top;
}
.table th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-faint); font-weight: 700; white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table--hover tbody tr:hover { background: #f8fafb; }
.row--attach td { background: #fbf9f4; }
/* A permit's own description, continuing the row above it: no top border,
   so it reads as part of that permit and not as a row of its own. */
.row--detail td { border-top: 0; padding-top: 0; color: #5b6670; font-size: .82rem; }
/* The table scrolls sideways on a narrow screen, and a cell spanning it is
   as wide as the table, not as wide as the screen -- so an unwrapped
   description ran off the right edge on a phone and had to be scrolled to.
   Wrapping at the smaller of a readable measure and the viewport keeps the
   whole description on screen at both sizes, which is the entire point of
   putting it here. */
.row--detail td > div { max-width: min(80ch, calc(100vw - 7rem)); white-space: normal; }
/* Indented with padding rather than an empty leading cell: a spacer cell
   pushes the text right by its width, and the wrap width is measured from
   the cell's own left edge, so on a phone the last few words fell off the
   screen even though the text was wrapping. */
.row--detail td { padding-left: 2.6rem; }
.table--hover tbody tr.row--detail:hover { background: transparent; }
.inline-form { display: flex; gap: .25rem; }
.inline-form select { margin: 0; font-size: .78rem; padding: .2rem .3rem; }
.inline-form .btn { margin: 0; }

/* ---------- forms ---------- */

label {
  display: block; font-size: .74rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-soft); margin-bottom: .2rem;
}
input, select, textarea {
  font: inherit; font-size: .9rem;
  padding: .4rem .55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card); color: var(--ink);
  width: 100%; margin-bottom: .6rem;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent-soft); border-color: var(--accent);
}
textarea { resize: vertical; min-height: 3.5rem; }

.btn {
  display: inline-block;
  padding: .42rem .85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card); color: var(--ink);
  font: inherit; font-size: .88rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: #c3ccd4; background: #fbfcfc; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn--small { padding: .3rem .65rem; font-size: .82rem; }
.btn--tiny  { padding: .18rem .45rem; font-size: .75rem; }
.btn--quiet { background: transparent; color: var(--ink-soft); }
.btn--quiet:hover { color: var(--danger); border-color: var(--danger); background: transparent; }
/* For actions that destroy something permanently. `btn--primary` is green and
   reads as the encouraged path, which is the wrong signal on a button that
   deletes a builder's whole history. */
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger:hover { background: #8c2c26; border-color: #8c2c26; }

.filters__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }
.filters__search { grid-column: 1 / -1; }
.filters input, .filters select { margin: 0; }
.filters__actions {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-top: .8rem; padding-top: .7rem; border-top: 1px solid var(--line-soft);
}
/* Export and Route need to be one element so an htmx filter change can swap
   them out of band by id. `contents` keeps both links as direct flex items of
   the bar above, so the wrapper changes what can be swapped and nothing about
   what is seen. */
.filters__links { display: contents; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .7rem; margin: .9rem 0; }
.grid__item--wide { grid-column: span 2; }
.grid__item--full { grid-column: 1 / -1; }
.grid input, .grid select, .grid textarea { margin: 0; }
.checkline {
  display: flex !important; align-items: center; gap: .4rem;
  text-transform: none !important; letter-spacing: normal !important;
  font-size: .88rem !important; color: var(--ink) !important; padding-top: .3rem;
}
.checkline input { width: auto; margin: 0; }
.req { font-size: .68rem; text-transform: uppercase; color: var(--danger); margin-left: .3rem; }

/* --- Tickable filter groups (route export) -----------------------------
   Replaces <select multiple>, which needed a held Ctrl key to pick more
   than one and was effectively unusable on a phone. Rows are a full 44px
   so a thumb can hit them. */
.checkgroup { border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; margin: 0; }
.checkgroup legend {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-soft); padding: 0 .3rem;
}
.checkgroup__item {
  display: flex; align-items: center; gap: .5rem;
  min-height: 44px; cursor: pointer; font-size: .9rem;
}
.checkgroup__item input { width: auto; margin: 0; flex: 0 0 auto; }
.checkgroup__label { flex: 1 1 auto; }
.checkgroup__count { font-size: .75rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* --- Contact panel groups ---------------------------------------------
   Three named blocks instead of one run of eighteen boxes: who they are,
   how to reach them, where they sit. */
.panel__group {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-soft); margin: 1.4rem 0 .2rem; font-weight: 600;
}
.panel__group:first-of-type { margin-top: .6rem; }
.field-link {
  display: inline-block; margin-top: .25rem; font-size: .8rem;
  color: var(--accent-dark); text-decoration: underline;
  overflow-wrap: anywhere;
}

/* Explains why a field being blank has a consequence, under the control that
   causes it. Quieter than a link, because it is not one. */
.field-hint {
  display: inline-block; margin-top: .25rem; font-size: .75rem;
  color: var(--ink-soft); line-height: 1.35;
  overflow-wrap: anywhere;
}

/* --- Task lists -------------------------------------------------------
   Used on the builder profile, the Weekly Plan and the Task Library, so a
   task looks the same wherever it is seen. Rows are 44px minimum: these get
   tapped one-handed at a jobsite. */
.tasklist { list-style: none; margin: .6rem 0 0; padding: 0; }
.tasklist__item {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  justify-content: space-between;
  min-height: 44px; padding: .55rem 0;
  border-top: 1px solid var(--line-soft);
}
.tasklist__item:first-child { border-top: 0; }
.tasklist__item--overdue { border-left: 3px solid var(--danger); padding-left: .5rem; }
.tasklist__main { display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; }
.tasklist__type { font-weight: 600; }
.tasklist__due { font-size: .82rem; color: var(--ink-soft); }
.tasklist__actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.tasklist__actions form { display: inline; margin: 0; }
.tasklist--quiet .tasklist__type { font-weight: 500; color: var(--ink-soft); }

.pill--pending   { background: #eceef1; color: #3c4654; }
.pill--overdue   { background: #f7e2e0; color: var(--danger); }
.pill--done      { background: var(--accent-soft); color: var(--accent-dark); }
.pill--cancelled { background: #eceef1; color: #8b97a3; }

/* --- The weekly board -------------------------------------------------
   Five columns on a desktop, stacked cards on a phone. Dave uses this
   between jobsites, so the phone case is the one that has to be right:
   no horizontal scrolling, everything tappable. */
.weekboard {
  display: grid; gap: .7rem; margin: .9rem 0;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.weekboard__day {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .7rem;
  display: flex; flex-direction: column; min-width: 0;
}
.weekboard__head h2 { font-size: .95rem; margin: 0; }
.weekboard__head p { margin: .1rem 0 .4rem; }
.weekboard__empty { margin: .3rem 0 .5rem; }
.weekboard__add { margin-top: auto; align-self: flex-start; }
/* Long builder names must wrap rather than widen the column and push the
   board sideways. */
.weekboard .tasklist__item { align-items: flex-start; }
.weekboard .tasklist__main { min-width: 0; overflow-wrap: anywhere; }

.reschedule { display: flex; gap: .25rem; align-items: center; }
.reschedule input[type="date"] { width: auto; min-height: 44px; font-size: .8rem; }

.card--warn { border-left: 3px solid var(--warn); }
.typecount { display: inline-block; margin-right: .8rem; white-space: nowrap; }

@media (max-width: 900px) {
  .weekboard { grid-template-columns: 1fr; }
}

/* --- Report Center (screen) -------------------------------------------
   The printed version has its own stylesheet; this is the on-screen one,
   which has to survive a phone in a truck. */
.kpis {
  display: grid; gap: .5rem; margin: .5rem 0 1rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.kpi {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .6rem .5rem; text-align: center; background: var(--card);
  min-width: 0;
}
.kpi__value { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1.15; }
.kpi__value a { color: var(--accent-dark); text-decoration: none; }
.kpi__value a:hover { text-decoration: underline; }
.kpi__label {
  display: block; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-soft); margin-top: .15rem;
}

.report__section {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-soft); margin: 1.3rem 0 .35rem; font-weight: 600;
}
.report__subsection { font-size: .85rem; margin: .9rem 0 .3rem; }
.report__lead { margin: .3rem 0 .6rem; }

.reportnav {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
  justify-content: space-between;
}
.reportnav__modes, .reportnav__steps, .reportnav__pick {
  display: flex; gap: .3rem; align-items: center; flex-wrap: wrap;
}
.reportnav input[type="date"], .reportnav input[type="month"] {
  width: auto; min-height: 44px;
}
.reportnav .btn { min-height: 44px; display: inline-flex; align-items: center; }

.delta--up { color: var(--accent-dark); font-weight: 600; }
.delta--down { color: var(--danger); font-weight: 600; }
.table__total th, .table__total td {
  border-top: 2px solid var(--line); font-weight: 700;
}
.table--plain th { text-align: left; font-weight: 600; }

/* Ruled both ways. A wide grid of numbers cannot be read across without
   lines to follow. */
/* All-time beside month-by-month, stacking on a phone. */
.winloss { display: grid; gap: .7rem; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; }
@media (max-width: 760px) { .winloss { grid-template-columns: 1fr; } }

.table--grid th, .table--grid td { border: 1px solid var(--line); }
.table--grid thead th { background: var(--line-soft); }
.table--grid tbody th { background: var(--line-soft); font-weight: 600; }

/* Visually hidden, still read aloud. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Today: the dispatch screen ---------------------------------------
   Deliberately unlike the database pages. Dark forest green, few numbers,
   generous spacing, and the first thing on it is what to do. */
.dispatch {
  background: linear-gradient(160deg, #16301f 0%, #1d3d28 60%, #1a3624 100%);
  color: #eaf2ec;
  border-radius: var(--radius);
  padding: 1.4rem 1.2rem 1rem;
  margin: 0 0 1rem;
}
.dispatch__greeting {
  margin: 0; font-size: 1.5rem; font-weight: 600; letter-spacing: -.01em;
  color: #fff;
}
.dispatch__date { margin: .15rem 0 1rem; color: #a9c6b4; font-size: .95rem; }
.dispatch__focus { margin: 0; display: flex; flex-direction: column; gap: .15rem; }
.dispatch__focuskind {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .1em;
  color: #8fbfa2; font-weight: 700;
}
.dispatch__focusline { font-size: 1.05rem; color: #eaf2ec; }

.weekbar { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; margin-top: 1.1rem; }
.weekbar__day {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .15rem; min-height: 52px; padding: .4rem .2rem;
  border-radius: var(--radius-sm); text-decoration: none;
  background: rgba(255,255,255,.06); color: #cfe3d6;
  border: 1px solid transparent;
}
.weekbar__day:hover { background: rgba(255,255,255,.12); }
.weekbar__name { font-size: .7rem; letter-spacing: .08em; font-weight: 700; }
.weekbar__state { font-size: .7rem; color: #9dbfab; text-align: center; }
.weekbar__day--today { background: #eaf2ec; color: #16301f; }
.weekbar__day--today .weekbar__state { color: #2f5c41; }
.weekbar__day--unfinished { border-color: #c98b7a; }
.weekbar__day--complete .weekbar__state { color: #7fc79b; }
.weekbar__day.is-selected { outline: 2px solid #8fbfa2; outline-offset: 1px; }

.card--finish { border-left: 3px solid var(--warn); }
.tasklist__detail { font-size: .85rem; color: var(--ink-soft); }
.pill--auto { background: var(--accent-soft); color: var(--accent-dark); }

.signals { list-style: none; margin: .5rem 0 0; padding: 0; }
.signals__item { padding: .5rem 0; border-top: 1px solid var(--line-soft); min-height: 44px; }
.signals__item:first-child { border-top: 0; }

.progress { list-style: none; margin: .4rem 0 0; padding: 0; }
.progress li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .3rem 0; border-bottom: 1px solid var(--line-soft); font-size: .9rem;
}

@media (max-width: 560px) {
  .dispatch { padding: 1.1rem .9rem .9rem; }
  .dispatch__greeting { font-size: 1.25rem; }
  .weekbar { gap: .25rem; }
  .weekbar__day { min-height: 56px; }
}

.route-summary { font-size: .92rem; margin: .8rem 0 .3rem; }
.route-summary.is-error { color: var(--danger); }
.route-unroutable__list { margin: .2rem 0 .6rem 1.1rem; padding: 0; }
.route-unroutable__list li { margin-bottom: .2rem; }

.attach {
  display: grid; grid-template-columns: 2fr 1fr 1.5fr 1fr auto;
  gap: .5rem; align-items: end;
}
.attach input, .attach select { margin: 0; }
.attach .btn { margin: 0; }

.alert {
  padding: .6rem .8rem; border: 1px solid var(--line);
  border-radius: var(--radius-sm); margin-bottom: .9rem; font-size: .88rem;
}
.alert--ok    { background: var(--accent-soft); border-color: #b9d8c6; color: #1f5133; }
.alert--warn  { background: #fdf2d8; border-color: #e6d3a3; color: var(--warn); }
.alert--error { background: #fadedd; border-color: #eeb9b5; color: #8c2c26; }

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .85em; background: var(--line-soft);
  padding: .08rem .28rem; border-radius: 4px; word-break: break-all;
}

/* ---------- record page ---------- */

.record__head {
  display: flex; align-items: flex-start; gap: .9rem;
  flex-wrap: wrap; margin-bottom: .9rem;
}
.record__id { display: flex; gap: .7rem; align-items: flex-start; flex: 1; min-width: 240px; }
.avatar--lg { width: 46px; height: 46px; flex-basis: 46px; font-size: 1rem; }
.record__side { display: flex; flex-direction: column; gap: .3rem; align-items: flex-end; }
.record__next {
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: .5rem .7rem; font-size: .85rem;
}

.timeline { list-style: none; margin: .5rem 0 0; padding: 0; }
.timeline__item {
  position: relative; padding: 0 0 .9rem 1.4rem;
  border-left: 2px solid var(--line);
}
.timeline__item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline__dot {
  position: absolute; left: -6px; top: .25rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--card);
}
.timeline__when { font-size: .72rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; }
.timeline__what { margin: .1rem 0 0; }
.timeline__meta { font-size: .75rem; color: var(--ink-soft); }

.doc h3 { margin: 0 0 .4rem; }
.doc__subject { margin: 0 0 .5rem; font-size: .9rem; }
.doc__label {
  margin: .6rem 0 .2rem; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-faint);
}
.doc__body {
  white-space: pre-wrap; overflow-wrap: anywhere;
  font-family: inherit; font-size: .88rem; line-height: 1.5;
  background: #f8fafb; border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: .6rem .7rem; margin: 0;
  max-height: 20rem; overflow-y: auto;
}

.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: .8rem; }
.pager__links { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.pager__current { font-size: .82rem; color: var(--ink-soft); padding: 0 .35rem; }
/* The pager above the table. Same furniture, but its top margin would push it
   away from the heading it belongs to. */
.pager--top { margin-top: 0; margin-bottom: .6rem; }
/* Numbered page links. Sized so a two-digit and a three-digit page are the
   same width -- a strip that reflows as you move through it is hard to aim at. */
.pager__num {
  min-width: 2rem;
  padding: .22rem .45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}
.pager__num:hover { border-color: var(--accent); color: var(--accent-dark); }
.pager__num.is-current {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700;
}
.pager__gap { padding: 0 .15rem; color: var(--ink-faint); font-size: .82rem; }

.touch-form__row { display: grid; grid-template-columns: 145px 125px 1fr auto; gap: .5rem; align-items: end; }
.touch-form__row input, .touch-form__row select { margin: 0; }
.touch-form__submit .btn { margin: 0; white-space: nowrap; }

/* ---------- mobile ---------- */

@media (max-width: 940px) {
  .row {
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
  }
  .row__who { grid-column: 1 / -1; }
  .row__do  { grid-column: 1 / -1; }
  .attach { grid-template-columns: 1fr 1fr; }
  .attach .attach__submit { grid-column: 1 / -1; }
  .touch-form__row { grid-template-columns: 1fr 1fr; }
  .touch-form__what, .touch-form__submit { grid-column: 1 / -1; }
  .grid__item--wide { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .sidebar {
    position: fixed; z-index: 40; left: 0; top: 0;
    transform: translateX(-100%);
    transition: transform .18s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.3);
    /* Clear the notch and the home indicator when opened as a web app. */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .nav-toggle:checked ~ .sidebar { transform: translateX(0); }
  .nav-burger { display: flex; }

  /* Tap anywhere off the menu to close it. Sits under the panel (z-index 40)
     and over everything else. */
  .nav-toggle:checked ~ .nav-scrim {
    display: block; position: fixed; inset: 0; z-index: 39;
    background: rgba(0, 0, 0, .45);
  }
  /* And an explicit X, because the burger that opened it is underneath. */
  .sidebar__close {
    display: flex; align-items: center; justify-content: center;
    margin-left: auto; width: 44px; height: 44px;
    font-size: 1.6rem; line-height: 1; color: #cbd6ce; cursor: pointer;
    border-radius: var(--radius-sm);
  }
  .sidebar__close:hover { color: #fff; background: rgba(255,255,255,.08); }
  .brand { display: flex; align-items: center; gap: .5rem; }
  .content {
    padding: .9rem;
    padding-left: max(.9rem, env(safe-area-inset-left));
    padding-right: max(.9rem, env(safe-area-inset-right));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }
  .topbar {
    padding: .5rem .9rem;
    padding-top: max(.5rem, env(safe-area-inset-top));
  }
  .topbar__cta { display: none; }
  .row { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); }
  .bars__row { grid-template-columns: minmax(70px, 40%) 1fr 34px; }
  h1 { font-size: 1.3rem; }

  /* Touch targets. Apple's guidance is 44pt; these are the controls used
     one-handed in a truck, so they get the room. */
  .btn { padding: .6rem 1rem; font-size: .95rem; }
  .btn--small { padding: .5rem .85rem; font-size: .9rem; }
  .btn--tiny { padding: .4rem .7rem; font-size: .85rem; }
  .sidenav__item { padding: .75rem .7rem; font-size: .98rem; }
  .row__log { flex-direction: column; align-items: stretch; }
  .row__log select, .row__log input { max-width: none; width: 100%; }
  .row__snooze { flex-wrap: wrap; }
  .row__snooze select { flex: 1; min-width: 140px; }
  .kpi { padding: .8rem; }
  .deal__move select, .inline-form select { padding: .45rem .4rem; }

  /* 16px stops iOS Safari zooming the page when a field is focused.
     Each selector below is more specific than the bare element rule and
     would otherwise keep its desktop size, so it is repeated here. */
  input, select, textarea { font-size: 16px; }
  .quicksearch input { font-size: 16px; }
  .row__snooze select { font-size: 16px; }
  .deal__move select, .inline-form select { font-size: 16px; }

  /* One column is easier to thumb through than a sideways scroll. */
  .board { flex-direction: column; overflow-x: visible; }
  .board__col { flex: 1 1 auto; min-width: 0; width: 100%; }
}

/* Opened from the Home Screen: no Safari chrome, so reclaim the inset. */
@media (display-mode: standalone) {
  .topbar { padding-top: max(.75rem, env(safe-area-inset-top)); }
}

/* ---------------------------------------------------------------------
   Permit Intelligence
   Reuses the CRM's cards, tables, tiles and buttons. The only new pieces
   are the section tab strip and a small inline chip for contact type.
   --------------------------------------------------------------------- */

.permit-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1rem;
}

.chip--tiny {
  font-size: .7rem;
  padding: .05rem .35rem;
  margin-left: .35rem;
  vertical-align: middle;
}

/* Changes page: stepping one day at a time. Buttons rather than a date
   picker, because the question is almost always "what did I miss yesterday". */
.daynav {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1rem;
}

/* A permit nobody had seen before, as opposed to one that moved. Same soft
   accent the other "this is new" chips use. */
.pill--new { background: var(--accent-soft); color: var(--accent-dark); }

@media (max-width: 720px) {
  /* Day stepping is a thumb target in a truck, same as the tabs above. */
  .daynav .btn { flex: 1 1 45%; text-align: center; }
}

/* Read-only "what the city said" table: label column stays narrow and
   left-aligned so the values line up down the page. */
.card table th {
  text-align: left;
  white-space: nowrap;
  vertical-align: top;
}

@media (max-width: 720px) {
  /* Tabs become a full-width stack rather than a cramped wrap -- these are
     thumb targets on a phone in a truck. */
  .permit-tabs .btn { flex: 1 1 45%; text-align: center; }

  /* Multi-selects on the route page are unusable at four rows on a phone. */
}

/* --- Branch band -------------------------------------------------------
   Only rendered when a process serves more than one branch. On the single
   branch installs -- which is every one today -- none of this appears.

   The colour is the point. A name in grey text is the thing you stop
   noticing after a week, and "which branch am I editing?" is the question
   this whole design exists so nobody has to ask. */

.branchband {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .4rem 1rem;
  color: #fff;
  font-size: .85rem;
}

.branchband__name {
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.branchband__switch { margin-left: auto; display: flex; gap: .4rem; }

.branchband__switch button {
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .45);
  color: #fff;
  padding: .2rem .7rem;
  border-radius: 4px;
  font-size: .8rem;
  cursor: pointer;
}

.branchband__switch button:hover { background: rgba(255, 255, 255, .3); }

/* --- Branch chooser ---------------------------------------------------- */

.branchpick { display: grid; gap: .6rem; margin-top: 1.25rem; }

.branchpick__button {
  width: 100%;
  text-align: left;
  padding: .9rem 1rem;
  font-size: 1.05rem;
  font-weight: 600;
  background: #fff;
  border: 1px solid #d5dbe1;
  border-radius: 6px;
  cursor: pointer;
}

.branchpick__button:hover { background: #f4f7fa; }

/* --- Contact picker ----------------------------------------------------
   Replaces a <select> that rendered the whole contact list capped at 500
   options, which made 1,115 of 1,615 contacts unreachable and made the
   control slow to open. This is a text input with a server-backed list, so
   it does not care how large the list grows. */

.picker { position: relative; }

.picker__control { display: flex; align-items: center; gap: .25rem; }

.picker__input { width: 100%; }

.picker__clear {
  background: none;
  border: 0;
  font-size: 1.4rem;
  line-height: 1;
  padding: 0 .4rem;
  cursor: pointer;
  color: #6b7a72;
}
.picker__clear:hover { color: #1e2a24; }

.picker__status { font-size: .8rem; color: #6b7a72; min-height: 1.1rem; margin-top: .2rem; }
.picker__status--empty { color: #8a6d3b; }
.picker__status--error { color: #b4453a; }

.picker__list {
  position: absolute;
  z-index: 40;                 /* above panels; a menu hidden behind a card
                                  is the same as a menu that does not work */
  left: 0;
  right: 0;
  margin: .2rem 0 0;
  padding: 0;
  list-style: none;
  background: #fff;
  border: 1px solid #c9d2cd;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  max-height: 15rem;
  overflow-y: auto;
}

.picker__option { padding: .5rem .7rem; cursor: pointer; }
.picker__option:hover,
.picker__option.is-active { background: #eef3f0; }

/* Touch targets big enough to hit on a phone, and a list that cannot grow
   taller than the visible area above the keyboard. */
@media (max-width: 640px) {
  .picker__option { padding: .7rem .8rem; }
  .picker__list { max-height: 11rem; }
}

/* --- Autosave state ----------------------------------------------------
   Subtle by design. A save that worked should be reassuring, not loud; a
   save that failed must be impossible to miss and must keep what you typed. */

.savestate {
  display: inline-block;
  font-size: .75rem;
  margin-left: .4rem;
  min-height: 1rem;
  color: #6b7a72;
  transition: opacity .2s ease;
}
.savestate--saving { color: #6b7a72; }
.savestate--saved  { color: #2f6f4e; }
.savestate--idle   { opacity: 0; }
.savestate--failed { color: #b4453a; font-weight: 600; }

.savestate__retry {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: #b4453a;
  text-decoration: underline;
  cursor: pointer;
}

/* A failed field keeps what you typed and says so. */
.is-failed { border-color: #b4453a !important; background: #fffafa; }

.autosave-note { margin-top: 1rem; }

/* ---------------------------------------------------------------------------
   UI audit, 2026-08-10. See docs/specs/2026-08-10-ui-audit.md.
   --------------------------------------------------------------------------- */

/* Sign out measured 2.94:1 against the sidebar -- WCAG AA wants 4.5:1, and
   every other item in that sidebar already sits between 6.5 and 9.9. It was
   inheriting --ink-soft, which is tuned for the white page behind the main
   column, not for the dark sidebar. */
.sidebar__foot .btn--quiet { color: #cbd6ce; }
.sidebar__foot .btn--quiet:hover { color: #fff; border-color: #cbd6ce; }

/* An escape hatch has to be as easy to hit as the thing it escapes. On the
   delete confirmation the destructive button measured 429px wide against
   Cancel at 67px -- six times the target for the irreversible option. The
   warning is not softened; the way out is enlarged. */
.confirm-actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: stretch; }
.confirm-actions .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.confirm-actions .btn--quiet { min-width: 9rem; border: 1px solid var(--line); background: var(--card); }
.confirm-actions .btn--quiet:hover { border-color: var(--ink-soft); color: var(--ink); }

/* Touch targets.
   71 interactive elements measured under 44px tall at 375x812, the worst being
   the contact-name link in the list at 17px -- the primary way into a record.
   WCAG 2.5.8 sets 24x24 as the floor; Apple and Material both say 44.
   Scoped to coarse pointers so the desktop density, which is deliberate and
   good, is left exactly as it is. */
@media (pointer: coarse) {
  .btn, .sidenav__item, .sidenav__subitem,
  button[type="submit"], input[type="submit"] {
    min-height: 44px;
  }
  .btn { display: inline-flex; align-items: center; justify-content: center; }

  /* The row link keeps its type size; the hit area grows around it. Padding
     rather than a taller font, so the list still fits a useful number of
     builders on one screen. */
  .row__name, .strong-link {
    display: inline-block;
    padding-block: .6rem;
  }
  td .btn--tiny, .inline-form .btn { min-height: 40px; }

  /* Form controls too. A 37px select is a select you miss on a bumpy truck
     dashboard, which is where a lot of this gets used. */
  select, input:not([type="checkbox"]):not([type="radio"]), textarea {
    min-height: 44px;
  }

  /* Inline text links that act as actions -- "Export this list to Excel" and
     its kin -- get the same vertical room without becoming buttons. */
  .linkish { display: inline-block; padding-block: .5rem; }
}

/* The "not everything is drawn" note under a capped queue group. Quiet, but
   not so quiet that somebody assumes the list ended. */
.queue__more {
  margin: .25rem 0 1.25rem;
  padding: .6rem .75rem;
  font-size: .82rem;
  color: var(--ink-soft);
  background: var(--line-soft);
  border-radius: var(--radius-sm);
}

/* "+N more" at the foot of a capped board column. */
.board__more {
  margin: .4rem 0 0;
  font-size: .78rem;
  color: var(--ink-soft);
  text-align: center;
}


/* ---------- takeoff tool ----------
   A field tool. Controls are big enough to hit with a thumb while holding a
   tape measure, and the wide measurement table becomes stacked cards on a
   phone rather than something you scroll sideways. */
.to-card { margin-bottom: .8rem; }
.to-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .6rem;
}
.to-grid label { display: flex; flex-direction: column; gap: .2rem; font-size: .82rem; color: var(--ink-soft); }
.to-grid input, .to-grid select, .to-grid textarea { margin: 0; font-size: .95rem; padding: .5rem .6rem; }

.to-section { margin-bottom: .6rem; padding: .6rem .9rem; }
.to-section > summary {
  cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  gap: .6rem; font-weight: 600; list-style: none; padding: .25rem 0;
}
.to-section > summary::-webkit-details-marker { display: none; }
.to-section > summary::before { content: "▸"; color: var(--ink-faint); margin-right: .4rem; }
.to-section[open] > summary::before { content: "▾"; }
.to-section__name { flex: 1; }
.to-section__total { font-variant-numeric: tabular-nums; color: var(--accent-dark); font-weight: 700; }

.to-group { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem; margin: .5rem 0; }
.to-spec { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .5rem; margin-bottom: .5rem; }
.to-spec label { display: flex; flex-direction: column; gap: .15rem; font-size: .76rem; color: var(--ink-soft); }
.to-spec select, .to-spec input { margin: 0; padding: .45rem .5rem; font-size: .9rem; }

.to-measurements input, .to-measurements select { margin: 0; padding: .45rem .5rem; font-size: .95rem; }
.to-measurements td { vertical-align: middle; }
.to-group__foot { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .4rem; }
.to-group__total { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.to-gutters input { margin: 0; max-width: 8rem; padding: .4rem .5rem; }

.savestate--busy { color: var(--ink-soft); }
.savestate--ok { color: var(--accent-dark); }
.savestate--error { color: var(--danger); font-weight: 600; }
.picker__option--new { font-style: italic; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

@media (max-width: 780px) {
  /* The measurement table becomes one card per line. A six-column table on a
     phone is a table nobody can use standing up. */
  .to-measurements thead { display: none; }
  .to-measurements, .to-measurements tbody, .to-measurements tr, .to-measurements td { display: block; width: 100%; }
  .to-measurements tr {
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: .5rem; margin-bottom: .5rem;
  }
  .to-measurements td { border: 0; padding: .25rem 0; }
  .to-measurements td::before {
    content: attr(data-label); display: block;
    font-size: .72rem; color: var(--ink-soft); margin-bottom: .15rem;
  }
  .to-measurements input, .to-measurements select { width: 100%; min-height: 44px; }
  .to-group__total { margin-left: 0; }
}

.to-files { list-style: none; padding: 0; margin: 0 0 .6rem; }
.to-files li {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding: .4rem 0; border-bottom: 1px solid var(--line-soft);
}
.to-upload { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.to-upload input[type=file] { margin: 0; font-size: .85rem; }

/* The measurement switch: L x W or a count. A switch rather than a dropdown so
   both options are readable without opening anything, and changing how you are
   measuring is one tap. */
.to-switch { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.to-switch__opt {
  border: 0; background: var(--card); color: var(--ink-soft);
  padding: .45rem .7rem; font-size: .84rem; cursor: pointer; white-space: nowrap;
}
.to-switch__opt + .to-switch__opt { border-left: 1px solid var(--line); }
.to-switch__opt[aria-pressed="true"] { background: var(--accent); color: #fff; font-weight: 600; }
.to-inputs { min-width: 15rem; }
/* [hidden] and a class rule have the same specificity, so the later one wins.
   These display rules come after it in the file and would otherwise re-show a
   box the switch just hid -- which is how all three inputs stayed visible. */
[hidden] { display: none !important; }
.to-pair { display: inline-flex; align-items: center; gap: .35rem; }
.to-pair input { max-width: 6.5rem; }
.to-times { color: var(--ink-faint); }
.to-single { display: inline-flex; align-items: center; gap: .5rem; }
.to-single input { max-width: 8rem; }
.to-inherits { font-size: .74rem; color: var(--ink-faint); white-space: nowrap; }

/* The sloped ceiling's own two heights. Labelled, unlike L x W: "11 x 12" is
   self-evident and "20 / 8" is not -- one is the peak off the ground and the
   other the truss heel, and getting them the wrong way round inverts the
   roof. */
.to-slope { display: inline-flex; align-items: flex-end; gap: .5rem; margin-right: .5rem; }
.to-dim { display: inline-flex; flex-direction: column; gap: .15rem;
          font-size: .72rem; color: var(--ink-faint); }
.to-dim input { max-width: 5rem; }
/* The pitch, under the answer. Quiet: it is a check, not the number being
   quoted off. */
.to-detail { display: block; font-size: .72rem; color: var(--ink-faint);
             white-space: nowrap; font-variant-numeric: tabular-nums; }

@media (max-width: 780px) {
  /* 44px, like every other tap target: this is used one-handed on a
     phone in a half-built house, and the switch gained a third option
     when the sloped ceiling arrived. */
  .to-switch__opt { padding: .6rem .8rem; font-size: .9rem; min-height: 44px; }
  .to-pair input, .to-single input { max-width: none; flex: 1; min-height: 44px; }
  .to-pair, .to-single { display: flex; width: 100%; }
  /* Four boxes on a phone: two up, two under, each still a 44px target. */
  .to-slope { display: flex; width: 100%; margin: 0 0 .4rem; }
  .to-dim { flex: 1; }
  .to-dim input { max-width: none; width: 100%; min-height: 44px; }
}

.to-flash input { font-variant-numeric: tabular-nums; }

/* Splits the permit shortcuts into Target and Status. Without it the sidebar
   shows "Closed" twice with different numbers and no way to know which is
   which -- our judgement about chasing the job, versus the county having
   finaled the permit. */
/* County portal rows. The arrow says "this leaves the CRM" without a
   word of explanation, and the row is otherwise an ordinary subitem. */
.sidenav__subitem--external { display: flex; align-items: center;
                              justify-content: space-between; gap: .4rem; }
.sidenav__external { opacity: .55; font-size: .85em; }

.sidenav__grouplabel {
  display: block;
  padding: .45rem .6rem .15rem 1.35rem;
  font-size: .66rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #7f9287;
}

/* --- Bulk address type -------------------------------------------------
   The bar above the contact list. 565 contacts had an address and none was
   characterised, so office-visit dispatch produced nothing; ticking twenty at
   a time is the difference between a control that gets used and one that does
   not. */
.bulkbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
  padding: .6rem .8rem;
  border-bottom: 1px solid var(--line);
  background: var(--card-soft, #f6f8f7);
}
.bulkbar__all { display: flex; align-items: center; gap: .4rem; font-size: .85rem; }
.bulkbar select { margin: 0; }
.bulkbar label { margin: 0; font-size: .85rem; }
/* 44px targets: this gets used one-handed in a truck like everything else. */
.bulkbar input[type="checkbox"],
.tickcol input[type="checkbox"] { width: 20px; height: 20px; }
.tickcol { width: 44px; text-align: center; }

/* Call notes on a Today task card. Full width so a sentence is readable while
   it is being typed, and it wraps under the buttons on a phone rather than
   squeezing them off the row. */
.tasklist__note {
  flex: 1 1 100%;
  min-width: 12rem;
  margin: .35rem 0 0;
  padding: .4rem .55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .85rem;
  resize: vertical;
}
.tasklist__note:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

/* ...except in a Weekly Plan day column, which is about 190px wide -- narrower
   than the 12rem minimum above. The box hung 12px past its own card and over
   the top of the next day. Here it shrinks to the column instead: a long note
   gets taller rather than wider, which is what the day columns do with every
   other piece of text in them. */
.weekboard__day .tasklist__note {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

/* --- Fleet Center --------------------------------------------------------
   Read in the yard, on a phone, one-handed. The summary wraps rather than
   scrolls, and every card is a tap target rather than a row of small links. */
.fleetstats {
  display: flex; flex-wrap: wrap; gap: .6rem; margin: .9rem 0;
}
.fleetstat {
  flex: 1 1 8rem; min-width: 7rem;
  padding: .6rem .7rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card-soft, #f6f8f7);
}
.fleetstat__n { display: block; font-size: 1.5rem; font-weight: 600; line-height: 1.1; }
.fleetstat__l { display: block; font-size: .78rem; color: var(--muted); }
/* Only when there is something to say. A nought in warning colours teaches
   people to ignore the colour. */
.fleetstat--warn { border-color: var(--accent); }
.fleetstat--bad { border-color: #b3402f; }

.fleetlist { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }

/* The status stripe. Green ready, yellow needs attention, red out of service,
   grey not dispatched -- Dave's four, in his words. A vehicle with an open
   issue is NOT red: recording a fault never decides a truck is unsafe. */
.fleetcard {
  border: 1px solid var(--line); border-left: 5px solid var(--line);
  border-radius: var(--radius-sm); padding: .7rem .8rem; background: var(--card);
}
.fleetcard--green  { border-left-color: #2f6f4e; }
.fleetcard--yellow { border-left-color: #b8860b; }
.fleetcard--red    { border-left-color: #b3402f; }
.fleetcard--grey   { border-left-color: var(--line); }

.fleetcard__name {
  display: inline-block; font-weight: 600; text-decoration: none;
  color: inherit; min-height: 44px; line-height: 44px;
}
.fleetcard__name:hover { text-decoration: underline; }
.fleetcard__facts { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
/* The clickable summary tile keeps the tile's own look and gains a tap target
   -- it opens the exact list its number was counted from. */
a.fleetstat { text-decoration: none; color: inherit; display: block; }
a.fleetstat:hover { border-color: var(--accent); }

/* A checkbox somebody can actually hit. The default is 13px; Dave's standard
   for this app is 44px and "no tiny checkboxes". The whole row is the target,
   because a label toggles its own checkbox. */
.tapcheck {
  display: flex; align-items: center; gap: .6rem;
  min-height: 44px; margin: .4rem 0;
  font-size: .85rem; color: var(--ink-soft);
  cursor: pointer;
}
.tapcheck input[type="checkbox"] { width: 22px; height: 22px; flex: 0 0 22px; margin: 0; }

/* Fleet Attention on Today. Compact: a short list of only what is wrong, each
   line a tap target linking to the view its number came from. */
.fleetattention { list-style: none; margin: .2rem 0 0; padding: 0; }
.fleetattention li { border-top: 1px solid var(--line-soft); }
.fleetattention li:first-child { border-top: 0; }
.fleetattention a {
  display: flex; align-items: center; gap: .4rem;
  min-height: 44px; font-size: .9rem;
}
.fleetattention strong { font-variant-numeric: tabular-nums; }

/* The compliance window chips. */
.chip--on { background: var(--accent); color: #fff; }

/* Printing a Fleet report. Dave was asked to manage the fleet by somebody who
   will want to see how it is going, so the report has to come off a printer
   looking like a report and not like a web page: no sidebar, no top bar, no
   buttons, and cards that do not break across a page. */
@media print {
  .no-print { display: none !important; }
  .sidebar, .topbar, .nav-scrim, .panel__head .btn { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .card {
    box-shadow: none;
    border-color: #999;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .fleetstats { break-inside: avoid; }
  a { text-decoration: none; color: inherit; }
}

/* --- Fleet service records ---------------------------------------------- */

/* "When was the last oil change" answered at a glance, before any table. This
   is the question the whole section exists for, so it is not buried in a row
   of history. */
.servicelast {
  display: flex; flex-wrap: wrap; gap: .5rem; margin: .25rem 0 .9rem;
}
.servicelast__item {
  display: flex; flex-direction: column; gap: .1rem;
  padding: .5rem .7rem; min-width: 9rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card);
}
.servicelast__label {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-faint);
}
.servicelog { margin: .5rem 0 1rem; }
.servicelog > summary { cursor: pointer; font-weight: 600; padding: .4rem 0; }
.servicerows select, .servicerows input { width: 100%; }

@media (max-width: 780px) {
  /* Used standing next to the truck: full-width rows, 44px targets. */
  .servicelast__item { flex: 1 1 100%; }
  .servicelog > summary { min-height: 44px; display: flex; align-items: center; }
  .servicerows select, .servicerows input { min-height: 44px; }
}

/* The HubSpot export's category picker: a group, and the stored priorities
   inside it indented under their heading. Dave asked for every priority to be
   choosable, and a flat list of thirteen reads as thirteen unrelated things. */
.hubgroup { margin: 0 0 .75rem; }
.hubgroup__members {
  margin-left: 1.25rem;
  border-left: 2px solid var(--line, #e3e3e3);
  padding-left: .75rem;
}
.hubgroup__members .tapcheck { font-size: .95em; }

/* ---------------------------------------------------------------------- */
/* Export for Mobile                                                       */
/* ---------------------------------------------------------------------- */
/* Built for a phone held in one hand in a van. Copy Addresses is the whole
   point of the screen, so it is full width and thumb-sized rather than a
   normal inline button -- measured at 375px, where the default .btn came out
   135x44 and was easy to miss. */
.route-copy__action {
  display: block;
  width: 100%;
  padding: .85rem 1rem;
  font-size: 1.05rem;
}

/* The block people copy. `pre-wrap` is what lets a long address wrap on a
   narrow screen WITHOUT putting a line break into the value -- the copied
   text stays one address per line, which is the only thing MyRouteOnline's
   bulk importer cares about. */
.route-copy__block {
  width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .95rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  resize: vertical;
}

.route-copy__label {
  display: block;
  margin: .75rem 0 .25rem;
}

/* Only ever set by route_mobile.js, and only after a copy reported success or
   failure. Nothing here is in the page as shipped. */
.route-copy__state { min-height: 1.2em; margin: .4rem 0 0; }
.route-copy__state.is-ok { color: var(--accent-dark); font-weight: 600; }
.route-copy__state.is-warn { color: var(--danger); font-weight: 600; }

/* Two exports, side by side on a desktop and stacked on a phone. */
.route-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }

@media (max-width: 540px) {
  .route-actions { flex-direction: column; }
  .route-actions .btn { width: 100%; padding: .7rem 1rem; }
}

/* ---------- Permit List inbox (permit-inbox.js) ----------
   Dave, 2026-10-09: an email-style inbox, used in trucks. Every tap target is
   at least 44px; the bar stays in view while the list scrolls, just under the
   sticky top bar; on a phone the actions become a grid of full-size buttons
   rather than a desktop toolbar squeezed small. */
.inbox__bar {
  position: sticky; top: var(--inbox-top, 3.6rem); z-index: 15;
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .5rem .75rem; margin-bottom: .75rem; box-shadow: var(--shadow);
}
.inbox--active .inbox__bar { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.inbox__all { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; cursor: pointer; font-weight: 600; }
.inbox__all input, .inbox__ticklabel input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.inbox__count { margin: 0; font-weight: 700; min-width: 11rem; }
.inbox--active .inbox__count { color: var(--accent-dark); }
.inbox__actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-left: auto; }
.inbox__btn { min-height: 44px; min-width: 44px; }
.inbox__btn:disabled { opacity: .45; cursor: not-allowed; }
.inbox__btn--closed:not(:disabled) { color: var(--danger); border-color: var(--danger); }
.inbox__assign { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; }
.inbox__assign[hidden] { display: none; }
.inbox__assign .picker { flex: 1 1 18rem; }
.inbox__matching {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; justify-content: center;
  background: #fdf2d8; border: 1px solid #e6d3a3; border-radius: var(--radius-sm);
  padding: .55rem .75rem; margin-bottom: .75rem; text-align: center;
}
.inbox__matching[hidden] { display: none; }
.inbox__matching .linkish { min-height: 44px; font-weight: 700; background: none; border: 0; cursor: pointer; }
.inbox__tick { width: 44px; padding-left: .25rem !important; padding-right: 0 !important; }
.inbox__ticklabel { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; cursor: pointer; }
.inbox-review__lead { font-size: 1.1rem; }
.inbox-review__buttons { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }

@media (max-width: 760px) {
  .inbox__bar { padding: .5rem; gap: .4rem; }
  .inbox__count { flex: 1 1 auto; min-width: 0; }
  .inbox__actions { flex: 1 1 100%; margin-left: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
  .inbox__actions .inbox__btn { width: 100%; }
  .inbox__assign .picker { flex-basis: 100%; }
  .inbox__assign .inbox__btn { width: 100%; }
  .inbox-review__buttons .inbox__btn { flex: 1 1 100%; }
}

/* ---------------------------------------------------------------------- */
/* Notes                                                                   */
/* ---------------------------------------------------------------------- */
/* Built for a phone in a truck: open CRM, Notes, New Note, type, save. The
   New Note button is full width and thumb-sized on a phone because that is
   the journey, and search sits below it because writing is the common case
   and finding is the occasional one. */
.notes__new {
  display: inline-block;
  padding: .7rem 1.4rem;
  font-size: 1.02rem;
  margin-bottom: .75rem;
}

.notes__search { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }
.notes__search label { display: block; width: 100%; }
.notes__search input[type="search"] { flex: 1 1 14rem; min-width: 0; }

.notes { list-style: none; margin: 0 0 1rem; padding: 0; }
.notes__item {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: .5rem;
}
.notes__link {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  padding: .75rem .9rem;
  text-decoration: none;
  color: inherit;
}
.notes__item form { padding-right: .9rem; }
.notes__title { display: block; font-weight: 600; }
/* One line of the note under the title, so the list is scannable without
   opening anything. Clipped rather than wrapped: a long note would otherwise
   push every other note off the screen. */
.notes__preview {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink-soft);
  font-size: .92rem;
  margin-top: .15rem;
}
.notes__dates { display: block; margin-top: .25rem; }

.notes__label { display: block; margin: .75rem 0 .25rem; font-weight: 600; }
.notes__title-input { width: 100%; box-sizing: border-box; font-size: 1rem; }
/* The point of the screen. Big enough to write a paragraph in without
   scrolling, and resizable for when it is not. */
.notes__body {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 1rem;
  line-height: 1.55;
  resize: vertical;
  min-height: 15rem;
}
.notes__save { margin-top: .75rem; padding: .7rem 1.6rem; font-size: 1.02rem; }

@media (max-width: 540px) {
  .notes__new,
  .notes__save { display: block; width: 100%; text-align: center; }
  .notes__search input[type="search"] { flex: 1 1 100%; }
  /* A phone keyboard eats half the screen, so the box starts shorter and
     grows with the content rather than pushing Save out of reach. */
  .notes__body { min-height: 11rem; }
  .notes__item { flex-wrap: wrap; }
  .notes__item form { width: 100%; padding: 0 .9rem .75rem; }
  .notes__item form .btn { width: 100%; }
}

/* ---------- Task Board ----------
   Dave, 2026-10-14: "a real office tack board covered in colorful sticky
   notes. Not a spreadsheet. Not a Kanban board with rigid columns." One
   forest-green board in Timberline's own greens, paper notes pinned to it at
   slightly different angles. The angle and colour come from classes the page
   sets (no inline style, no stored layout), so a note stays where it is
   between visits. Nothing essential depends on hover: every control is a
   plain link or button big enough for a thumb. */

:root {
  --board:       #085C26;   /* Timberline dark forest green */
  --board-edge:  #064A31;   /* Timberline dark green */
  --board-glow:  #85C226;   /* Timberline bright green */
  --paper-yellow: #fff2a6;
  --paper-cream:  #fbf5e1;
  --paper-green:  #dcf1c2;
  --paper-orange: #ffdbb0;
  --paper-blue:   #d5e9f8;
}

.board-head { display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; margin-bottom: .6rem; flex-wrap: wrap; }
.board-head__count { margin: 0; }
.board-head__late { color: var(--danger); font-weight: 600; }

.board-new { margin: 0 0 1rem; }
.board-new > summary { list-style: none; }
.board-new > summary::-webkit-details-marker { display: none; }
.board-new__toggle {
  display: inline-flex; align-items: center; min-height: 44px; padding: .5rem 1.1rem;
  background: var(--board-glow); border-color: #74ad1f; color: var(--board-edge);
  font-size: .95rem; font-weight: 700;
}
.board-new__toggle:hover { background: #95d136; border-color: #74ad1f; color: var(--board-edge); }
.board-new[open] .board-new__toggle { background: var(--board-edge); border-color: var(--board-edge); color: #fff; }
.board-new__form { margin-top: .6rem; max-width: 760px; }
.board-new__grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1rem; margin-bottom: .9rem; }
.board-new__wide { grid-column: 1 / -1; }
.board-new__form input, .board-new__form select, .board-new__form textarea { width: 100%; min-height: 44px; }
.board-new__save { min-height: 44px; }

.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 30px 26px;
  align-items: start;
  padding: 34px 30px 40px;
  background: var(--board);
  border: 10px solid var(--board-edge);
  border-radius: 14px;
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, .35), 0 2px 6px rgba(20, 30, 40, .12);
  min-height: 320px;
}
.board__empty {
  grid-column: 1 / -1; margin: 3rem auto; max-width: 30rem; text-align: center;
  color: #e9f5dc; font-size: 1.05rem;
}

.note {
  position: relative;
  display: flex; flex-direction: column; gap: .35rem;
  min-height: 190px;
  padding: 22px 16px 14px;
  color: #2b2a22;
  background-color: var(--paper-cream);
  border-radius: 2px 2px 6px 2px;
  /* Paper: lit from above, lifting slightly at the bottom corners. */
  box-shadow: 0 1px 1px rgba(0, 0, 0, .18), 0 10px 16px -8px rgba(0, 0, 0, .55);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 30%,
                                    rgba(0, 0, 0, 0) 85%, rgba(0, 0, 0, .05));
  transition: transform .35s ease, opacity .35s ease;
}
.note--yellow { background-color: var(--paper-yellow); }
.note--cream  { background-color: var(--paper-cream); }
.note--green  { background-color: var(--paper-green); }
.note--orange { background-color: var(--paper-orange); }
.note--blue   { background-color: var(--paper-blue); }

.note--tilt-0 { transform: rotate(-1.6deg); }
.note--tilt-1 { transform: rotate(1.2deg); margin-top: 8px; }
.note--tilt-2 { transform: rotate(-.5deg); margin-top: 3px; }
.note--tilt-3 { transform: rotate(1.8deg); }
.note--tilt-4 { transform: rotate(.4deg); margin-top: 10px; }

/* A pushpin: a coloured head with a highlight and a shadow on the paper. */
.note__pin {
  position: absolute; top: 7px; left: 50%; width: 15px; height: 15px; margin-left: -7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f6a19a 0 18%, #c8382e 45%, #8f1f18 100%);
  box-shadow: 1px 3px 3px rgba(0, 0, 0, .35);
}
.note--green .note__pin, .note--blue .note__pin {
  background: radial-gradient(circle at 35% 30%, #fff1a8 0 18%, #e0a51c 45%, #9a6b12 100%);
}

.note__head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem;
  flex-wrap: wrap; font-size: .72rem; }
.note__type { text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: #5d5a45; }
.note__due { color: #5d5a45; white-space: nowrap; }
.note__late { display: inline-block; margin-left: .2rem; padding: 0 .4rem; border-radius: 999px;
  background: rgba(180, 68, 60, .14); color: #8f2a22; font-weight: 700; }

.note__who {
  /* A 44px tap target, with the name centred in it rather than sitting on
     top of an empty band. */
  display: inline-flex; align-items: center; align-self: flex-start;
  padding: .15rem 0; min-height: 44px; line-height: 1.25;
  font-size: 1.12rem; font-weight: 700; color: #16231a; text-decoration: none;
  overflow-wrap: anywhere;
}
a.note__who { text-decoration: underline; text-decoration-color: rgba(8, 92, 38, .35);
  text-underline-offset: 3px; }
a.note__who:hover { color: var(--board); text-decoration-color: var(--board); }
.note__who--none { color: #77735c; font-weight: 600; font-style: italic; font-size: .98rem; }

.note__title { margin: 0; font-size: .97rem; line-height: 1.4; overflow-wrap: anywhere; }
.note__text  { margin: 0; font-size: .86rem; line-height: 1.45; color: #46432f; overflow-wrap: anywhere; }
.note__more { font-size: .86rem; line-height: 1.45; color: #46432f; overflow-wrap: anywhere; }
.note__more > summary { cursor: pointer; list-style: none; min-height: 44px; }
.note__more > summary::-webkit-details-marker { display: none; }
.note__more-link { font-weight: 700; color: var(--board); text-decoration: underline; }
.note__more[open] > summary { display: none; }
.note__more p { margin: 0; }

.note__reach { list-style: none; margin: .1rem 0 0; padding: 0; }
.note__link {
  display: flex; align-items: center; gap: .45rem; min-height: 44px;
  font-size: .9rem; font-weight: 600; color: #134a24; text-decoration: none;
  overflow-wrap: anywhere;
}
.note__link span { font-size: 1.05rem; }
.note__link:hover { text-decoration: underline; }
.note__permit { font-size: .82rem; color: #134a24; min-height: 32px; display: inline-flex; align-items: center; }
.note__owner { margin: 0; font-size: .78rem; color: #5d5a45; }

.note__done { margin-top: auto; padding-top: .5rem; }
.note__done-btn {
  width: 100%; min-height: 44px; cursor: pointer;
  border: 1.5px solid rgba(6, 74, 49, .45); border-radius: 6px;
  background: rgba(255, 255, 255, .55); color: var(--board-edge);
  font: inherit; font-size: .95rem; font-weight: 700;
}
.note__done-btn:hover, .note__done-btn:focus-visible { background: var(--board-glow); border-color: var(--board-edge); }
.note__done-btn:disabled { background: var(--board-glow); cursor: default; }

/* Lifted off the board once the server has recorded it -- a small motion. */
.note--leaving { opacity: 0; transform: translateY(-16px) rotate(5deg) scale(.96); pointer-events: none; }

.board-foot { margin-top: .9rem; }

@media (prefers-reduced-motion: reduce) {
  .note { transition: none; }
}

@media (max-width: 600px) {
  .board { grid-template-columns: 1fr; gap: 22px; padding: 22px 16px 26px; border-width: 7px; }
  .note { min-height: 0; }
  /* Gentler on a narrow screen, where a tilted note would reach the frame. */
  .note--tilt-0 { transform: rotate(-.8deg); }
  .note--tilt-1 { transform: rotate(.6deg); margin-top: 0; }
  .note--tilt-2 { transform: rotate(-.3deg); margin-top: 0; }
  .note--tilt-3 { transform: rotate(.9deg); }
  .note--tilt-4 { transform: rotate(.2deg); margin-top: 0; }
  .board-new__grid { grid-template-columns: 1fr; }
  .board-new__toggle { width: 100%; justify-content: center; }
}
.board-welcome { margin-bottom: 1rem; }
.note__records { margin: .3rem 0 0; font-size: .72rem; line-height: 1.3; color: #5d5a45; text-align: center; overflow-wrap: anywhere; }
/* Done opens the notes window on the note itself, then Log it saves both. */
.note__finish { margin-top: auto; padding-top: .5rem; }
.note__finish > summary { list-style: none; display: flex; align-items: center; justify-content: center; }
.note__finish > summary::-webkit-details-marker { display: none; }
.note__finish[open] > summary { display: none; }
.note__finish .note__done { margin-top: 0; padding-top: 0; }
.note__notes-label { display: block; margin: 0 0 .25rem; font-size: .78rem; font-weight: 700; color: #46432f; }
.note__notes { width: 100%; min-height: 96px; padding: .45rem .55rem; resize: vertical;
  font: inherit; font-size: .9rem; line-height: 1.4; color: #2b2a22;
  background: rgba(255, 255, 255, .7); border: 1px solid rgba(6, 74, 49, .35); border-radius: 4px; }
.note__notes:focus { outline: 2px solid var(--board-glow); outline-offset: 1px; background: #fff; }
.note__log-btn { margin-top: .45rem; background: var(--board-edge); color: #fff; border-color: var(--board-edge); }
.note__log-btn:hover, .note__log-btn:focus-visible { background: var(--board); color: #fff; }
.nowrap { white-space: nowrap; }

/* The DOT sheet's tick boxes (2026-10-19): a grid of 44px rows, so they can be
   ticked with gloves on, folded away until there is something to tick. */
.dotitems__panel { margin-top: .6rem; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .2rem .7rem; }
.dotitems__panel > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.dotitems { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 .8rem; padding-bottom: .5rem; }
.dotitems__group { grid-column: 1 / -1; margin: .4rem 0 0; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.dotitems__item { display: flex; align-items: center; gap: .55rem; min-height: 44px; cursor: pointer;
  margin: 0; font-size: .9rem; text-transform: none; letter-spacing: 0; color: var(--ink); }
.dotitems__item input { width: 22px; height: 22px; flex: 0 0 auto; margin: 0; }
.dotitems__end { grid-column: 1 / -1; height: .3rem; }

/* Contacts and Permits fold up (2026-10-20). The header row is the section's
   own link plus an arrow; the arrow is what folds, and gets a full 44px tap
   area of its own so it is not a near-miss for the link beside it. */
.sidenav__foldhead { display: flex; align-items: center; list-style: none; cursor: pointer; }
.sidenav__foldhead::-webkit-details-marker { display: none; }
.sidenav__foldhead::marker { content: ""; }
.sidenav__foldhead > .sidenav__item { flex: 1; min-width: 0; }
.sidenav__chev { flex: 0 0 44px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); color: #9fb0a5; }
.sidenav__chev::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.sidenav__fold[open] > .sidenav__foldhead .sidenav__chev::before { transform: rotate(45deg); }
.sidenav__foldhead:hover .sidenav__chev { background: rgba(255,255,255,.06); color: #fff; }

/* Monday or Friday reading (2026-10-20): two big choices, not a dropdown. */
.mileagekind { border: 0; padding: 0; margin: 0 0 .6rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.mileagekind__option { display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 .8rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer;
  font-size: .9rem; text-transform: none; letter-spacing: 0; color: var(--ink); margin: 0; }
.mileagekind__option input { width: 20px; height: 20px; margin: 0; }
.mileagekind__option:has(input:checked) { border-color: var(--accent); background: rgba(46,125,80,.08); font-weight: 600; }
.estimate { font-style: italic; color: var(--ink-soft); }

/* Possible duplicates read off a permit, on the Create Contact screen. The
   contact name is the action -- "open that one instead" -- so it gets a
   comfortable target rather than a 20px line of text, which is what it was
   when first measured at phone width. */
.hints { list-style: none; margin: .5rem 0 0; padding: 0; }
.hints li {
  padding: .6rem 0; border-top: 1px solid var(--line-soft);
  display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .5rem;
}
.hints li:first-child { border-top: 0; }
.hints a { display: inline-flex; align-items: center; min-height: 44px; }

/* Leads. Dave, 2026-10-21: "a lead is when they ask me for a quote", and the
   spec puts a number on the entry -- 10 to 20 seconds. Four fields on one row
   where there is width for it, and each decision on a row of its own so the
   date and the final price sit beside the button rather than above it. */
.leadform__row {
  display: grid; gap: .6rem 1rem; margin-bottom: .8rem;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.leadlist { list-style: none; margin: 0; padding: 0; }
.leadlist__item { padding: .9rem 0; border-top: 1px solid var(--line-soft); }
.leadlist__item:first-child { border-top: 0; }
.leadlist__head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.leadactions {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
  margin-top: .3rem;
}
.leadactions input[type="date"] { width: auto; min-width: 150px; }
.leadactions input[type="text"] { width: auto; min-width: 120px; }
/* Open is the one that wants attention; a decided lead is quiet. */
.pill--open { background: var(--accent-soft); color: var(--accent-dark); }
.pill--won  { background: #e8eef6; color: var(--info); }
.pill--lost { background: var(--line-soft); color: var(--ink-soft); }

/* Report Center, sections three and four. Added 2026-10-26 with the screen
   that uses them; everything here is scoped to those two blocks so no other
   page changes.

   The three focus lists sit side by side where there is width and stack on a
   phone. Dave's spec: "Keep this section small" -- three short columns read
   as a shortlist, the same three stacked read as a long page. */
.focus {
  display: grid; gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.focus__list h3 {
  margin: 0 0 .4rem; font-size: .95rem; letter-spacing: .01em;
}
/* A builder name is the thing Dave taps on a phone to open the summary, so
   it gets a real target rather than a line of text's worth of height. */
.focus .leadlist__item .strong-link {
  display: inline-flex; align-items: center; min-height: 44px;
}

/* The assumptions panel. A disclosure rather than a card, because it is the
   working behind the figures above it and should not compete with them --
   but it still has to look like a panel once it is open. */
.assumptions {
  margin-top: 1rem; border: 1px solid var(--line-soft); border-radius: 10px;
  padding: .7rem .9rem; background: var(--page);
}
.assumptions > summary {
  cursor: pointer; font-weight: 600; font-size: .9rem;
  display: inline-flex; align-items: center; min-height: 44px;
}
.assumptions[open] > summary { margin-bottom: .6rem; }
/* ---------- Leads Board ----------
   Dave, 2026-10-26: "a solid dark-green background with realistic, colorful
   INDEX CARDS ... NOT sticky notes ... traditional 3x5 office index cards."
   The Task Board's green board, so the two belong to one CRM, but the paper
   is different: square-cornered card stock lying straight, a red rule under
   the heading line and faint blue ruling below it, the 5:3 shape of a real
   index card, and one colour of card stock per kind of job. The type is also
   written on every card -- colour is never the only way to tell. */

:root {
  --card-blue:   #d7e8f6;
  --card-cream:  #faf3dd;
  --card-green:  #dcefc8;
  --card-yellow: #fbf1ab;
  --card-orange: #fddcb5;
  --card-purple: #e5d9f3;
  --card-gray:   #e3e6e8;
  --card-white:  #fdfdfb;
  --card-rule:   rgba(200, 70, 70, .55);   /* the red heading rule */
  --card-line:   rgba(60, 100, 160, .16);  /* the blue writing lines */
}

.leadboard-head { margin-bottom: .4rem; }

.leadbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .6rem 1rem; margin: 0 0 .8rem; }
.leadtabs { display: inline-flex; border: 1px solid var(--board-edge); border-radius: 999px; overflow: hidden; }
.leadtabs__tab { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 1.1rem;
  color: var(--board-edge); font-weight: 600; text-decoration: none; background: #fff; }
.leadtabs__tab + .leadtabs__tab { border-left: 1px solid var(--board-edge); }
.leadtabs__tab.is-active { background: var(--board-edge); color: #fff; }
.leadtabs__count { font-size: .78rem; font-weight: 700; padding: 0 .45rem; border-radius: 999px;
  background: rgba(8, 92, 38, .12); }
.leadtabs__tab.is-active .leadtabs__count { background: rgba(255, 255, 255, .2); }
.leadsearch { display: flex; align-items: center; gap: .4rem; }
.leadsearch input { margin: 0; min-height: 44px; width: 14rem; max-width: 100%; }
.leadsearch .btn { min-height: 44px; }

.leadboard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 26px 24px;
  align-items: start;
  padding: 30px 28px 36px;
  background: var(--board);
  border: 10px solid var(--board-edge);
  border-radius: 14px;
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, .35), 0 2px 6px rgba(20, 30, 40, .12);
  min-height: 300px;
}
.leadboard--single { display: block; padding: 26px; }
.leadboard-foot { margin-top: .6rem; }

.leadcard {
  --paper: var(--card-white);
  position: relative;
  display: flex; flex-direction: column; gap: .3rem;
  aspect-ratio: 5 / 3;
  padding: 10px 16px 12px;
  color: #26251f;
  border-radius: 3px;
  background-color: var(--paper);
  /* Blue writing lines every 24px, drawn rather than imaged so the card
     stays crisp at any size. The red rule is the heading's own border, so a
     type that wraps onto two lines pushes it down instead of being struck
     through; the heading's paper-coloured background hides the lines behind
     it. */
  background-image:
    repeating-linear-gradient(180deg, transparent 0, transparent 23px, var(--card-line) 23px, var(--card-line) 24px);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .22), 0 7px 14px -6px rgba(0, 0, 0, .55);
}
.leadcard--blue   { --paper: var(--card-blue); }
.leadcard--cream  { --paper: var(--card-cream); }
.leadcard--green  { --paper: var(--card-green); }
.leadcard--yellow { --paper: var(--card-yellow); }
.leadcard--orange { --paper: var(--card-orange); }
.leadcard--purple { --paper: var(--card-purple); }
.leadcard--gray   { --paper: var(--card-gray); }
.leadcard--untyped { --paper: var(--card-white); outline: 2px dashed rgba(133, 194, 38, .9); outline-offset: -6px; }

.leadcard__head { display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  margin: -10px -16px 0; padding: 9px 16px 7px; min-height: 39px; font-size: .72rem;
  background: var(--paper); border-bottom: 2px solid var(--card-rule); border-radius: 3px 3px 0 0; }
.leadcard--sheet .leadcard__head { margin: -12px -26px 0; padding: 11px 26px 8px; }
.leadcard__type { text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: #4f4c3d;
  overflow-wrap: anywhere; }
.leadcard--untyped .leadcard__type { color: #8a4d00; }
.leadcard__status { flex: 0 0 auto; padding: .05rem .55rem; border-radius: 999px; font-weight: 700;
  letter-spacing: .03em; border: 1.5px solid currentColor; }
.leadcard__status--open { color: #0b6b2e; }
.leadcard__status--won  { color: #fff; background: #0b6b2e; border-color: #0b6b2e; }
.leadcard__status--lost { color: #7a2d25; }

.leadcard__who { display: inline-flex; align-items: center; align-self: flex-start; min-height: 44px;
  margin-top: 4px; font-size: 1.15rem; font-weight: 700; line-height: 1.2; color: #14221a;
  text-decoration: underline; text-decoration-color: rgba(8, 92, 38, .35); text-underline-offset: 3px;
  overflow-wrap: anywhere; }
.leadcard__who:hover { color: var(--board); text-decoration-color: var(--board); }
.leadcard__who--none { color: #77735c; font-style: italic; text-decoration: none; font-size: 1rem; }

.leadcard__facts { margin: 0; display: grid; gap: 0; }
.leadcard__facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem;
  min-height: 24px; line-height: 24px; }
.leadcard__facts dt { font-size: .78rem; color: #5d5a48; }
.leadcard__facts dd { margin: 0; font-size: .9rem; text-align: right; }
.leadcard__money { font-weight: 700; font-size: 1rem; }
.leadcard__unknown { font-style: italic; font-weight: 500; color: #77735c; }

.leadcard__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .3rem .8rem; padding-top: .2rem; }
.leadcard__call { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px;
  font-weight: 600; font-size: .9rem; color: #134a24; text-decoration: none; }
.leadcard__call:hover { text-decoration: underline; }
.leadcard__open { display: inline-flex; align-items: center; min-height: 44px; margin-left: auto;
  padding: 0 1rem; border-radius: 6px; background: var(--board-edge); color: #fff;
  font-weight: 700; font-size: .9rem; text-decoration: none; }
.leadcard__open:hover { background: var(--board); color: #fff; }

/* The card opened: the same card stock, made big enough to work on. */
.leadcard--sheet { aspect-ratio: auto; max-width: 860px; margin: 0 auto; padding: 12px 26px 26px; gap: .4rem; }
.leadsheet__line { margin: 0; font-size: .9rem; color: #46432f; }
.leadsheet__section { margin-top: 1.1rem; }
.leadsheet__h { margin: 0 0 .4rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: #4f4c3d; }
.leadquote { width: 100%; border-collapse: collapse; font-size: .95rem; }
.leadquote th, .leadquote td { padding: .35rem 0; border-bottom: 1px solid var(--card-line); text-align: left; vertical-align: top; }
.leadquote td.num { text-align: right; white-space: nowrap; padding-left: 1rem; font-variant-numeric: tabular-nums; }
.leadquote th { font-weight: 500; }
.leadquote__base th, .leadquote__base td { font-weight: 700; }
.leadquote tfoot th, .leadquote tfoot td { font-weight: 600; }
.leadquote__max th, .leadquote__max td { border-bottom: 2px solid rgba(0, 0, 0, .18); }
.leadquote__final th, .leadquote__final td { font-size: 1.1rem; font-weight: 800; color: #0b5a27; border-bottom: 0; }
.leadquote__hint { display: block; font-size: .76rem; font-weight: 400; color: #6a6650; }
.leadquote__option.is-declined th, .leadquote__option.is-declined td { color: #77735c; }
.leadquote__option.is-declined td { text-decoration: line-through; }
.leadquote__mark { margin-left: .4rem; padding: 0 .45rem; border-radius: 999px; font-size: .72rem; font-weight: 700;
  background: rgba(0, 0, 0, .08); color: #5d5a48; }
.leadquote__mark--yes { background: #0b6b2e; color: #fff; }
.leadquote__edit > summary { cursor: pointer; list-style: none; min-height: 32px; }
.leadquote__edit > summary::-webkit-details-marker { display: none; }
.leadquote__pencil { margin-left: .35rem; font-size: .76rem; font-weight: 700; color: var(--board); text-decoration: underline; }
.leadquote__form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; margin: .4rem 0; }
.leadquote__form input { margin: 0; min-height: 44px; background: #fff; }
.leadquote__form input[name=description] { flex: 1 1 14rem; }
.leadquote__form input[name=price] { flex: 0 1 8rem; }
.leadquote__form .btn { min-height: 44px; }
.leadquote__form--new > div { display: flex; flex-direction: column; }
.leadquote__form--new > div:first-child { flex: 1 1 14rem; }
.leadquote__form--new > div:nth-child(2) { flex: 0 1 9rem; }
.leadquote__remove { margin: 0 0 .4rem; }
.leadsheet__add { margin-top: .6rem; }
.leadsheet__add > summary { list-style: none; display: inline-flex; min-height: 44px; align-items: center; }
.leadsheet__add > summary::-webkit-details-marker { display: none; }
.leadsheet__removed { margin-top: .5rem; font-size: .88rem; color: #5d5a48; }
.leadsheet__removed > summary { cursor: pointer; min-height: 36px; }
.leadsheet__removed form.inline { display: inline; }
.leadsheet__grid { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem 1rem; }
.leadsheet__wide { grid-column: 1 / -1; }
.leadsheet__details input, .leadsheet__details select, .leadsheet__details textarea,
.wonform input, .lostform input { background: #fff; min-height: 44px; }
.leadsheet__details .btn, .wonform .btn, .lostform .btn { min-height: 44px; }
.leadsheet__decide { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-start; }
.leaddecide > summary { list-style: none; display: inline-flex; align-items: center; min-height: 44px; }
.leaddecide > summary::-webkit-details-marker { display: none; }
.leaddecide[open] { flex: 1 1 100%; }
.wonform, .lostform { margin-top: .6rem; padding: .9rem 1rem; background: rgba(255, 255, 255, .7);
  border: 1px solid rgba(0, 0, 0, .12); border-radius: 6px; }
.wonform__base { margin: 0 0 .4rem; }
.wonform__options { list-style: none; margin: 0 0 .6rem; padding: 0; }
.wonform__opt { display: flex; align-items: center; gap: .6rem; min-height: 44px; margin: 0;
  font-size: .95rem; text-transform: none; letter-spacing: 0; color: var(--ink); cursor: pointer;
  border-bottom: 1px solid var(--card-line); }
.wonform__opt input { width: 22px; height: 22px; min-height: 0; margin: 0; flex: 0 0 auto; }
.wonform__name { flex: 1; }
.wonform__price { font-variant-numeric: tabular-nums; white-space: nowrap; }
.wonform__adjust { margin: .3rem 0 .6rem; }
.wonform__adjust > summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; }
.wonform__total { font-size: 1.15rem; font-weight: 800; color: #0b5a27; margin: .6rem 0; }
.leadsheet__archive { margin-top: 1rem; display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }

@media (max-width: 640px) {
  .leadcard--sheet .leadcard__head { margin: -10px -14px 0; padding: 9px 14px 7px; }
  .leadboard { padding: 16px 12px 20px; border-width: 6px; grid-template-columns: 1fr; gap: 18px; }
  .leadboard--single { padding: 10px; }
  .leadcard { aspect-ratio: auto; min-height: 190px; }
  .leadcard--sheet { padding: 10px 14px 18px; }
  .leadbar { flex-direction: column; align-items: stretch; }
  .leadtabs { align-self: flex-start; }
  .leadsearch input { flex: 1; width: auto; }
  .leadsheet__grid { grid-template-columns: 1fr; }
}

/* ---------- Fleet Whiteboard ----------
   Dave, 2026-10-28: a real shop whiteboard with Expo markers, the way the
   Task Board is sticky notes and the Leads Board is index cards. White
   board, a tray shadow, a faint marker-wipe grain, and handwriting that
   stays legible -- "Do not overdo the handwritten appearance to the point
   that the information becomes difficult to understand."

   Every marker colour is paired with a word in the markup. Colour is never
   the only signal, and these inks all clear 4.5:1 on white. */
.wb {
  --wb-black:  #22272b;
  --wb-blue:   #1b5fa8;
  --wb-green:  #1d7a45;
  --wb-orange: #a65a07;
  --wb-red:    #b3261e;
  --wb-grey:   #6b757e;
  --wb-board:  #fdfdfb;

  background: var(--wb-board);
  /* An aluminium frame, not a hairline: against a near-white page a 1px
     grey border read as a card and the board did not read as a board. */
  border: 7px solid #c3c9cf;
  border-bottom-width: 16px;
  border-radius: 8px;
  /* The frame catches light at the top and the tray shades below it, so the
     bottom edge reads as the marker ledge it is. */
  box-shadow:
    0 2px 0 rgba(255, 255, 255, .85) inset,
    0 -10px 14px -12px rgba(20, 30, 40, .45) inset,
    0 10px 20px -12px rgba(20, 30, 40, .4);
  padding: 1.2rem 1.3rem 1.5rem;
  /* The ghost of everything wiped off it before. */
  /* The ghost of everything wiped off it before: broad diagonal smears,
     far too faint to compete with the writing. */
  background-image:
    linear-gradient(104deg, rgba(27, 95, 168, .035) 0 9%, transparent 9% 24%),
    linear-gradient(97deg, rgba(29, 122, 69, .028) 0 12%, transparent 12% 33%),
    linear-gradient(91deg, rgba(179, 38, 30, .02) 0 6%, transparent 6% 47%);
}
.wb__title {
  font-family: "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive;
  font-size: 1.9rem; letter-spacing: .02em; margin: 0;
  color: var(--wb-black); transform: rotate(-.5deg);
}
.wb__sub { margin: .1rem 0 0; color: var(--wb-grey); font-size: .9rem; }
.wb__head {
  display: flex; flex-wrap: wrap; gap: .8rem;
  align-items: flex-end; justify-content: space-between;
  border-bottom: 2px solid var(--wb-black);
  /* A hand-drawn rule: solid in the middle, tailing off at the ends. */
  border-image: linear-gradient(90deg, transparent, var(--wb-black) 12%,
                                var(--wb-black) 88%, transparent) 1;
  padding-bottom: .7rem; margin-bottom: .9rem;
}
.wb__headlinks { display: flex; flex-wrap: wrap; gap: .4rem; }

.wb__tally {
  display: grid; gap: .7rem; margin-bottom: .5rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.wb__tallyitem {
  text-align: center; padding: .5rem .3rem;
  border: 1px dashed #d4dade; border-radius: 6px;
}
.wb__tallynum {
  display: block; font-size: 1.8rem; font-weight: 700;
  font-family: "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive;
}
.wb__tallylabel {
  font-size: .76rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--wb-grey);
}
.wb__caveat {
  font-size: .82rem; color: var(--wb-grey); margin: .2rem 0 1rem;
  border-left: 3px solid #e0e5e9; padding-left: .6rem;
}

.wb__truck { padding: .9rem 0 .8rem; border-top: 1px solid #e4e9ec; }
.wb__truck:first-of-type { border-top: 0; }
.wb__truckhead {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem;
}
.wb__name {
  font-family: "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive;
  font-size: 1.45rem; font-weight: 700; text-decoration: none;
  color: var(--wb-black);
  display: inline-flex; align-items: center; min-height: 44px;
}
.wb__name:hover { text-decoration: underline; }
.wb__unit { color: var(--wb-grey); font-size: .85rem; }

.wb__mileage {
  margin: 0 0 .3rem; font-size: 1.15rem; font-weight: 600;
  font-family: "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive;
}
.wb__when { color: var(--wb-grey); font-size: .8rem; font-weight: 400;
            font-family: inherit; }
.wb__label { font-weight: 600; color: var(--wb-black); font-size: .88rem; }
.wb__note { font-size: .82rem; margin: .2rem 0 .5rem; }
.wb__dot { margin: .4rem 0 .5rem; font-size: .95rem; }

.wb__services { list-style: none; margin: .5rem 0; padding: 0; }
.wb__service {
  display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: baseline;
  padding: .35rem 0; border-top: 1px dotted #e6ebee; font-size: .9rem;
}
.wb__service:first-child { border-top: 0; }
.wb__service .wb__label { min-width: 9.5rem; }

.wb__pill {
  font-size: .72rem; font-weight: 700; letter-spacing: .03em;
  padding: .12rem .45rem; border-radius: 999px; white-space: nowrap;
}
.wb__pill--green  { background: #e4f3ea; color: var(--wb-green); }
.wb__pill--orange { background: #fdf0e2; color: var(--wb-orange); }
.wb__pill--red    { background: #fdeceb; color: var(--wb-red); }
.wb__pill--grey   { background: #eef1f3; color: var(--wb-grey); }

.wb__ink--black  { color: var(--wb-black); }
.wb__ink--blue   { color: var(--wb-blue); }
.wb__ink--green  { color: var(--wb-green); }
.wb__ink--orange { color: var(--wb-orange); }
.wb__ink--red    { color: var(--wb-red); }
.wb__ink--grey   { color: var(--wb-grey); }

.wb__entry { margin: .4rem 0; }
/* Dave, 2026-10-29: "i dont see a way to record a dot inspection". The
   form was here all along, shut inside this <details>, whose summary was
   blue text at .82rem and read as a caption rather than a control. Given
   a border and a background it reads as the button it has always been. */
.wb__entry > summary {
  cursor: pointer; font-size: .82rem; color: var(--wb-blue);
  display: inline-flex; align-items: center; gap: .35rem;
  min-height: 44px; padding: 0 .8rem;
  border: 1px solid var(--wb-blue); border-radius: 6px;
  background: rgba(255, 255, 255, .72); font-weight: 600;
}
.wb__entry > summary:hover { background: #fff; }
.wb__entry[open] > summary { margin-bottom: .35rem; }
.wb__form {
  display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center;
  margin: .3rem 0; font-size: .85rem;
}
.wb__form input, .wb__form select { min-height: 44px; }
.wb__hint { font-size: .78rem; color: var(--wb-grey); margin: .2rem 0 0; }
.wb__more { font-size: .82rem; margin: .5rem 0 0; }
/* Tapped standing next to a truck, so they get a real target. */
.wb__more a { display: inline-flex; align-items: center; min-height: 44px; }

@media (max-width: 640px) {
  /* Standing next to a truck: nothing shrinks below readable, and the
     service lines stack rather than scroll sideways. The frame thins so the
     board keeps the width it needs for the writing. */
  .wb {
    padding: .9rem .8rem 1.1rem;
    border-width: 4px; border-bottom-width: 11px;
  }
  .wb__title { font-size: 1.6rem; }
  .wb__service { flex-direction: column; align-items: flex-start; gap: .15rem; }
  .wb__service .wb__label { min-width: 0; }
  .wb__form { flex-direction: column; align-items: stretch; }
  .wb__form input, .wb__form select { width: 100%; }
}

/* ---------- Fleet Whiteboard, page one ----------
   Dave, 2026-10-29: "it's more of in width rather than vertical... I just
   wanna be able to quickly see what vehicle has how many miles."

   So the twelve trucks are a grid of tiles, not a column of sections. Name
   and mileage, nothing else, and the whole tile is the link. */
.wb__grid {
  display: grid; gap: .8rem; margin: .4rem 0 1rem;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
}
.wb__tile {
  display: flex; flex-direction: column; gap: .1rem;
  padding: .75rem .85rem .8rem;
  border: 1px solid #e0e5e9; border-radius: 6px;
  background: rgba(255, 255, 255, .72);
  text-decoration: none;
  /* A whole tile is the tap target, so it clears 44px on its own. */
  min-height: 100px;
}
.wb__tile:hover {
  border-color: var(--wb-blue);
  box-shadow: 0 2px 10px -6px rgba(20, 30, 40, .4);
}
.wb__tilename {
  font-family: "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive;
  font-size: 1.12rem; font-weight: 700; line-height: 1.2;
}
.wb__tilemiles {
  font-family: "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive;
  font-size: 1.5rem; font-weight: 700; line-height: 1.15;
}
.wb__tilewhen { font-size: .74rem; color: var(--wb-grey); }

/* Page two is one vehicle, so it reads as a column and wants no grid. */
.wb--one .wb__services { margin-top: .2rem; }
.wb__back { margin: 0 0 .2rem; font-size: .82rem; }
/* The most-tapped link on page two, pressed standing next to a truck. */
.wb__back a { display: inline-flex; align-items: center; min-height: 44px; }
.wb__h2 {
  font-family: "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive;
  font-size: 1.15rem; margin: 1rem 0 .2rem; color: var(--wb-black);
}

@media (max-width: 640px) {
  /* Two across on a phone: a name and a number still fit, and twelve
     trucks stay one short scroll rather than twelve screens. */
  .wb__grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .55rem; }
  .wb__tile { padding: .6rem .65rem; min-height: 92px; }
  .wb__tilename { font-size: 1rem; }
  .wb__tilemiles { font-size: 1.3rem; }
}

/* Library page: the tools moved off the sidebar sit above the reference tiles. */
.library__heading { font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); margin: 1.1rem 0 .5rem; }
.library__tools { margin-bottom: .4rem; }

/* The Vehicle card as an edit form (Dave, 2026-11-09: "make all those items
   editable"). The row layout of the read-only table is kept on purpose --
   he recognised the card by its shape, and an edit box per row keeps that
   shape rather than replacing it with a stack of fields. */
.table--form td { width: 100%; }
.table--form th { white-space: nowrap; vertical-align: middle; }
.table--form td input[type="text"],
.table--form td input[type="number"],
.table--form td input[type="date"],
.table--form td textarea {
  width: 100%; max-width: 28rem; box-sizing: border-box;
}
.table--form td textarea { max-width: 36rem; resize: vertical; }
.table--form td .muted.tiny { display: block; margin-top: .2rem; }
/* Year / make / model share one row, as they do when read-only. */
.table--form .cell--trio { display: flex; gap: .4rem; flex-wrap: wrap; }
.table--form .cell--trio input { max-width: none; }
.table--form .cell--trio input[name="year"] { flex: 0 0 5.5rem; }
.table--form .cell--trio input[name="make"],
.table--form .cell--trio input[name="model"] { flex: 1 1 8rem; }
@media (max-width: 640px) {
  .table--form th, .table--form td { display: block; width: auto; }
  .table--form th { border-bottom: 0; padding-bottom: 0; }
}

/* Annual DOT standing, as an outline on the whiteboard tile.
   Dave, 2026-11-09: "if DOT is expired on a vehicle. a soft thin red barrier
   around the vehicle box on the white board should appear if it is current
   make the barrier green". Thin and soft: the tile's own 1px border, in a
   muted red or green, plus the faintest wash so the colour reads at a glance
   on a wall-mounted screen without shouting.

   Which tile gets which is decided in whiteboard.py (DOT_BORDERS). A truck
   with no DOT date on record, and one that needs no inspection, get neither
   colour -- see that comment for why.

   These sit AFTER .wb__tile:hover on purpose: hovering recolours the border
   blue, which would wipe the compliance colour out from under the cursor. */
.wb__tile--dot-overdue,
.wb__tile--dot-overdue:hover {
  border-color: #c47b76;
  background: rgba(196, 123, 118, .06);
}
.wb__tile--dot-current,
.wb__tile--dot-current:hover {
  border-color: #7aa98a;
  background: rgba(122, 169, 138, .06);
}
@media (prefers-contrast: more) {
  .wb__tile--dot-overdue, .wb__tile--dot-overdue:hover { border-color: #a3322a; }
  .wb__tile--dot-current, .wb__tile--dot-current:hover { border-color: #2f6b45; }
}

/* A table cell whose control belongs at the right-hand edge. */
.cell--right { text-align: right; white-space: nowrap; }


/* --- employee essentials ------------------------------------------------ */
.essentials { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); margin: 1rem 0 1.5rem; }
.essentials__card { border: 2px solid #d9e2da; border-radius: 14px; padding: 1.1rem; background: #fff; color: #5b675f; }
.essentials__card h2 { margin: 0 0 .3rem; font-size: 1.15rem; color: #064A31; }
.essentials__card p { margin: 0 0 .8rem; }
.essentials__soon { display: inline-block; padding: .2rem .6rem; border-radius: 99px; background: #eef1ee; font-size: .8rem; font-weight: 600; }
.sidebar__account { display: inline-block; margin: .25rem 0 .4rem; font-size: .8rem; color: inherit; opacity: .8; }
/* Printing switched off for this account. The print pages refuse on their own;
   this covers the browser's own Print on a page they may read. */
@media print { body.printing-off { display: none !important; } }

/* Company pages: divisions, registers, documents, essentials. */
.co-trail { font-size: .88rem; margin-bottom: .5rem; }
.co-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .7rem; }
.co-card { display: flex; flex-direction: column; gap: .25rem; padding: 1rem; margin-bottom: .6rem;
  min-height: 60px; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  border-left: 5px solid #85c226; color: var(--ink); text-decoration: none; }
.co-card:hover { border-color: #085c26; }
.co-card strong { color: #064a31; font-size: 1.05rem; }
.co-count { font-weight: 600; color: #085c26; }
.co-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.co-field--wide { grid-column: 1 / -1; }
.co-field input:not([type=checkbox]), .co-field select, .co-field textarea { width: 100%; }
.co-need { font-size: .75rem; color: var(--ink-soft); text-transform: none; }
.co-check { text-transform: none; letter-spacing: normal; font-size: .95rem; color: var(--ink); display: flex; align-items: center; gap: .5rem; min-height: 40px; font-weight: 400; }
.co-check input { width: auto; margin: 0; }
.co-people, .co-audience { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .9rem; margin: 0 0 1rem; }
.co-who { display: none; padding: 0 0 .5rem 1.8rem; }
.co-audience:has(input[value=branch]:checked) .co-who--branch,
.co-audience:has(input[value=division]:checked) .co-who--division,
.co-audience:has(input[value=role]:checked) .co-who--role,
.co-audience:has(input[value=employee]:checked) .co-who--employee { display: block; }
.co-filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .8rem; }
.co-filter input, .co-filter select { margin: 0; width: auto; }
.co-scroll { overflow-x: auto; }
.co-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .7rem; margin: 0; }
.co-facts dt { font-size: .8rem; color: var(--ink-soft); }
.co-facts dd { margin: 0; }
.co-said { white-space: pre-wrap; overflow-wrap: anywhere; }
.co-history { list-style: none; padding: 0; margin: 0; }
.co-history li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.co-big { min-height: 52px; font-size: 1.05rem; }
.co-print { border-top: 1px solid var(--line); padding: .6rem 0; break-inside: avoid; }
a.essentials__card { text-decoration: none; color: inherit; }
@media print { .co-trail, .co-filter { display: none; } }
.co-late { color: var(--danger); }
@media (max-width: 640px) {
  .co-filter label:not(.co-check) { flex-basis: 100%; margin: 0; }
  .co-filter input:not([type=checkbox]), .co-filter select { flex: 1 1 100%; }
}

/* What somebody may read and not change. The server refuses it as well. */
.readonly { border: 0; padding: 0; margin: 0; min-width: 0; }
span[href] { color: inherit; text-decoration: none; cursor: default; }
.readonly button, .readonly input[type=submit] { display: none; }
