/* Load board: header actions, posting forms, office map. Sits on top of the existing theme. */

.footer-bottom a[href="/admin/"] { color: #c9c2b8; }

.pin-map { height: 420px; border: 1px solid var(--line-strong); background: #efeae3; margin: .2rem 0 1rem; }
.pin-modes { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 .7rem; }
.pin-modes button {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
  padding: .7rem .9rem;
  font: 700 .72rem/1 var(--body);
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
}
.qform[data-board-form="load"] .pin-modes button[aria-pressed="true"] { border-color: #d01212; color: #7a1212; background: rgba(208, 18, 18, .10); }
.qform[data-board-form="truck"] .pin-modes button[aria-pressed="true"] { border-color: #a67c00; color: #6a4e00; background: rgba(200, 150, 0, .16); }
.pin-field { position: relative; }
.kc-suggest {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% - .2rem);
  background: #fffdfb;
  border: 1px solid var(--line-strong);
  box-shadow: 0 16px 40px rgba(36, 31, 27, .12);
}
.kc-suggest button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--text);
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: .75rem .9rem;
  cursor: pointer;
  font: 500 .95rem/1.35 var(--body);
}
.kc-suggest button:last-child { border-bottom: 0; }
.kc-suggest button:hover,
.kc-suggest button[aria-selected="true"] { background: rgba(255, 122, 26, .16); }
.map-note { color: var(--muted); font-size: .92rem; margin: 0 0 1rem; }
.kc-pin { background: none; border: 0; }
.kc-pin-dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #1a0a0a;
  font: 800 12px/1 var(--body);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #241f1b, 0 2px 8px rgba(36, 31, 27, .35);
}
.pac-container { z-index: 4000; background: #fffdfb; border: 1px solid rgba(36, 31, 27, .16); border-radius: 2px; font-family: Manrope, sans-serif; box-shadow: 0 16px 40px rgba(36, 31, 27, .12); }
.pac-item { border-top: 1px solid rgba(36, 31, 27, .08); color: #5c564e; padding: .45rem .7rem; cursor: pointer; }
.pac-item-query { color: #2a2622; }
.pac-item:hover, .pac-item-selected { background: rgba(255, 122, 26, .16); }
.leaflet-container { background: #efeae3; font-family: Manrope, sans-serif; }
.leaflet-bar a { background: #fffdfb; color: #2a2622; border-bottom-color: rgba(36, 31, 27, .12); }
.leaflet-bar a:hover { background: #f3eee7; }
.leaflet-control-attribution { background: rgba(247, 244, 239, .9) !important; color: #5c564e !important; }

body.admin-body { background: var(--bg); display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
body.admin-body .site-header { position: relative; inset: auto; height: auto; flex: none; }
.admin-app { margin-top: 0; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.gate { flex: 1; display: grid; place-items: center; padding: 2rem 1.25rem 4rem; }
.gate-card { width: min(460px, 100%); background: var(--graphite); border: 1px solid var(--line-strong); padding: clamp(1.5rem, 4vw, 2.4rem); }
.gate-card h1 { font-size: clamp(2rem, 5vw, 3rem); }
.gate-card p { color: var(--muted); }
.gate-card label { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.gate-card input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]) {
  display: block;
  width: 100%;
  margin: .45rem 0 1rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line-strong);
  padding: .9rem 1rem;
  font: 500 1rem/1.3 var(--body);
}
.gate-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gate-card #gate-err { display: block; min-height: 1.3em; color: var(--danger); font-weight: 700; }
#gate-code-step .btn { margin: .35rem .45rem 0 0; }
.workspace { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.workspace[hidden], .gate[hidden] { display: none !important; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem .8rem;
  align-items: flex-end;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #fffdfb;
}
.toolbar label { display: flex; flex-direction: column; gap: .28rem; font-size: .66rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.toolbar select, .toolbar input[type="date"] {
  background: #fffdfb;
  color: var(--text);
  border: 1px solid var(--line-strong);
  padding: .5rem .55rem;
  font: 600 .92rem/1.2 var(--body);
  letter-spacing: 0;
  text-transform: none;
  min-width: 8.5rem;
}
.toolbar .grow { margin-left: auto; display: flex; gap: .6rem; align-items: center; }
.counts { margin: 0; color: var(--muted); font-size: .88rem; }
.seed-note { margin: 0; padding: .55rem 1rem; background: #fff1e6; color: #6a3410; font-size: .88rem; border-bottom: 1px solid var(--line); }
.workspace-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 460px); }
.map-pane { position: relative; min-height: 0; background: #efeae3; }
#office-map, #company-map { position: absolute; inset: 0; }
.legend {
  position: absolute;
  z-index: 500;
  left: 12px;
  bottom: 28px;
  background: rgba(255, 253, 251, .94);
  border: 1px solid rgba(36, 31, 27, .16);
  padding: .75rem .9rem;
  max-width: min(320px, calc(100% - 24px));
}
.legend p { display: flex; align-items: center; gap: .65rem; margin: 0; font-size: .86rem; }
.legend p + p { margin-top: .45rem; }
.swatch { position: relative; width: 2.6rem; height: 8px; flex: none; }
.swatch::before { content: ""; position: absolute; left: 0; right: 0; top: 3px; border-top: 3px solid currentColor; }
.swatch::after, .swatch i { content: ""; position: absolute; top: 0; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.swatch::after { left: 0; }
.swatch i { right: 0; }
.swatch.load { color: #d01212; }
.swatch.truck { color: #a67c00; }
.map-banner {
  position: absolute;
  z-index: 500;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 24px));
  margin: 0;
  padding: .55rem .75rem;
  background: rgba(255, 253, 251, .94);
  border: 1px solid rgba(36, 31, 27, .16);
  color: #3a342e;
  font-size: .82rem;
  text-align: center;
}
.side { display: flex; flex-direction: column; min-height: 0; background: #fffdfb; border-left: 1px solid var(--line); }
.detail { padding: 1rem 1rem .8rem; border-bottom: 1px solid var(--line); overflow: auto; max-height: 52%; }
.detail h2 { font-size: 1.25rem; margin-bottom: .35rem; }
.detail-kicker { margin: 0 0 .35rem; font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.detail-phone { font-family: var(--display); font-size: 1.35rem; color: var(--text); text-decoration: none; }
.detail-email { color: var(--accent); word-break: break-word; }
.detail dl { display: grid; grid-template-columns: 7.2rem 1fr; gap: .35rem .6rem; margin: .8rem 0; }
.detail dt { color: var(--dim); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.detail dd { margin: 0; }
.detail-comments { white-space: pre-wrap; color: var(--text); }
.detail-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .6rem; }
.detail-actions .btn { padding: .7em .9em; font-size: .68rem; }
.pair-row { display: flex; gap: .45rem; margin-top: .7rem; }
.pair-row select { flex: 1; min-width: 0; background: #fffdfb; color: var(--text); border: 1px solid var(--line-strong); padding: .45rem; font: inherit; }
.post-list { overflow: auto; }
.post-group { margin: 0; padding: .85rem 1rem .3rem; color: var(--dim); font-size: .68rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.post-row {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: inherit;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: .8rem 1rem;
  cursor: pointer;
  font: inherit;
}
.post-row strong { display: block; font-size: .98rem; }
.post-row span { display: block; color: var(--muted); font-size: .86rem; }
.post-row.is-on { background: rgba(255, 122, 26, .08); box-shadow: inset 3px 0 0 var(--accent); }
.post-row.is-load.is-on { box-shadow: inset 3px 0 0 #d01212; }
.post-row.is-truck.is-on { box-shadow: inset 3px 0 0 #a67c00; }
.badge { display: inline-block; margin-top: .35rem; font-size: .66rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: .12rem .4rem; border: 1px solid var(--line-strong); }
.badge.matched { color: var(--accent); border-color: var(--accent); }
.badge.closed { color: var(--dim); }
.kind-load { color: #b01010; }
.kind-truck { color: #8a6800; }
.empty-note { color: var(--muted); padding: 1rem; }
.companies { border-bottom: 1px solid var(--line); background: #fffdfb; max-height: 22rem; flex: none; overflow: auto; }
.company-row .detail-phone { font-size: 1.15rem; }
.companies-head { padding: .8rem 1rem .2rem; }
.companies-head h2 { margin: 0 0 .35rem; font-size: .95rem; }
.approval-toggle { display: flex; gap: .45rem; align-items: flex-start; font-size: .82rem; letter-spacing: 0; text-transform: none; font-weight: 600; color: var(--text); }
.company-row { padding: .7rem 1rem; border-top: 1px solid var(--line); }
.company-row.is-locked { background: #fff6f4; box-shadow: inset 3px 0 0 var(--danger); }
.company-row strong, .company-row span { display: block; }
.company-row span { color: var(--muted); font-size: .82rem; }
.account-main { padding: calc(var(--chrome-h, var(--header-h)) + 1.5rem) 1.25rem 4rem; }
.account-grid { display: grid; grid-template-columns: minmax(260px, 520px); gap: 1rem; justify-content: center; align-items: start; }
#login-form, #signup-form { width: 100%; min-width: 0; }
.account-switch { margin: 1.15rem 0 0; color: var(--muted); font-size: .95rem; font-weight: 600; letter-spacing: 0; text-transform: none; }
.account-switch a { color: var(--text); font-weight: 700; text-decoration: underline; text-underline-offset: .16em; }
.account-switch a:hover { color: var(--accent-ink); }
#signup-form .pills { margin: .35rem 0 1.1rem; }
.signup-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.signup-checks { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; margin: .2rem 0 1rem; }
.gate-card .check { display: flex; align-items: center; gap: .55rem; margin: 0; padding: .7rem .75rem; border: 1px solid var(--line-strong); background: #fffdfb; font-size: .95rem; letter-spacing: 0; text-transform: none; font-weight: 600; }
.gate-card .check input { display: inline-block; width: 1.15rem; height: 1.15rem; margin: 0; flex: none; padding: 0; }
#signup-form textarea { width: 100%; margin: .45rem 0 1rem; background: var(--bg); color: var(--text); border: 1px solid var(--line-strong); padding: .9rem 1rem; font: 500 1rem/1.4 var(--body); }
.company-notes { white-space: pre-wrap; }
@media (max-width: 800px) {
  .account-grid { grid-template-columns: 1fr; }
  .signup-checks { grid-template-columns: 1fr; }
}
.account-grid[hidden], #login-form[hidden], #signup-form[hidden], #thanks[hidden], #verify-form[hidden], #carrier-fields[hidden], #lock-screen[hidden] { display: none !important; }
#lock-screen .lock-copy { color: var(--text); font-size: 1.05rem; line-height: 1.55; }
#lock-screen a { color: var(--accent); font-weight: 800; overflow-wrap: anywhere; }
.call-pick { border: 0; margin: .2rem 0 1rem; padding: 0; min-width: 0; }
.anytime-check { width: 100%; margin: .35rem 0 .75rem; }
#slot-wrap[hidden] { display: none !important; }
.call-pick legend { font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.slot-list { max-height: 22rem; overflow: auto; border: 1px solid var(--line); padding: .4rem .6rem .8rem; background: var(--bg); }
.call-slot.is-on { border-color: var(--accent); background: rgba(255, 122, 26, .16); }
.slot-list h2 { margin: 1rem 0 .4rem; font-size: 1rem; }
.call-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: .45rem; }
.call-slot { min-height: 48px; padding: .55rem .6rem; background: #fffdfb; color: var(--text); border: 1px solid var(--line-strong); font: 600 .82rem/1.3 var(--body); cursor: pointer; text-align: left; }
.call-slot:hover { border-color: var(--accent); }
.call-when { color: var(--text); font-weight: 700; }
.block-form { display: flex; flex-wrap: wrap; gap: .45rem; align-items: end; margin: .6rem 0; }
.block-form input, #slot-minutes { font: 600 .85rem/1.2 var(--body); letter-spacing: 0; text-transform: none; }
.account-main .gate-card { margin: 0 auto; }
.account-err { text-align: center; color: var(--danger); font-weight: 700; min-height: 1.4em; }
.dash { padding: calc(var(--chrome-h, var(--header-h)) + 1.25rem) 1.25rem 4rem; max-width: 1100px; margin: 0 auto; }
.dash-head, .dash-actions, .dash-row, .dash-row-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; }
.dash-h { margin: 0 0 .6rem; font-size: 1.1rem; }
.dash-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .8fr); gap: 1rem; align-items: start; }
.dash-list { border: 1px solid var(--line); background: #fffdfb; }
.dash-row { padding: .9rem 1rem; border-bottom: 1px solid var(--line); align-items: flex-start; }
.dash-row strong, .dash-row span { display: block; }
.dash-row span { color: var(--muted); font-size: .88rem; }
.profile-card h2 { font-size: 1.2rem; }
.route-miles { margin: .8rem 0; padding: .9rem 1rem; background: #fff7f0; border: 1px solid #f0c9a4; color: #6a3410; font-weight: 700; font-size: 1.05rem; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 800px) {
  .dash-layout { grid-template-columns: 1fr; }
  .companies { max-height: none; }
}

@media (max-width: 900px) {
  body.admin-body { display: block; height: auto; overflow: auto; }
  body.admin-body .site-header { position: sticky; top: 0; }
  .workspace-grid { grid-template-columns: 1fr; }
  .map-pane { min-height: 68vh; height: 68vh; }
  .side { border-left: 0; border-top: 1px solid var(--line); }
  .detail { max-height: none; }
  .toolbar .grow { margin-left: 0; width: 100%; justify-content: space-between; }
}
@media (max-width: 640px) {
  .pin-map { height: 300px; }
  .legend { bottom: 18px; }
}

.workspace-grid.side-hidden { grid-template-columns: minmax(0, 1fr); }
.workspace-grid.side-hidden .side { display: none; }

/* Admin directory: carriers and shippers */
.swatch.dir-carrier { color: #3b7ddd; }
.swatch.dir-shipper { color: #1f9d63; }
.dir-toolbar { position: relative; }
.dir-back { align-self: center; font-weight: 700; font-size: .9rem; color: var(--text); text-decoration: none; white-space: nowrap; }
.dir-back:hover { color: var(--accent-ink, var(--accent)); text-decoration: underline; }
.dir-toolbar input[type="search"], .dir-toolbar input[type="text"] {
  background: #fffdfb; color: var(--text); border: 1px solid var(--line-strong); padding: .5rem .55rem;
  font: 600 .92rem/1.2 var(--body); letter-spacing: 0; text-transform: none; min-width: 9rem; width: 11rem;
}
.dir-toolbar .dir-q input { width: 14rem; }
.dir-toolbar .grow .btn, .dir-more .btn { padding: .7em .9em; font-size: .68rem; }
.dir-more { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding-top: .3rem; }
.dir-more[hidden] { display: none !important; }
.dir-more code { background: #f3eee7; padding: .05rem .3rem; font-size: .8rem; }
.dir-file { cursor: pointer; }
.dir-help { margin: .2rem 0 .6rem; color: var(--muted); font-size: .85rem; letter-spacing: 0; text-transform: none; font-weight: 500; }
.dir-row .dir-match { color: var(--text); font-weight: 600; }
.dir-lanes { margin: .3rem 0 .8rem; padding-left: 1.1rem; }
.dir-lanes li { margin: .15rem 0; }
.dir-body .detail { max-height: 60%; }
.dir-editor { position: fixed; inset: 0; z-index: 3000; background: rgba(36, 31, 27, .45); display: flex; justify-content: center; align-items: flex-start; overflow: auto; padding: 2rem 1rem; }
.dir-editor[hidden] { display: none !important; }
body.dir-editing { overflow: hidden; }
.dir-editor-card { width: min(760px, 100%); background: #fffdfb; border: 1px solid var(--line-strong); box-shadow: 0 24px 60px rgba(36, 31, 27, .25); padding: 1.1rem 1.25rem 1.25rem; }
.dir-editor-head, .dir-editor-foot { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.dir-editor-head h2 { margin: 0; font-size: 1.35rem; }
.dir-editor-foot { justify-content: flex-start; margin-top: .6rem; }
.dir-set { border: 0; border-top: 1px solid var(--line); margin: 1rem 0 0; padding: .8rem 0 0; min-width: 0; }
.dir-set legend { padding: 0 .4rem 0 0; font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.dir-field { display: block; margin: 0 0 .65rem; font-size: .78rem; font-weight: 700; color: var(--muted); }
.dir-editor-card input[type="text"], .dir-editor-card input[type="number"], .dir-editor-card select, .dir-editor-card textarea {
  display: block; width: 100%; box-sizing: border-box; margin-top: .3rem; background: var(--bg); color: var(--text);
  border: 1px solid var(--line-strong); padding: .7rem .8rem; font: 500 1rem/1.3 var(--body);
}
.dir-editor-card input:focus, .dir-editor-card select:focus, .dir-editor-card textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dir-two, .dir-three { display: grid; gap: .55rem; grid-template-columns: 1fr 1fr; }
.dir-three { grid-template-columns: 1.3fr 1.2fr .9fr; }
.dir-addr, .dir-lane { border: 1px solid var(--line); padding: .6rem .7rem .7rem; margin: 0 0 .6rem; background: #fbf8f4; }
.dir-person { border: 1px solid var(--line); padding: .6rem .7rem .7rem; margin: 0 0 .6rem; background: #fbf8f4; }
.dir-person-head { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; margin-bottom: .35rem; }
.dir-person-kicker { font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0; }
.dir-person-phones { margin-top: .35rem; }
.dir-phone-row, .dir-email-row { display: grid; grid-template-columns: 1fr auto; gap: .45rem; align-items: center; margin-top: .35rem; }
.dir-phone-row input, .dir-email-row input { margin-top: 0 !important; }
.dir-person-emails { margin-top: .35rem; }
.dir-file-person { margin: 0 0 .7rem; padding: 0 0 .55rem; border-bottom: 1px solid var(--line); }
.dir-file-person:last-of-type { border-bottom: 0; padding-bottom: 0; margin-bottom: .4rem; }
.dir-file-title { color: var(--muted); font-weight: 600; }

.dir-addr .a-street { margin-top: 0; }
.dir-lane { display: grid; gap: .5rem; }
.dir-end { display: grid; grid-template-columns: 3rem 1.3fr 1.2fr .9fr; gap: .45rem; align-items: center; }
.dir-end input, .dir-end select { margin-top: 0 !important; }
.dir-end-label { font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.dir-remove { justify-self: start; background: none; border: 0; padding: .2rem 0; color: var(--danger); font-weight: 700; cursor: pointer; font-size: .85rem; }
.dir-small { padding: .6em .85em; font-size: .66rem; }
.dir-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .4rem; }
.dir-check { display: flex; align-items: center; gap: .5rem; padding: .55rem .65rem; border: 1px solid var(--line-strong); background: #fffdfb; font-size: .92rem; font-weight: 600; cursor: pointer; }
.dir-check input { width: 1.1rem; height: 1.1rem; margin: 0; }
.dir-err { color: var(--danger); font-weight: 700; min-height: 1.2em; margin: .6rem 0 0; }
@media (max-width: 900px) {
  .dir-toolbar label { flex: 1 1 45%; }
  .dir-toolbar .dir-q { flex-basis: 100%; }
  .dir-toolbar input[type="search"], .dir-toolbar input[type="text"], .dir-toolbar select, .dir-toolbar .dir-q input { width: 100%; min-width: 0; box-sizing: border-box; }
  .dir-back { flex-basis: 100%; }
  .toolbar .grow { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .dir-editor { padding: 0; }
  .dir-editor-card { min-height: 100%; border: 0; padding: 1rem; }
  .dir-two, .dir-three { grid-template-columns: 1fr; }
  .dir-end { grid-template-columns: 1fr 1fr; }
  .dir-end-label { grid-column: 1 / -1; }
  .dir-end .e-city { grid-column: 1 / -1; }
  .dir-editor-foot { position: sticky; bottom: 0; background: #fffdfb; padding: .6rem 0; border-top: 1px solid var(--line); }
}



/* Directory page: whole page can scroll; list and detail each scroll on their own. */
body.admin-body.dir-page:not(.board-page) {
  height: auto;
  min-height: 100dvh;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
body.dir-page:not(.board-page) .site-header { position: sticky; top: 0; z-index: 1200; inset: auto; height: auto; flex: none; }
body.dir-page:not(.board-page) .admin-app {
  flex: 1 0 auto;
  min-height: calc(100dvh - var(--chrome-h, var(--header-h, 4.5rem)));
  height: auto;
}
body.dir-page:not(.board-page) .workspace { flex: 0 0 auto; min-height: 0; height: auto; }
body.dir-page:not(.board-page) .workspace-grid { flex: none; min-height: 0; align-items: stretch; }
body.dir-page:not(.board-page) .map-pane {
  height: 58vh;
  min-height: 20rem;
  max-height: 58vh;
}
body.dir-page:not(.board-page) .side {
  height: 58vh;
  min-height: 20rem;
  max-height: 58vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.dir-page:not(.board-page) .detail {
  flex: 1 1 46%;
  min-height: 8rem;
  max-height: none;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
body.dir-page:not(.board-page) .post-list {
  flex: 1 1 54%;
  min-height: 8rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
body.dir-page .dir-toolbar select {
  background: #fffdfb; color: var(--text); border: 1px solid var(--line-strong); padding: .5rem .55rem;
  font: 600 .92rem/1.2 var(--body); letter-spacing: 0; text-transform: none; min-width: 8.5rem;
}
.dir-copy {
  margin-left: .35rem; border: 0; background: none; color: var(--accent-ink, var(--accent));
  font: 700 .75rem/1 var(--body); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; padding: 0;
}
.dir-copy:hover { text-decoration: underline; }
.dir-contact-row { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem .4rem; margin: .2rem 0; }
.dir-badge {
  display: inline-block; margin: 0 .35rem 0 0; padding: .12rem .4rem; border-radius: 2px;
  font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  background: #f3eee7; color: var(--text);
}
.dir-badge.is-approved { background: #e4f4ea; color: #0c5a32; }
.dir-badge.is-pending { background: #fff1e6; color: #6a3410; }
.dir-badge.is-down { background: #f8e8e6; color: #8a1f11; }
.dir-notes { margin: .9rem 0 0; }
.dir-notes h3 { margin: 0 0 .45rem; font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.dir-note { border: 1px solid var(--line); background: #fbf8f4; padding: .55rem .7rem; margin: 0 0 .45rem; }
.dir-note-meta { display: flex; justify-content: space-between; gap: .5rem; align-items: center; margin: 0 0 .3rem; }
.dir-note-meta time { color: var(--muted); font-size: .78rem; }
.dir-note-text { margin: 0; white-space: pre-wrap; }
.dir-note-add textarea { width: 100%; box-sizing: border-box; margin: .3rem 0 .45rem; }
.dir-posts { margin: .8rem 0 0; padding: 0; list-style: none; }
.dir-posts li { border-top: 1px solid var(--line); padding: .45rem 0; font-size: .92rem; }
.dir-posts li:first-child { border-top: 0; }
.dir-lane-empty { margin: .6rem 0 0; color: var(--muted); font-size: .88rem; }
.dir-import-table { width: 100%; border-collapse: collapse; font-size: .85rem; margin: .6rem 0; }
.dir-import-table th, .dir-import-table td { border: 1px solid var(--line); padding: .35rem .45rem; text-align: left; vertical-align: top; }
.dir-import-table th { background: #f3eee7; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.dir-dupe { color: #8a1f11; font-weight: 700; }
.dir-undo { margin-left: .6rem; }
.dir-role-tag { font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .68rem; }
@media (max-width: 900px) {
  body.dir-page:not(.board-page) .map-pane, body.dir-page:not(.board-page) .side {
    height: auto; max-height: none; min-height: 0;
  }
  body.dir-page:not(.board-page) .map-pane { min-height: 68vh; height: 68vh; max-height: 68vh; }
  body.dir-page:not(.board-page) .side { overflow: visible; }
  body.dir-page:not(.board-page) .detail, body.dir-page:not(.board-page) .post-list {
    flex: none; max-height: min(70vh, 28rem); overflow: auto;
  }
}

/* One size for every text field, select and textarea on the posting, account, dashboard and admin forms. Checkboxes and radios are left alone. */
:is(.qform, .admin-app, .dir-editor-card, .account-main, .dash) :is(input:not([type]), input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="number"], input[type="date"], input[type="time"], input[type="password"], input[type="search"], select, textarea) {
  box-sizing: border-box !important;
  height: 48px !important;
  min-height: 48px !important;
  padding: 12px !important;
  font-size: 16px !important;
  line-height: 1.25 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
:is(.qform, .gate-card, .dir-editor-card, .account-main, .dash, .companies, .detail) :is(input:not([type]), input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="number"], input[type="date"], input[type="time"], input[type="password"], input[type="search"], select, textarea) {
  display: block;
  width: 100% !important;
  max-width: 100%;
}
:is(.qform, .admin-app, .dir-editor-card, .account-main, .dash) textarea:not([type="x"]) { height: auto !important; min-height: 110px !important; line-height: 1.45 !important; }
:is(.qform, .admin-app, .dir-editor-card, .account-main, .dash) select:not([multiple]) { padding-right: 2.4rem !important; }
.admin-app .block-form :is(input:not([type]), input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="number"], input[type="date"], input[type="time"], input[type="password"], input[type="search"], select, textarea) { width: auto !important; display: inline-block; }
#gate-password { padding-right: 48px !important; }
.detail .pair-row select { flex: 1; width: auto !important; min-width: 0; }
.qform .f input + select { margin-top: .5rem; }
@media (max-width: 900px) {
  .toolbar .grow { flex-wrap: wrap; justify-content: flex-start; }
  .toolbar .grow .counts { flex-basis: 100%; }
}

.admin-tabs { display: flex; gap: 6px; padding: 10px 16px 0; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.admin-tabs a { padding: 10px 18px; border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; text-decoration: none; color: #333; font-weight: 600; background: #f6f2ed; margin-bottom: -1px; }
.admin-tabs a[aria-current="page"] { background: #fff; color: var(--accent, #d4561c); border-bottom: 1px solid #fff; }
.admin-tabs a:hover { background: #fff; }

.legend { padding: 6px 10px !important; width: auto; cursor: help; opacity: .92; }
.legend p { font-size: .78rem !important; gap: .45rem !important; }
.legend p + p { margin-top: .2rem !important; }
.legend .legend-more { display: none; }
.legend:hover, .legend:focus, .legend:focus-within { opacity: 1; padding: 10px 14px !important; }
.legend:hover .legend-more, .legend:focus .legend-more, .legend:focus-within .legend-more { display: inline; }
.legend:hover p, .legend:focus p { font-size: .86rem !important; }


.kc-weather-bar { margin-top: 8px; }
.leaflet-bar.kc-weather-bar a.kc-weather-btn,
.kc-weather-bar .kc-weather-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  line-height: 0;
  padding: 0;
  background: #fffdfb;
  color: #2a2622;
  border: 0;
  cursor: pointer;
}
.kc-weather-bar .kc-weather-btn svg { width: 18px; height: 18px; display: block; }
.leaflet-bar.kc-weather-bar a.kc-weather-btn:hover,
.kc-weather-bar .kc-weather-btn:hover { background: #f3eee7; }
.leaflet-bar.kc-weather-bar a.kc-weather-btn.is-on,
.leaflet-bar.kc-weather-bar a.kc-weather-btn[aria-pressed="true"],
.kc-weather-bar .kc-weather-btn.is-on,
.kc-weather-bar .kc-weather-btn[aria-pressed="true"] {
  background: var(--accent, #d4561c);
  color: #fffdfb;
}
.kc-weather-google {
  margin: 10px 0 0 10px;
  border: 1px solid rgba(36, 31, 27, .16);
  box-shadow: 0 1px 5px rgba(36, 31, 27, .2);
}
.kc-weather-attr {
  position: absolute;
  right: 6px;
  bottom: 4px;
  z-index: 1;
  background: rgba(247, 244, 239, .9);
  color: #5c564e;
  font: 11px/1.3 Manrope, sans-serif;
  padding: 1px 6px;
  pointer-events: auto;
}
.kc-weather-popup .leaflet-popup-content { margin: 10px 12px; font: 500 .88rem/1.35 Manrope, sans-serif; color: #2a2622; }

/* Truck routes (js/route-engine.js) */
.kc-route-hit { cursor: move; }
.leaflet-container .kc-route-ferry, .leaflet-container .kc-route-pin, .leaflet-container .kc-route-via { background: none; border: 0; }
.route-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: -.4rem 0 .8rem; }
.route-tools[hidden] { display: none; }
.route-reset { background: none; border: 0; padding: 0; color: #6a3410; font: inherit; font-size: .92rem; text-decoration: underline; cursor: pointer; }
.route-rule-note { font-size: .9rem; color: #6a3410; margin: 0; }


/* Redesigned admin side panel (map styles stay as they are). */
.side-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
  background: #fff;
  flex: none;
}
.side-stat {
  appearance: none;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  padding: .65rem .4rem .55rem;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.side-stat:last-child { border-right: 0; }
.side-stat:hover, .side-stat.is-on { background: var(--accent-soft); }
.side-stat b { display: block; font-family: var(--display); font-size: 1.3rem; line-height: 1; font-weight: 600; }
.side-stat span { display: block; margin-top: .2rem; font-size: .58rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.side-stat.alert b { color: var(--accent-ink); }

.side-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: #fff;
  overflow-x: auto;
  flex: none;
}
.side-tabs button {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: .65rem .7rem .55rem;
  font-weight: 750;
  font-size: .78rem;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--body);
}
.side-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.side-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  margin-left: .28rem;
  padding: 0 .28rem;
  border-radius: 99px;
  background: var(--accent);
  color: #0b0c0e;
  font-size: .62rem;
  font-weight: 800;
}
.side-badge:empty, .side-badge[data-count="0"] { display: none; }

.side-search {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: .55rem .7rem;
  border-bottom: 1px solid var(--line);
  background: var(--graphite);
  flex: none;
  align-items: center;
}
.side-search input[type="search"] { flex: 1; min-width: 0; }
.side-search select { width: 8.4rem; flex: none; }
.side-search .show-hidden {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: var(--muted);
  font-weight: 650;
}
.side-search .show-hidden[hidden] { display: none !important; }
.side-search .show-hidden input { width: 1.1rem !important; height: 1.1rem !important; min-height: 1.1rem !important; padding: 0 !important; display: inline-block; }

.side-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.side-body .tab-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.side-body .tab-panel[hidden] { display: none !important; }
.side-body .post-list, .side-body .company-list, .side-body .call-list { flex: 1; min-height: 0; overflow: auto; }

.side-card {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  color: inherit;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: .7rem .8rem .7rem 1rem;
  cursor: pointer;
  font: inherit;
}
.side-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: #d01212;
}
.side-card.is-truck::before { background: #a67c00; }
.side-card.is-on { background: #fff7f0; }
.side-card.is-on.is-load { box-shadow: inset 3px 0 0 #d01212; }
.side-card.is-on.is-truck { box-shadow: inset 3px 0 0 #a67c00; }
.card-lane { font-family: var(--display); font-size: .98rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; margin: 0 0 .35rem; }
.card-meta { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin: 0 0 .35rem; }
.chip, .pill {
  display: inline-flex;
  align-items: center;
  padding: .1rem .4rem;
  border: 1px solid var(--line-strong);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.chip { background: var(--graphite-2); }
.pill.open { color: var(--ok); border-color: #8cc9a8; }
.pill.matched { color: var(--accent-ink); border-color: var(--accent); }
.pill.closed { color: var(--dim); }
.pill.sample { color: #6a3410; background: #fff1e6; border-color: #e8c09a; }
.pill.warn { color: var(--danger); border-color: #e2a39e; }
.card-facts { margin: 0; color: var(--muted); font-size: .8rem; }
.card-foot { display: flex; align-items: center; gap: .4rem; margin-top: .4rem; }
.card-foot .co { flex: 1; min-width: 0; font-size: .8rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-age { color: var(--muted); font-size: .72rem; font-weight: 650; margin-left: auto; white-space: nowrap; }
.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  background: var(--graphite);
  color: var(--text);
  border-radius: 2px;
  text-decoration: none;
  flex: none;
}
.icon-btn:hover { border-color: var(--text); }
.icon-btn.is-off { opacity: .35; pointer-events: none; }
.icon-btn svg { width: 16px; height: 16px; display: block; overflow: visible; flex: none; }
.icon-btn svg path, .icon-btn svg rect { fill: none; stroke: currentColor; }

.match-card { padding: .75rem .8rem; border-bottom: 1px solid var(--line); background: #fff; }
.match-reason { margin: 0 0 .5rem; font-size: .78rem; color: var(--muted); }
.match-card .mini { margin: 0 0 .28rem; font-size: .86rem; }
.match-card .mini b { font-family: var(--display); font-weight: 600; font-size: .82rem; }
.dot-load, .dot-truck {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: .35rem;
  vertical-align: middle;
}
.dot-load { background: #d01212; }
.dot-truck { background: #a67c00; }
.group-h {
  margin: 0;
  padding: .55rem .8rem .3rem;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
  background: var(--graphite-2);
}

.detail-sheet {
  flex: 0 1 auto;
  max-height: 52%;
  overflow: auto;
  border-top: 1px solid var(--line-strong);
  background: #fff;
  box-shadow: 0 -8px 24px rgba(36, 31, 27, .06);
}
.detail-sheet[hidden] { display: none !important; }
.detail-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .8rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.detail-sheet .detail-kicker { margin: 0; }
.detail-sheet .detail-body { padding: .7rem .8rem 1rem; }
.detail-sheet .detail-body h2 { font-size: 1.15rem; margin: 0 0 .2rem; }
.note-label { display: block; margin: .6rem 0 .3rem; font-size: .66rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.dir-jump { display: inline-block; margin-top: .45rem; font-size: .8rem; font-weight: 700; color: var(--accent-ink); }

@media (max-width: 900px) {
  .side { max-height: none; }
  .detail-sheet { max-height: none; }
  .side-tabs { position: sticky; top: 0; z-index: 2; }
}

.btn-tiny { padding: .7em .9em; font-size: .68rem; letter-spacing: .12em; }

/* Company dashboard workspace — same map chrome as admin */
body.dash-body { background: var(--bg); display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
body.dash-body .site-header { position: relative; inset: auto; height: auto; flex: none; }
body.dash-body .dash-app.dash {
  padding: 0;
  max-width: none;
  margin: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}
.account-bar {
  display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
  padding: .5rem .8rem; border-bottom: 1px solid var(--line);
  background: #fff; font-size: .82rem;
}
.account-bar .ok-dot, .account-bar .wait-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
}
.account-bar .ok-dot { background: var(--ok); }
.account-bar .wait-dot { background: var(--accent); }
.account-bar .call-ks { margin-left: auto; }
.privacy-line {
  margin: 0; padding: .35rem .8rem; font-size: .74rem; color: var(--muted);
  background: var(--graphite-2, #f3eee7); border-bottom: 1px solid var(--line);
}
.expired-banner {
  margin: 0; padding: .4rem .8rem; background: #fff6f4; color: #6a1d18;
  font-size: .8rem; border-bottom: 1px solid #e2a39e;
}
.expired-banner .link-arrow { background: none; border: 0; color: var(--accent-ink); font-weight: 750; cursor: pointer; padding: 0; text-decoration: underline; }
.pill.live, .pill.open { color: var(--ok); border-color: #8cc9a8; }
.pill.expired { color: var(--danger); border-color: #e2a39e; }
.side-card .card-foot { display: flex; align-items: center; gap: .35rem; margin-top: .4rem; flex-wrap: wrap; }
.side-card .expires { font-size: .74rem; font-weight: 700; color: var(--muted); flex: 1; min-width: 8rem; }
.side-card .expires.soon { color: var(--danger); }
.expiry-box {
  margin: .5rem 0 .2rem; padding: .5rem .6rem; background: #fff7f0;
  border: 1px solid #e8c09a;
}
.expiry-box.urgent { background: #fff6f4; border-color: #e2a39e; }
.expiry-box b { display: block; font-size: .9rem; }
.expiry-box span { display: block; margin-top: .15rem; font-size: .78rem; color: var(--muted); }
.ks-call {
  margin: .55rem 0; padding: .55rem .65rem; background: var(--graphite-2, #f3eee7);
  border: 1px solid var(--line);
}
.ks-call p { margin: 0 0 .35rem; font-size: .8rem; color: var(--muted); }
.detail-status { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin: .15rem 0 .45rem; }
.dash-profile { width: auto; max-width: none; border: 0; padding: 1rem .9rem 1.2rem; }
.dash-profile h2 { font-size: 1.15rem; }
.date-hint { margin: .35rem 0 0; font-size: .78rem; color: var(--muted); }
.rate-block { margin: .2rem 0 0; }
.rate-label { margin: 0 0 .45rem; font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.rate-row { display: grid; grid-template-columns: minmax(0, 1.2fr) 6.5rem minmax(7rem, .9fr); gap: .5rem; align-items: end; }
.rate-row label { display: block; font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.rate-allin { display: flex; align-items: center; gap: .5rem; margin: .55rem 0 0; font-weight: 650; }
.rate-allin input { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }
@media (max-width: 900px) {
  body.dash-body { display: block; height: auto; overflow: auto; }
  body.dash-body .site-header { position: sticky; top: 0; }
  .rate-row { grid-template-columns: 1fr; }
}
.dash-body .side-body .post-list { min-height: 10rem; }
.dash-body .detail-sheet { max-height: 62%; }

/* Board pages (admin map, company dashboard): the whole page scrolls.
   Clicking a listing opens a wide detail column beside the list and narrows the map. */
body.admin-body.board-page,
body.dash-body.board-page {
  height: auto;
  min-height: 100dvh;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
body.board-page .site-header {
  position: sticky;
  top: 0;
  z-index: 1200;
}
body.board-page .admin-app {
  flex: 1 0 auto;
  min-height: calc(100dvh - var(--chrome-h, var(--header-h, 4.5rem)));
  height: auto;
}
body.board-page .gate { flex: 1; min-height: 70vh; }
body.board-page .workspace {
  flex: 0 0 auto;
  min-height: 0;
  height: auto;
}
body.dash-body.board-page .dash-app.dash {
  flex: 0 0 auto;
  min-height: 0;
  height: auto;
  padding: 0;
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}
body.board-page .workspace-grid {
  flex: none;
  min-height: 0;
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  transition: grid-template-columns .28s ease;
}
body.board-page .workspace-grid.detail-open {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px) minmax(280px, var(--board-detail-width, 560px));
}
body.board-page .workspace-grid.side-hidden {
  grid-template-columns: minmax(0, 1fr);
}
body.board-page .workspace-grid.side-hidden.detail-open {
  grid-template-columns: minmax(0, 1fr) minmax(280px, var(--board-detail-width, 560px));
}
body.admin-body.board-page {
  --board-detail-width: 46%;
}
body.admin-body.board-page .workspace-grid.detail-open {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px) minmax(280px, var(--board-detail-width, 46%));
}
body.admin-body.board-page .workspace-grid.side-hidden.detail-open {
  grid-template-columns: minmax(0, 1fr) minmax(280px, var(--board-detail-width, 46%));
}
body.admin-body.board-page .workspace-grid.detail-collapsed.detail-open {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px) var(--board-detail-width, 52px);
}
body.admin-body.board-page .workspace-grid.side-hidden.detail-collapsed.detail-open {
  grid-template-columns: minmax(0, 1fr) var(--board-detail-width, 52px);
}
body.board-page .workspace-grid.is-resizing {
  transition: none;
}
body.is-panel-resizing, body.is-panel-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}
body.board-page .map-pane {
  height: 62vh;
  min-height: 22rem;
  max-height: 62vh;
}
body.board-page .side {
  min-height: 62vh;
  height: auto;
  overflow: visible;
}
body.board-page .side-body,
body.board-page .side-body .tab-panel {
  flex: none;
  min-height: 0;
  height: auto;
  overflow: visible;
}
body.board-page .side-body .post-list,
body.board-page .side-body .company-list,
body.board-page .side-body .call-list,
body.board-page #dir-admin-list,
body.board-page .post-list,
body.board-page .companies,
body.board-page .slot-list {
  flex: none;
  min-height: 0;
  max-height: min(70vh, 44rem);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
body.board-page .board-detail,
body.board-page .detail-sheet,
body.board-page .detail.detail-sheet {
  flex: none;
  max-height: min(70vh, 44rem);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 12rem;
  min-width: 0;
  background: #fff;
  border-top: 0;
  border-left: 1px solid var(--line);
  box-shadow: none;
}
body.board-page .board-detail[hidden],
body.board-page .detail-sheet[hidden] { display: none !important; }
body.board-page .board-detail .detail-kicker { position: static; }
body.board-page .board-detail .detail-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: .75rem 1.15rem;
  background: #fffdfb;
}
body.board-page .board-detail .detail-body { padding: 1.2rem 1.35rem 2rem; }
body.board-page .board-detail .detail-body h2 {
  font-size: clamp(1.55rem, 2.1vw, 2.1rem);
  line-height: 1.15;
  margin: 0 0 .45rem;
}
body.board-page .board-detail dl {
  display: grid;
  grid-template-columns: 8.6rem 1fr;
  gap: .55rem .9rem;
  margin: 1.05rem 0;
}
body.board-page .board-detail dt {
  color: var(--dim);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding-top: .15rem;
}
body.board-page .board-detail dd { margin: 0; font-size: 1.08rem; line-height: 1.4; }
body.board-page .board-detail .detail-phone { font-size: 1.7rem; }
body.board-page .board-detail .detail-comments { font-size: 1.05rem; }
body.board-page .board-detail .detail-actions { gap: .55rem; margin: .85rem 0 1rem; }
body.board-page .board-detail .detail-actions .btn {
  padding: .85em 1.1em;
  font-size: .8rem;
}
body.board-page .board-detail .expiry-box b { font-size: 1.15rem; }
body.board-page .board-detail .expiry-box span { font-size: .9rem; }
body.board-page .dash-body .detail-sheet { max-height: none; }

.board-more {
  border-top: 1px solid var(--line);
  background: #fffdfb;
  padding: 1.4rem 1.15rem 2.6rem;
}
.board-more-inner { max-width: 1400px; margin: 0 auto; }
.board-more h2 {
  margin: 0 0 .85rem;
  font-size: 1.35rem;
}
.board-table-wrap { overflow-x: auto; }
.board-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
  background: #fff;
}
.board-table th,
.board-table td {
  text-align: left;
  padding: .7rem .75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.board-table th {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
  background: var(--graphite-2, #f3eee7);
  white-space: nowrap;
}
.board-table .board-row { cursor: pointer; }
.board-table .board-row:hover { background: #fff7f0; }
.board-table .board-row.is-on { background: #fff7f0; box-shadow: inset 3px 0 0 var(--accent); }
.board-table .board-row.is-on.is-load { box-shadow: inset 3px 0 0 #d01212; }
.board-table .board-row.is-on.is-truck { box-shadow: inset 3px 0 0 #a67c00; }
.board-table td:first-child { font-weight: 700; white-space: nowrap; }

@media (max-width: 900px) {
  body.board-page .workspace-grid,
  body.board-page .workspace-grid.detail-open,
  body.board-page .workspace-grid.side-hidden,
  body.board-page .workspace-grid.side-hidden.detail-open {
    grid-template-columns: minmax(0, 1fr);
  }
  body.board-page .map-pane,
  body.board-page .side,
  body.board-page .board-detail,
  body.board-page #office-map {
    min-width: 0;
    max-width: 100%;
  }
  body.board-page .map-pane,
  body.board-page #office-map {
    overflow-x: hidden;
  }
  body.board-page .map-pane {
    height: 62vh;
    min-height: 18rem;
    max-height: 62vh;
  }
  body.board-page .side,
  body.board-page .board-detail,
  body.board-page .detail-sheet,
  body.board-page .detail.detail-sheet {
    min-height: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  body.board-page .board-detail dl { grid-template-columns: 7.2rem 1fr; }
}

.dims-row { align-items: end; }
.customs-block {
  margin: .4rem 0 1rem;
  padding: .7rem .8rem .9rem;
  border: 1px solid var(--line);
  background: #fffdfb;
}
.customs-block[hidden], #oversize-notes-wrap[hidden] { display: none !important; }
.customs-block .f-label { margin: 0 0 .55rem; }

.weekday-row { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .8rem; }
.weekday-row label {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  min-height: 48px; padding: 0 .75rem; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; font-size: .9rem; cursor: pointer;
}
.weekday-row input { width: 1.05rem; height: 1.05rem; }
#repeat-weekly-fields[hidden], #repeat-monthly-fields[hidden] { display: none !important; }
.repeat-block { margin: 1rem 0 0; padding-top: .4rem; }
.tracking-box, .tracking-view, .series-box {
  margin: .9rem 0 0; padding: .85rem .9rem; border: 1px solid var(--line); background: #fffdfb; border-radius: 10px;
}
.tracking-box label, .tracking-box .f-label { display: block; margin: .45rem 0 .25rem; }
.tracking-box input, .tracking-box select { width: 100%; min-height: 48px; margin: 0 0 .55rem; }
.tracking-box .btn { margin-top: .2rem; }
.shipment-timeline { margin: .6rem 0 0; padding-left: 1.1rem; }
.shipment-timeline li { margin: 0 0 .3rem; font-size: .9rem; }
.pill.empty-miles { color: #6a3410; background: #fff1e6; border-color: #e8c09a; }
.match-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin: 0 0 .45rem; }
.match-head .match-reason { margin: 0; }
.match-card.is-backhaul { background: #fffdf8; }
a.track-load { white-space: nowrap; }


/* Locate control (homepage teaser + planner) */
.leaflet-bar.kc-locate-bar { margin-top: 8px; }
.leaflet-bar.kc-locate-bar a.kc-locate-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  line-height: 0;
  padding: 0;
  background: #fffdfb;
  color: #2a2622;
}
.leaflet-bar.kc-locate-bar a.kc-locate-btn svg { width: 18px; height: 18px; display: block; }
.leaflet-bar.kc-locate-bar a.kc-locate-btn:hover { background: #f3eee7; }
.leaflet-bar.kc-locate-bar a.kc-locate-btn.is-busy { opacity: .6; }
.leaflet-bar.kc-locate-bar a.kc-locate-btn.is-error { color: #8a1f12; }
.leaflet-container .kc-route-crossing { background: none; border: 0; }

/* Homepage teaser map */
.home-map-block { margin-top: clamp(3rem, 6vw, 5rem); }
.home-map-head { max-width: 42rem; margin-bottom: 1.4rem; }
.home-map-head h3 { font-family: var(--display, Unbounded, sans-serif); font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -.02em; margin: .3rem 0 .7rem; }
.home-map-head p { color: var(--muted, #5c564e); margin: 0 0 1.1rem; }
.home-map {
  height: min(62vh, 560px);
  min-height: 320px;
  border: 1px solid var(--line-strong, rgba(36,31,27,.16));
  background: #efeae3;
  touch-action: pan-x pan-y;
  position: relative;
  z-index: 0;
  isolation: isolate;
  overflow: hidden;
}
.home-map-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .8rem 1.4rem;
  margin: .8rem 0 0;
  font-size: .9rem;
  color: var(--muted, #5c564e);
}
.home-map-legend .swatch { display: inline-flex; align-items: center; gap: .45rem; }
.home-map-legend .swatch i {
  display: inline-block; width: 1.1rem; height: 4px; border-radius: 2px;
}
.home-map-legend .swatch.load i { background: #d01212; }
.home-map-legend .swatch.truck i { background: #c89600; }

/* Public truck route planner */
.planner-layout {
  display: grid;
  grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
  gap: clamp(1.4rem, 3vw, 2.4rem);
  align-items: start;
}
.planner-map-wrap { min-width: 0; }
.planner-map {
  height: min(62vh, 640px);
  min-height: 360px;
  border: 1px solid var(--line-strong, rgba(36,31,27,.16));
  background: #efeae3;
  position: relative;
  z-index: 0;
  isolation: isolate;
  overflow: hidden;
}
.place-suggest {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong, rgba(36,31,27,.16));
  border-top: 0;
  background: #fffdfb;
  max-height: 14rem;
  overflow: auto;
}
.place-suggest .place-opt {
  text-align: left;
  padding: .7rem .9rem;
  min-height: 48px;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  color: var(--text, #2a2622);
}
.place-suggest .place-opt:hover, .place-suggest .place-opt:focus { background: #f3eee7; }
.stop-row { position: relative; }
.stop-row .stop-remove {
  margin-top: .45rem;
  background: none;
  border: 0;
  padding: 0;
  color: #6a3410;
  font: inherit;
  font-size: .9rem;
  text-decoration: underline;
  cursor: pointer;
  min-height: 44px;
}
#route-status { margin: 0 0 1rem; font-size: .95rem; }
#route-status.is-error { color: #8a1f12; }
.route-summary, .route-actions { margin: 1rem 0 0; }
.route-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.route-disclaimer { font-size: .86rem; color: var(--muted, #5c564e); margin: .7rem 0 0; max-width: 38em; }
.route-credit { font-size: .8rem; color: var(--muted, #5c564e); margin: .8rem 0 0; }
.route-credit a { color: inherit; text-decoration: underline; }
.dir-list { list-style: none; margin: 1rem 0 0; padding: 0; max-height: 28rem; overflow: auto; border-top: 1px solid var(--line, rgba(36,31,27,.1)); }
.dir-step { padding: .75rem 0; border-bottom: 1px solid var(--line, rgba(36,31,27,.1)); cursor: pointer; }
.dir-step .dir-text { margin: 0; font-weight: 600; }
.dir-step .dir-meta { margin: .25rem 0 0; font-size: .85rem; color: var(--muted, #5c564e); }
.dir-step.is-ferry .dir-text { color: #1565c0; }
.planner-cta { margin-top: 2.2rem; padding-top: 1.4rem; border-top: 1px solid var(--line, rgba(36,31,27,.1)); }
.page-truck-routes .page-hero { padding-bottom: clamp(2rem, 4vw, 3rem); }
.page-truck-routes .page-hero h1 { max-width: 14em; }
@media (max-width: 900px) {
  .planner-layout { grid-template-columns: 1fr; }
  .planner-map, .home-map { height: min(50vh, 420px); min-height: 280px; }
}


/* PWA install prompt (dashboard / admin) */
#pwa-install[hidden] { display: none; }
.pwa-install { margin: .75rem 0 0; padding: .85rem 1rem; background: #fff; border: 1px solid rgba(42,38,34,.14); display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; justify-content: space-between; }
.pwa-install p { margin: 0; flex: 1 1 16rem; }
.pwa-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* Quick Truck available (carrier dashboard) */
.quick-truck { margin: .85rem 0 0; padding: 1rem; background: #fff; border: 1px solid rgba(42,38,34,.14); }
.quick-truck[hidden] { display: none; }
.quick-truck h2 { margin: 0 0 .25rem; font-size: 1.15rem; }
.quick-truck .quick-lead { margin: 0 0 .8rem; color: #5c564e; }
.quick-truck-form { display: grid; gap: .7rem; }
.quick-truck .f { display: flex; flex-direction: column; gap: .28rem; }
.quick-truck label, .quick-truck .f-label { font-weight: 650; }
.quick-truck input, .quick-truck select { min-height: 48px; font-size: 1rem; padding: 0 .7rem; border: 1px solid rgba(42,38,34,.22); background: #f7f4ef; color: #2a2622; width: 100%; }
.quick-truck .loc-row { display: flex; gap: .45rem; align-items: stretch; }
.quick-truck .loc-row input { flex: 1; }
.quick-truck .loc-row button { flex: 0 0 auto; min-height: 48px; }
.quick-truck-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .2rem; }
.quick-status { margin: .55rem 0 0; }
.quick-status[hidden] { display: none; }
.quick-status.is-error { color: #8a1f11; }
@media (min-width: 720px) {
  .quick-truck-form { grid-template-columns: 1fr 1fr; }
  .quick-truck .f-location, .quick-truck .quick-truck-actions { grid-column: 1 / -1; }
}

/* Admin map: directory company pins (admin only) */
.dir-pin-toggle { display: flex; align-items: center; gap: .45rem; margin: 0; font-size: .86rem; cursor: pointer; }
.dir-pin-toggle input { width: 1rem; height: 1rem; margin: 0; }
.dir-cluster { background: none; border: 0; }
.dir-cluster-dot {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  color: #fffdfb; font: 800 .8rem/1 Manrope, sans-serif;
  box-shadow: 0 0 0 3px rgba(255,253,251,.9), 0 2px 8px rgba(36,31,27,.3);
}
.dir-pin-pop strong { display: block; margin-bottom: .2rem; }
.dir-pin-role { font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .35rem; }
.dir-pin-pop .btn { margin-top: .6rem; }
.dir-unmapped {
  position: absolute; z-index: 500; right: 12px; bottom: 28px;
  width: min(260px, calc(100% - 24px)); max-height: 40%;
  overflow: auto; background: rgba(255,253,251,.96);
  border: 1px solid rgba(36, 31, 27, .16); padding: .7rem .8rem;
}
.dir-unmapped-h { margin: 0 0 .3rem; font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.dir-unmapped ul { list-style: none; margin: .3rem 0 0; padding: 0; }
.dir-unmapped li { margin: .25rem 0; }
.dir-pin-status { position: relative; z-index: 400; margin: 0; }
.dir-pin-popup .leaflet-popup-content-wrapper { background: #fffdfb; color: #2a2622; border-radius: 2px; }
@media (max-width: 900px) {
  .dir-unmapped { right: 8px; bottom: 8px; max-height: 30%; }
}

/* Directory search on the main admin map */
.dir-admin-hint {
  margin: 0;
  padding: .45rem 16px .15rem;
  font-size: .88rem;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
  background: #fff;
}
.dir-admin-search {
  background: #fffdfb;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  align-items: flex-end;
}
.dir-admin-search .dir-q { flex: 1 1 16rem; }
.dir-admin-search .dir-q input { width: 100%; min-width: 0; }
.dir-contact-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin: .25rem 0; }
.dir-contact-row .btn { flex: none; }
.side-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; scrollbar-width: thin; }
.side-tabs button { flex: none; white-space: nowrap; }

@media (max-width: 640px) {
  .admin-tabs { padding: 8px 10px 0; gap: 4px; }
  .admin-tabs a { padding: 10px 12px; font-size: .9rem; flex: 1 1 auto; text-align: center; }
  .dir-admin-hint { padding: .4rem 10px .1rem; font-size: .82rem; }
  .dir-admin-search label { flex: 1 1 100%; }
  .dir-admin-search .grow { margin-left: 0; width: 100%; }
  .dir-admin-search .grow .btn, #dir-show-all { min-height: 44px; }
  body.board-page .map-pane { min-height: 48vh; height: 48vh; max-height: 52vh; }
  .toolbar label { flex: 1 1 46%; min-width: 0; }
  .toolbar .grow { width: 100%; margin-left: 0; }
}


@media (max-width: 900px) {
  body.admin-body, body.board-page .admin-app, body.board-page .workspace, body.board-page .workspace-grid {
    max-width: 100%;
    overflow-x: hidden;
  }
}

/* Shared drag handle + collapse for the file panel beside the map */
.panel-resize {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 14px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: col-resize;
  z-index: 3;
}
.panel-resize:before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 4px;
  border-radius: 2px;
  background: transparent;
}
.panel-resize:hover:before,
.panel-resize:focus:before,
body.is-panel-resizing .panel-resize:before {
  background: var(--accent, #d4561c);
}
.panel-resize:focus { outline: none; }
.board-detail, .detail-sheet { position: relative; }
.board-detail.is-collapsed,
.detail-sheet.is-collapsed {
  overflow: hidden;
}
.board-detail.is-collapsed .detail-body,
.board-detail.is-collapsed .detail-actions,
.detail-sheet.is-collapsed .detail-body,
.detail-sheet.is-collapsed .detail-actions {
  display: none !important;
}
.board-detail.is-collapsed .detail-head,
.detail-sheet.is-collapsed .detail-head {
  flex-direction: column;
  align-items: stretch;
  padding: .55rem .35rem;
  gap: .4rem;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  min-height: 12rem;
}
.board-more-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .6rem 1rem;
  margin: 0 0 .7rem;
}
.board-more-head h2 { margin: 0; }
.board-table th[aria-sort] { cursor: pointer; }
.board-table th button {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
}
.board-table th button:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.board-table th[aria-sort="ascending"] button:after { content: " ▲"; font-size: .7em; }
.board-table th[aria-sort="descending"] button:after { content: " ▼"; font-size: .7em; }
.detail-kicker.is-carrier { color: #3b7ddd; }
.detail-kicker.is-shipper { color: #1f9d63; }

@media (max-width: 900px) {
  .panel-resize { display: none; }
  body.admin-body.board-page .workspace-grid.detail-open,
  body.admin-body.board-page .workspace-grid.side-hidden.detail-open,
  body.admin-body.board-page .workspace-grid.detail-collapsed.detail-open,
  body.admin-body.board-page .workspace-grid.side-hidden.detail-collapsed.detail-open {
    grid-template-columns: minmax(0, 1fr);
  }
  .board-detail.is-collapsed .detail-head,
  .detail-sheet.is-collapsed .detail-head {
    writing-mode: horizontal-tb;
    transform: none;
    flex-direction: row;
    min-height: 0;
  }
}


#acct-delete-modal .dir-editor-card label { display: block; margin: .8rem 0 .3rem; font-weight: 700; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
#acct-delete-modal #acct-del-msg { margin: .8rem 0; }
#acct-delete-modal #acct-del-name { width: 100%; }

/* Admin + dashboard truck detail */
.kc-unit-gal { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 8px 0 10px; }
.kc-unit-gal a { display: block; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; border: 1px solid var(--kc-line, #e2e8f0); background: #f1f5f9; }
.kc-unit-gal img { width: 100%; height: 100%; object-fit: cover; display: block; }

