/* FleetCare PRO — signed-in product chrome. Public landing keeps landing.css. */

body.app {
  display: block;
  padding: 0;
  background: #f3efe6;
  color: #1a1714;
}

.shell {
  display: grid;
  grid-template-columns: 15.5rem 1fr;
  min-height: 100dvh;
}

.side {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100dvh;
  padding: 1.35rem 1.1rem 1.5rem;
  background: #1a1714;
  color: #f3efe6;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.side .mark {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #f3efe6;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.side .mark img {
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  border-radius: 0.55rem;
}

.side .mark span {
  color: #e8a07a;
  font-weight: 600;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #c9c0b3;
  text-decoration: none;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  font-size: 0.95rem;
}

.side-nav a:hover,
.side-nav a.on {
  background: rgba(243, 239, 230, 0.08);
  color: #fff;
}

.side-nav a.on {
  font-weight: 600;
}

.side-nav .ico {
  color: #c9c0b3;
  flex: 0 0 auto;
}

.side-nav a.on .ico,
.side-nav a:hover .ico {
  color: #e8a07a;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}

.skip:focus {
  left: 0.75rem;
  top: 0.75rem;
  z-index: 20;
  padding: 0.45rem 0.7rem;
  background: #fffdf8;
  color: #1a1714;
  border-radius: 8px;
}

.side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.side-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-align: center;
  border-radius: 8px;
}

.side-who {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0 0.15rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #c9c0b3;
}

.side-who strong {
  color: #f3efe6;
  font-size: 0.88rem;
}

.side-who span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-add .ico { color: #1a1714; }

.maincol {
  min-width: 0;
  padding: 0 0 3rem;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
}

.topbar-end {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.55rem;
  height: 2.55rem;
  padding: 0;
  border: 1px solid #c9c2b4;
  border-radius: 8px;
  background: #fffdf8;
  color: #1a1714;
  cursor: pointer;
}

.nav-toggle .ico { color: #1a1714; }

.nav-backdrop {
  display: none;
}

.user-menu {
  position: relative;
}

.user-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  list-style: none;
  cursor: pointer;
  padding: 0.35rem 0.65rem 0.35rem 0.45rem;
  border: 1px solid #c9c2b4;
  border-radius: 999px;
  background: #fffdf8;
  color: #1a1714;
  font-size: 0.9rem;
}

.user-menu summary::-webkit-details-marker {
  display: none;
}

.user-menu summary .ico {
  color: #5c564c;
}

.user-menu[open] summary {
  background: #efe8db;
}

.user-menu-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 50;
  min-width: 12rem;
  padding: 0.35rem;
  background: #fffdf8;
  border: 1px solid #e4dccf;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(26, 23, 20, 0.16);
}

.user-menu-pop a,
.user-menu-pop button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.65rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #1a1714;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.user-menu-pop a:hover,
.user-menu-pop button:hover {
  background: #efe8db;
}

.user-menu-pop form {
  margin: 0;
}

body.app main.wide,
body.app main.dash,
body.app main.narrow {
  width: min(72rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0 1rem;
}

body.app main.wide.file {
  width: min(80rem, calc(100% - 2rem));
}

body.app main.narrow {
  width: min(36rem, calc(100% - 2rem));
}

body.app h1 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  font-size: clamp(1.6rem, 2vw + 1rem, 2.15rem);
  letter-spacing: -0.03em;
}

body.app h1 .icon-badge {
  width: 2.25rem;
  height: 2.25rem;
}

.lede {
  max-width: 40rem;
}

h1 .help-tip {
  vertical-align: middle;
  margin-left: 0.2rem;
}

.help-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #efe8db;
  color: #5c564c;
  cursor: pointer;
  vertical-align: middle;
}

.help-tip .ico {
  width: 16px;
  height: 16px;
}

.help-tip.is-open,
.help-tip:hover {
  background: #e4dccf;
  color: #1a1714;
}

.help-tip__pop {
  position: absolute;
  left: 0;
  top: calc(100% + 0.4rem);
  z-index: 40;
  width: min(22rem, 72vw);
  padding: 0.7rem 0.8rem;
  background: #fffdf8;
  color: #1a1714;
  border: 1px solid #e4dccf;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(26, 23, 20, 0.16);
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.45;
  text-align: left;
}

.help-tip__pop[hidden] {
  display: none;
}

.app-dialog {
  border: 0;
  border-top: 4px solid #2a4f8f;
  border-radius: 12px;
  padding: 1.25rem 1.35rem 1.1rem;
  width: 100%;
  max-width: min(32rem, calc(100vw - 2rem));
  background: #fffdf8;
  color: #1a1714;
  box-shadow: 0 18px 48px rgba(26, 23, 20, 0.28);
}

.app-dialog::backdrop {
  background: rgba(26, 23, 20, 0.45);
}

.app-dialog h2 {
  margin: 0 0 0.65rem;
  grid-column: 1 / -1;
}

.app-dialog .fields {
  margin: 0;
}

.app-dialog .fields label.span-6 {
  grid-column: span 6;
}

.app-dialog .fields label.span-3 {
  grid-column: span 3;
}

.app-dialog.wide {
  max-width: min(44rem, calc(100vw - 2rem));
}

.app-dialog fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
  display: contents;
}

.dialog-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem;
  margin: 0 0 0.85rem;
  border-bottom: 1px solid #e4dccf;
}

.dialog-tabs button {
  border: 0;
  background: transparent;
  padding: 0.45rem 0.6rem;
  font: inherit;
  font-size: 0.9rem;
  color: #5c564c;
  cursor: pointer;
}

.dialog-tabs button.on {
  color: #1a1714;
  font-weight: 600;
  box-shadow: inset 0 -2px 0 #9a3d1a;
}

.app-dialog .fields label.span-2, .app-dialog .fields .span-2 { grid-column: span 2; }
.app-dialog .fields label.span-4, .app-dialog .fields .span-4 { grid-column: span 4; }
.app-dialog .fields label.span-5, .app-dialog .fields .span-5 { grid-column: span 5; }

.app-dialog .fields label.span-12 {
  grid-column: 1 / -1;
}

.app-dialog textarea {
  min-height: 5rem;
}

.app-dialog .dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1rem;
}

.app-dialog .dialog-actions-end {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.app-dialog [data-vendor-remove] {
  margin: 0;
}

.app-dialog [data-vendor-remove][hidden] {
  display: none;
}

tr.row-open {
  cursor: pointer;
}

tr.row-open:hover,
tr.row-open:focus {
  background: #f7f2e8;
}

tr.row-open:focus {
  outline: 3px solid #9a3d1a;
  outline-offset: -2px;
}

.pagehead {
  align-items: flex-start;
}

.h1-edit {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
}

.icon-hit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #5c564c;
  cursor: pointer;
}

.icon-hit:hover {
  background: #efe8db;
  color: #1a1714;
}

.icon-hit:focus-visible {
  color: #1a1714;
  outline: 3px solid #9a3d1a;
  outline-offset: 2px;
}

.vendor-facts {
  margin-top: 0.65rem;
}

.actions {
  gap: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.58rem 1.05rem;
  background: #1a1714;
  color: #f3efe6;
  text-decoration: none;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.btn.ghost {
  background: transparent;
  color: #1a1714;
  border: 1px solid #c9c2b4;
}

.btn.warn {
  background: transparent;
  color: #9b2414;
  border: 1px solid #e2b8b0;
}

.btn.warn:hover {
  background: #9b2414;
  color: #fffdf8;
}

.btn.side-add,
a.btn.side-add {
  background: #e8a07a;
  color: #1a1714;
  border-color: #e8a07a;
}

.btn.side-add:hover,
a.btn.side-add:hover {
  background: #f0b592;
  color: #1a1714;
}

.btn.slim {
  padding: 0.28rem 0.65rem;
  font-size: 0.8rem;
}

/* KPI row */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}

.kpi {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 0.35rem 0.5rem;
  background: #fffdf8;
  border: 1px solid #e4dccf;
  border-radius: 12px;
  padding: 0.85rem 0.9rem 0.8rem;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(26, 23, 20, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(26, 23, 20, 0.07);
}

.kpi .n {
  display: block;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.kpi .l {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: #5c564c;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kpi .icon-badge { grid-column: 2; grid-row: 1 / span 2; }
.kpi.bad .n { color: #9b2414; }
.kpi.soon .n { color: #9a5b12; }
.kpi.ok .n { color: #2d6a3e; }
.kpi.flag .n { color: #6b3a8a; }
.kpi.paper .n { color: #9a5b12; }
.kpi.ink .n { color: #1a1714; }

/* Color tiles — meaning first, words second */
.icon-badge {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.7rem;
  flex: 0 0 auto;
}

.icon-badge .ico { color: #fffdf8; }

.tone-rust { background: #c45c32; }
.tone-red { background: #9b2414; }
.tone-amber { background: #c4842a; }
.tone-green { background: #2d6a3e; }
.tone-teal { background: #1d6b6b; }
.tone-blue { background: #2a4f8f; }
.tone-purple { background: #6b3a8a; }
.tone-ink { background: #1a1714; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
  gap: 0.85rem;
}

.tile {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1rem 1.05rem;
  background: #fffdf8;
  border: 1px solid #e4dccf;
  border-radius: 14px;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(26, 23, 20, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-height: 5.5rem;
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(26, 23, 20, 0.08);
}

.tile h2 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.tile p {
  margin: 0;
  font-size: 0.85rem;
  color: #5c564c;
  line-height: 1.35;
}

.choice-grid {
  display: grid;
  gap: 0.65rem;
}

.choice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: #fffdf8;
  border: 1px solid #e4dccf;
  border-radius: 12px;
  cursor: pointer;
}

.fields label.choice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  grid-column: 1 / -1;
}

.choice input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: #1a1714;
}

.choice strong { display: block; font-size: 0.95rem; color: #1a1714; }
.choice p { margin: 0.2rem 0 0; font-size: 0.85rem; color: #5c564c; }

.tile .tile-n {
  display: block;
  margin-top: 0.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #1a1714;
}

.hub-label {
  margin: 1.5rem 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5c564c;
}

.app .tabs a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.app .tabs a .ico {
  color: #8a8174;
}

.verdict { border-left: 6px solid #c4842a; }
.verdict.tone-ok { border-left-color: #2d6a3e; }
.verdict.tone-bad { border-left-color: #9b2414; }
.verdict.tone-warn { border-left-color: #c4842a; }
.verdict h2 { margin: 0 0 0.35rem; }
.verdict p { margin: 0; }

.facts {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 0.45rem 1rem;
  margin: 0 0 1.25rem;
}
.facts dt { margin: 0; color: #5c564c; font-size: 0.85rem; white-space: nowrap; }
.facts dd { margin: 0; font-weight: 600; }

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin: 0 0 0.65rem;
}

.pane-head h2,
.pane-head .hub-label { margin: 0; }

.fields[hidden],
.logbar[hidden],
.photo-form[hidden],
.facts[hidden] {
  display: none;
}

.ticket-actions-end {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-left: auto;
}

ul.plain { margin: 0; padding-left: 1.15rem; }
ul.plain li { margin: 0.25rem 0; }

.lookup { margin: 0 0 1.75rem; }
.lookup-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem 0.85rem;
  align-items: end;
  padding: 1rem 1.05rem;
  background: #fffdf8;
  border: 1px solid #e4dccf;
  border-radius: 14px;
}
.lookup-q { grid-column: 1; display: block; }
.lookup-q span {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  color: #5c564c;
}
.lookup-q input {
  width: 100%;
  font-size: 1.15rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid #d5cbb8;
  border-radius: 10px;
  background: #fff;
}
.lookup-filters {
  grid-column: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.lookup-bar button[type="submit"] {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
}
.chip-pick {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid #e4dccf;
  border-radius: 999px;
  background: #f3efe6;
  font-size: 0.85rem;
  cursor: pointer;
}
.chip-pick:has(input:checked) {
  background: #1a1714;
  color: #f3efe6;
  border-color: #1a1714;
}
.chip-pick { position: relative; }
.chip-pick input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.lookup-q input:focus,
.fields input:focus,
.fields select:focus,
.fields textarea:focus,
.logbar input:focus,
.logbar select:focus {
  outline: 2px solid #e8a07a;
  outline-offset: 1px;
  border-color: #c4842a;
}
.lookup-hits,
.watch-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.75rem;
}
.hit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  background: #fffdf8;
  border: 1px solid #e4dccf;
  border-radius: 12px;
}
.hit-main {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.hit-main:hover .hit-id { color: #9a3d1a; }
.hit-main:focus-visible {
  outline: 2px solid #9a3d1a;
  outline-offset: 3px;
  border-radius: 8px;
}
.hit-id {
  margin: 0 0 0.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.hit p { margin: 0; }
.hit form { margin: 0; }
.hit .btn.warn { padding: 0.4rem 0.75rem; }
.eld-listing {
  margin: 0 0 1rem;
  padding: 1.1rem 1.15rem 0.55rem;
  background: #fffdf8;
  border: 1px solid #e4dccf;
  border-radius: 14px;
}
.eld-listing.is-revoked { border-left: 6px solid #9b2414; }
.eld-listing.is-focus { box-shadow: 0 0 0 2px #e8a07a inset; }
.eld-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.eld-head h3 { margin: 0 0 0.15rem; }
.eld-head a { text-decoration: none; }
.eld-head a:hover { color: #9a3d1a; }
.eld-jump {
  display: grid;
  gap: 0.45rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}
.eld-jump li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  background: #fffdf8;
  border: 1px solid #e4dccf;
  border-radius: 10px;
}
.eld-jump a { text-decoration: none; font-weight: 600; }
.eld-jump a:hover { color: #9a3d1a; }
.lookup-manual {
  margin: 1.25rem 0;
  padding: 0.85rem 1rem;
  background: #fffdf8;
  border: 1px solid #e4dccf;
  border-radius: 12px;
}
.lookup-manual summary {
  cursor: pointer;
  font-weight: 600;
}
.lookup-manual .fields { margin-top: 0.85rem; }
.watch-count { font-weight: 700; font-variant-numeric: tabular-nums; }

.app .tabs a.on .ico {
  color: #9a3d1a;
}

.alert-list a {
  align-items: center;
}

.alert-ico {
  flex: 0 0 auto;
}

@media (prefers-reduced-motion: reduce) {
  .kpi, .tile, .unit-card, .side {
    transition: none;
  }
  .kpi:hover, .tile:hover, .unit-card:hover {
    transform: none;
  }
}

.dash-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.card {
  background: #fffdf8;
  border: 1px solid #e4dccf;
  border-radius: 12px;
  padding: 1.1rem 1.15rem 1.15rem;
  box-shadow: 0 1px 2px rgba(26, 23, 20, 0.04);
}

.card h2 {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.card-head h2 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.card-head h2 .ico { color: #8a8174; }

.muted {
  color: #5c564c;
  font-size: 0.875rem;
}

.chart-donut {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.chart-donut svg { display: block; }
.donut-n { font-size: 22px; font-weight: 700; fill: #1a1714; }
.donut-s { font-size: 11px; fill: #5c564c; }

.chart-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.chart-legend .swatch {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  margin-right: 0.45rem;
}

.chart-bars { display: flex; flex-direction: column; gap: 0.45rem; }

.bar-row {
  display: grid;
  grid-template-columns: 6rem 1fr 2rem;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-size: 0.875rem;
}

.bar-track {
  height: 0.55rem;
  background: #efe8db;
  border-radius: 99px;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  background: #9a3d1a;
  border-radius: 99px;
}

.bar-n { text-align: right; color: #5c564c; }

.chart-spend {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  align-items: end;
  min-height: 10rem;
}

.spend-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  min-height: 10rem;
}

.spend-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  background: #efe8db;
  border-radius: 6px 6px 0 0;
  min-height: 6.5rem;
}

.spend-fill {
  width: 100%;
  background: #1a1714;
  border-radius: 6px 6px 0 0;
}

.spend-lab { font-size: 0.75rem; color: #5c564c; }
.spend-n { font-size: 0.7rem; color: #5c564c; }

.alert-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.alert-list li { margin: 0; }

.alert-list a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid #efe8db;
  text-decoration: none;
}

.alert-list a:last-child { border-bottom: 0; }

.alert-unit { font-weight: 700; }
.alert-txt { color: #5c564c; font-size: 0.9rem; text-align: right; }

.chip {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #efe8db;
  color: #5c564c;
}

.chip-overdue, .chip-bad { background: #f8e4df; color: #9b2414; }
.chip-missing, .chip-noscans { background: #f7ead6; color: #9a5b12; }
.chip-soon { background: #f7ead6; color: #9a5b12; }
.chip-ok { background: #e3efe6; color: #2d6a3e; }
.chip-flag { background: #efe4f5; color: #6b3a8a; }
.chip-todo { background: #e4eef5; color: #1e4f73; }
.chip-mute { background: #efe8db; color: #5c564c; }

/* Equipment cards */
.unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
  gap: 0.85rem;
}

.unit-card {
  display: flex;
  flex-direction: column;
  background: #fffdf8;
  border: 1px solid #e4dccf;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(26, 23, 20, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.unit-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(26, 23, 20, 0.08);
}

.unit-photo {
  aspect-ratio: 16 / 10;
  background: #e8e0d2;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.unit-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.unit-photo .ph {
  font-size: 1.6rem;
  font-weight: 700;
  color: #9a3d1a;
  letter-spacing: 0.04em;
}

.unit-card .body {
  padding: 0.85rem 0.95rem 1rem;
}

.unit-card h2 {
  margin: 0 0 0.2rem;
  font-size: 1.2rem;
}

.unit-card .meta { margin: 0 0 0.25rem; font-size: 0.875rem; color: #5c564c; }

.card-stats {
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: #1a1714;
  font-weight: 600;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.view-toggle {
  display: flex;
  gap: 0.25rem;
  font-size: 0.8rem;
}

.view-toggle a {
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  text-decoration: none;
  color: #5c564c;
}

.view-toggle a.on {
  background: #1a1714;
  color: #f3efe6;
}

/* Unit hero */
.hero {
  display: grid;
  grid-template-columns: 16rem 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  background: #fffdf8;
  border: 1px solid #e4dccf;
  border-radius: 12px;
  padding: 1rem;
}

.hero-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: #e8e0d2;
  display: grid;
  place-items: center;
}

.photo-edit {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  background: #fffdf8;
  box-shadow: 0 1px 4px rgba(26, 23, 20, 0.12);
}

.hero-photo img { width: 100%; height: 100%; object-fit: cover; }

.hero-photo .ph { font-size: 2rem; font-weight: 700; color: #9a3d1a; }

.hero h1 { margin-bottom: 0.25rem; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.hero-actions form { margin: 0; }

.stack label:has(input[type="checkbox"]) {
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
}

.flag-box {
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: #efe4f5;
  border-radius: 8px;
  font-size: 0.9rem;
}

.gaps {
  margin: 0 0 1rem;
  padding: 0.7rem 0.85rem;
  background: #f7ead6;
  border-radius: 8px;
}

.gaps-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.gaps-head .btn { flex: 0 0 auto; }

.gaps ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }

.todos {
  margin: 0 0 1rem;
  padding: 0.85rem 0.95rem;
  background: #eef3f7;
  border-radius: 8px;
}

.todos h2 {
  margin: 0;
  font-size: 1rem;
}

.todos .meta { margin: 0.2rem 0 0.55rem; }
.todos .empty { margin: 0.35rem 0 0.55rem; }

.todo-list {
  list-style: none;
  margin: 0 0 0.65rem;
  padding: 0;
}

.todo-list.mute .todo-text { color: #5c564c; }

.todo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.75rem;
  padding: 0.4rem 0;
  border-top: 1px solid #d5dee6;
}

.todo-row:first-child { border-top: 0; }

.todo-text {
  flex: 1 1 12rem;
  min-width: 0;
}

.todo-acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.todo-acts form { margin: 0; }

.todo-add {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.65rem;
}

.todo-add .todo-note {
  flex: 1 1 16rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: #5c564c;
}

.todo-add input {
  width: 100%;
  max-width: 36rem;
  font: inherit;
  color: #1a1714;
  padding: 0.45rem 0.55rem;
  border: 1px solid #c9c2b4;
  border-radius: 8px;
  background: #fff;
}

.todo-done-lab {
  margin: 0.75rem 0 0.25rem;
  font-size: 0.8rem;
  color: #5c564c;
}

.todo-ticket,
.todo-closed {
  margin: 0 0 0.85rem;
}

.todo-pick {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.todo-pick .ticket-check {
  max-width: 40rem;
}

.stack input,
.stack select,
.stack textarea,
.filters select,
.filters input {
  border-radius: 8px;
}

.filters input {
  font: inherit;
  color: #1a1714;
  padding: 0.45rem 0.55rem;
  border: 1px solid #c9c2b4;
  background: #fff;
}

.stack button:not(.btn) {
  border-radius: 8px;
}

.photo-form {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.file-field .field-lab {
  display: block;
  margin-bottom: 0.28rem;
  font-size: 0.8rem;
  color: #5c564c;
}

.due-card {
  margin-bottom: 1rem;
}

.settings-alert-fields {
  margin-top: 1rem;
}

.work-mini {
  list-style: none;
  margin: 0;
  padding: 0;
}

.work-mini li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #efe8db;
  font-size: 0.9rem;
}

.work-mini a { text-decoration: none; font-weight: 600; }

.report-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.report-list li {
  border-bottom: 1px solid #efe8db;
}

.report-list a {
  display: block;
  padding: 0.65rem 0;
  font-weight: 600;
  text-decoration: none;
}

.app .tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 0 0 1.15rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid #e4dccf;
}

.card + .card { margin-top: 1rem; }

.datestrip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  margin: 0.65rem 0 0.35rem;
}

.ds {
  min-width: 7.5rem;
}

.ds-l {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5c564c;
}

.ds strong {
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.due-overdue, .ds.due-overdue strong { color: #9b2414; }
.due-soon, .ds.due-soon strong,
.due-missing, .due-noscans { color: #9a5b12; }

.papers-attach {
  margin: 1rem 0 1.5rem;
  max-width: 52rem;
}
.papers-attach input[type="date"] { max-width: 11rem; }
.cover-list .inline { margin-left: 0.35rem; }

.coststrip {
  margin: 0.45rem 0 0.55rem;
  padding: 0.45rem 0.65rem;
  background: #efe8db;
  border-radius: 8px;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

/* Field widths from the live RT Express file — not 100% bleed. */
.fields {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.7rem 0.85rem;
  margin-top: 0.15rem;
}

.fields label {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  font-size: 0.8rem;
  color: #5c564c;
  grid-column: span 4;
}

.fields label[hidden] {
  display: none;
}

.fields label.span-2, .fields .span-2 { grid-column: span 2; }
.fields label.span-3, .fields .span-3 { grid-column: span 3; }
.fields label.span-4, .fields .span-4 { grid-column: span 4; }
.fields label.span-5, .fields .span-5 { grid-column: span 5; }
.fields label.span-6, .fields .span-6 { grid-column: span 6; }
.fields label.span-8, .fields .span-8 { grid-column: span 8; }
.fields label.span-12,
.fields .span-12,
.fields .actions { grid-column: 1 / -1; }
.fields .field-lab {
  display: block;
  margin-bottom: 0.28rem;
  font-size: 0.8rem;
  color: #5c564c;
}

.fields textarea,
.fields input,
.fields select {
  font: inherit;
  color: #1a1714;
  padding: 0.4rem 0.5rem;
  border: 1px solid #c9c2b4;
  border-radius: 8px;
  background: #fff;
  width: 100%;
  max-width: 100%;
}

.fields .pick-custom {
  display: none;
  margin-top: 0.35rem;
}

.fields .pick-custom.on {
  display: block;
}

.fields input.vin {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.03em;
}

.fields label.late input {
  background: #fdf2ef;
  border-color: #e2b8b0;
}

.fields .actions { margin-top: 0.2rem; }
.fields textarea { min-height: 5.5rem; resize: vertical; }
.fields .check-line {
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.95rem;
  color: #1a1714;
}
.sign-block {
  padding: 0.75rem 0.85rem;
  background: #fffdf8;
  border: 1px solid #e4dccf;
  border-radius: 12px;
}
.sign-label { margin: 0 0 0.45rem; font-weight: 600; font-size: 0.9rem; }
.sign-pad {
  display: block;
  width: 100%;
  height: 9rem;
  touch-action: none;
  border: 1px dashed #c9c2b4;
  border-radius: 10px;
  background: #fff;
  margin-bottom: 0.5rem;
}
.sign-type {
  display: grid;
  grid-template-columns: minmax(7rem, 10rem) minmax(12rem, 24rem);
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: #5c564c;
}
@media (max-width: 640px) {
  .form-phone .fields input,
  .form-phone .fields select,
  .form-phone .fields textarea {
    font-size: 16px;
  }
  .sign-pad { height: 11rem; }
  .sign-type { grid-template-columns: 1fr; }
}

.fields .btn,
.logbar .btn {
  white-space: nowrap;
}

.logbar {
  display: grid;
  grid-template-columns: 9.25rem 10rem minmax(10rem, 1.4fr) 6.5rem minmax(7rem, 11rem) 6.25rem minmax(8rem, 10rem) auto;
  gap: 0.5rem 0.55rem;
  align-items: end;
  margin: 1rem 0 0;
  padding: 0.8rem 0.85rem;
  background: #fffdf8;
  border: 1px solid #e4dccf;
  border-radius: 12px;
}

.logbar.attach {
  grid-template-columns: 12rem minmax(12rem, 1fr) auto;
}

.logbar.papers {
  grid-template-columns: 11rem minmax(8rem, 1fr) 8.5rem 8.5rem minmax(10rem, 1.2fr) auto;
}

.logbar .pick-custom {
  display: none;
  margin-top: 0.35rem;
}

.logbar .pick-custom.on {
  display: block;
}

.logbar .warranty-check {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.logbar .warranty-box {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 10rem 10rem minmax(10rem, 1fr);
  gap: 0.5rem;
}

.logbar .warranty-box[hidden] {
  display: none;
}

.filters-row {
  flex-wrap: wrap;
}

.filters-row label {
  min-width: 8rem;
}

.ticket-sheet {
  max-width: 54rem;
}

.ticket-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ticket-form label,
.ticket-warranty-fields label {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  font-size: 0.8rem;
  color: #5c564c;
  min-width: 0;
}

.ticket-form label[hidden],
.logbar label[hidden] {
  display: none;
}

.ticket-form input,
.ticket-form select,
.ticket-form textarea,
.ticket-warranty-fields input,
.ticket-warranty-fields select {
  font: inherit;
  color: #1a1714;
  padding: 0.4rem 0.5rem;
  border: 1px solid #c9c2b4;
  border-radius: 8px;
  background: #fff;
  width: 100%;
  max-width: 100%;
}

.ticket-form textarea {
  min-height: 4.5rem;
  resize: vertical;
}

.ticket-form .pick-custom {
  display: none;
  margin-top: 0.35rem;
}

.ticket-form .pick-custom.on {
  display: block;
}

.ticket-row {
  display: grid;
  gap: 0.7rem 0.85rem;
  align-items: start;
}

.ticket-visit {
  grid-template-columns: 10.5rem minmax(10rem, 13rem) minmax(9rem, 12rem) minmax(11rem, 1fr) 7.25rem;
}

.ticket-form .hub-label {
  margin-top: 0.25rem;
}

.service-line .f-cost input,
.ticket-form .f-cost input {
  font-variant-numeric: tabular-nums;
}

.ticket-why {
  grid-template-columns: 14rem minmax(16rem, 1fr);
}

.ticket-form .field-lab {
  display: block;
  margin-bottom: 0.28rem;
  font-size: 0.8rem;
  color: #5c564c;
}

.ticket-money {
  grid-template-columns: 6.25rem;
  justify-content: end;
}

.ticket-line-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.15rem;
}

.ticket-line-bar .f-cost {
  width: 6.25rem;
  flex: 0 0 6.25rem;
}

.ticket-line-bar-end {
  display: flex;
  align-items: flex-end;
  gap: 0.85rem;
}

.ticket-line-sum {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.28rem;
  min-width: 6.25rem;
}

.ticket-line-sum [data-line-total] {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  padding: 0.4rem 0;
  line-height: 1.25;
  color: #1a1714;
}

.pagehead-end {
  display: flex;
  align-items: flex-start;
  gap: 1.15rem;
  flex-shrink: 0;
}

.ticket-total {
  text-align: right;
  min-width: 7.5rem;
}

.ticket-total-n {
  display: block;
  font-size: 1.55rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.file-pick {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  cursor: pointer;
}

.file-pick input[type="file"] {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
}

.file-pick .btn {
  pointer-events: none;
}

.file-pick:focus-within .btn {
  outline: 2px solid #c4842a;
  outline-offset: 2px;
}

.file-pick-name {
  font-size: 0.8rem;
  color: #5c564c;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview-dlg {
  max-width: min(44rem, calc(100vw - 2rem));
}

.file-preview-body {
  margin: 0.35rem 0 0.85rem;
  background: #efe8db;
  border-radius: 8px;
  overflow: hidden;
}

.file-preview-body img,
.file-preview-body iframe {
  display: block;
  width: 100%;
  max-height: 62vh;
  border: 0;
  background: #fff;
}

.file-preview-body img {
  height: auto;
  object-fit: contain;
}

.file-preview-body iframe {
  height: 62vh;
}

.file-preview-body p {
  margin: 0;
  padding: 0.85rem 1rem;
}

.file-preview-until {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  max-width: 11rem;
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  color: #5c564c;
}

.papers-desk .datestrip { margin-bottom: 1rem; }

.ticket-form .ticket-check {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  width: max-content;
  font-size: 0.95rem;
  color: #1a1714;
}

.ticket-form .ticket-check input {
  width: auto;
}

.vendor-mechs[hidden] {
  display: none;
}

.vendor-mechs-label {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  color: #5c564c;
}

.fields .vendor-mech-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.4rem;
  grid-column: auto;
}

.fields .vendor-mech-row input {
  width: 14rem;
  max-width: calc(100% - 2.6rem);
}

.acc-visit {
  grid-template-columns: 10.5rem 6.5rem minmax(8rem, 11rem) minmax(11rem, 1fr);
}

.acc-place {
  grid-template-columns: minmax(12rem, 1.4fr) minmax(9rem, 12rem) 5.5rem 5.25rem 5.25rem;
}

.acc-two {
  grid-template-columns: minmax(10rem, 16rem);
}

.acc-party {
  grid-template-columns: minmax(9rem, 1fr) minmax(9rem, 1fr) 9.5rem minmax(8rem, 11rem);
}

.acc-veh {
  grid-template-columns: 5.25rem minmax(8rem, 11rem) minmax(8rem, 11rem) 7.25rem minmax(10rem, 14rem);
}

.acc-test {
  grid-template-columns: 11rem 11rem;
}

.you-form {
  max-width: 36rem;
}

.you-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.7rem 0.85rem;
}

.you-form .you-half { grid-column: span 3; }
.you-form .you-third { grid-column: span 2; }

.you-actions {
  display: flex;
  justify-content: flex-end;
}

.ticket-form .f-time input,
.ticket-form .f-state input,
.ticket-form .f-year input,
.ticket-form .f-phone input,
.ticket-form .f-cost input {
  max-width: 100%;
}

.ticket-form .f-vin input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.acc-block {
  border: 1px solid #e4dccf;
  border-radius: 12px;
  padding: 0.55rem 0.85rem 0.75rem;
  background: #fffdf8;
}

.acc-block summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  color: #1a1714;
  list-style: none;
}

.acc-block summary::-webkit-details-marker {
  display: none;
}

.acc-block[open] summary {
  margin-bottom: 0.65rem;
}

.acc-block .ticket-row {
  margin-bottom: 0.65rem;
}

.acc-printbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.65rem;
  align-items: flex-end;
  margin: 0 0 1.25rem;
}

.acc-printbar label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #5c564c;
}

.acc-printbar input[type="date"] {
  font: inherit;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: #1a1714;
  padding: 0.45rem 0.55rem;
  border: 1px solid #c9c2b4;
  border-radius: 8px;
  background: #fff;
  min-height: 2.4rem;
}

.acc-attach {
  grid-template-columns: 12rem minmax(10rem, 1fr) minmax(12rem, 1.2fr) auto;
}

.acc-files {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
}

.ticket-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0.15rem 0 0.35rem;
}

.ticket-warranty {
  padding: 0.7rem 0.75rem;
  background: #fffdf8;
  border: 1px solid #e4dccf;
  border-radius: 12px;
}

.ticket-warranty-fields {
  display: grid;
  grid-template-columns: 10.5rem 7.25rem minmax(10rem, 1fr);
  gap: 0.55rem 0.75rem;
  margin-top: 0.7rem;
}

.ticket-warranty-fields[hidden] {
  display: none;
}

.ticket-form .actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.15rem;
}

.ticket-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.crumb .sep {
  margin: 0 0.35rem;
  color: #9a9286;
}

.fields label.warranty-check {
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.95rem;
  color: #1a1714;
}

.fields .warranty-box .fields {
  margin-top: 0;
}

.service-line {
  display: grid;
  grid-template-columns: 11.5rem 13rem minmax(10rem, 1fr) 6.25rem auto auto;
  gap: 0.5rem 0.55rem;
  align-items: end;
  margin: 0 0 0.65rem;
  padding: 0.7rem 0.75rem;
  background: #fffdf8;
  border: 1px solid #e4dccf;
  border-radius: 12px;
}

.warr-flag {
  align-self: end;
  margin-bottom: 0.45rem;
  cursor: pointer;
  user-select: none;
}

.warr-flag.chip-mute {
  opacity: 0.55;
}

.warr-flag:hover,
.warr-flag:focus {
  outline: none;
  opacity: 1;
}

.warr-flag:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1a1714;
}

.service-line-warr {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 10.5rem 7.25rem auto;
  gap: 0.55rem 0.75rem;
  align-items: end;
}

.service-line-warr[hidden] {
  display: none;
}

.service-line-warr [data-warr-clear] {
  justify-self: start;
}

.fields .service-line label,
.ticket-form .service-line label {
  grid-column: auto;
}

.service-line label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #5c564c;
  min-width: 0;
}

.service-line input,
.service-line select {
  font: inherit;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: #1a1714;
  padding: 0.38rem 0.45rem;
  border: 1px solid #c9c2b4;
  border-radius: 8px;
  background: #fff;
  width: 100%;
}

.searchbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.65rem;
  align-items: flex-end;
  margin: 0.75rem 0 1.25rem;
}

.searchbar label,
.searchbar label.grow {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #5c564c;
  min-width: 7.5rem;
}

.searchbar label.grow {
  flex: 1 1 14rem;
  min-width: 12rem;
}

.searchbar input,
.searchbar select {
  font: inherit;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: #1a1714;
  padding: 0.45rem 0.55rem;
  border: 1px solid #c9c2b4;
  border-radius: 8px;
  background: #fff;
  width: 100%;
  min-height: 2.4rem;
}

.datestrip a.ds {
  text-decoration: none;
  color: inherit;
}

table.log td.c-what .meta {
  display: block;
  font-size: 0.75rem;
  color: #5c564c;
}

.logbar label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #5c564c;
  min-width: 0;
}

.logbar label.grow,
.logbar .grow { min-width: 8rem; }

.logbar .field-lab {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #5c564c;
}

.logbar input,
.logbar select {
  font: inherit;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: #1a1714;
  padding: 0.38rem 0.45rem;
  border: 1px solid #c9c2b4;
  border-radius: 8px;
  background: #fff;
  width: 100%;
}

table.log th,
table.log td {
  padding: 0.4rem 0.55rem 0.4rem 0;
  vertical-align: top;
}

body.app th.sort-th {
  user-select: none;
}

body.app .sort-btn {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

body.app .sort-btn:hover {
  color: #1a1714;
}

body.app .sort-btn:focus-visible {
  outline: 3px solid #9a3d1a;
  outline-offset: 2px;
}

body.app th.sort-th[aria-sort="ascending"] .sort-btn::after,
body.app th.sort-th[aria-sort="descending"] .sort-btn::after {
  content: '';
  display: inline-block;
  margin-left: 0.3rem;
  border: 0.28rem solid transparent;
}

body.app th.sort-th[aria-sort="ascending"] .sort-btn::after {
  border-bottom-color: #1a1714;
  transform: translateY(-0.1rem);
}

body.app th.sort-th[aria-sort="descending"] .sort-btn::after {
  border-top-color: #1a1714;
  transform: translateY(0.1rem);
}

table.log th {
  white-space: nowrap;
}

table.log .c-ticket {
  width: 4.6rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}
table.log .c-date { width: 6.4rem; white-space: nowrap; }
table.log .c-kind { width: 6.5rem; white-space: nowrap; }
table.log .c-shop { width: 11.5rem; }
table.log .c-unit { width: 6.5rem; white-space: nowrap; }
table.log .c-print { width: 3.5rem; }
table.log .c-num {
  width: 6.4rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table.log td.c-what,
table.log td.c-shop {
  word-break: break-word;
}

table.log .chip {
  margin: 0 0.25rem 0.2rem 0;
}

table.log .sub {
  display: block;
  font-size: 0.75rem;
  color: #5c564c;
  font-weight: 400;
}

form.inline { display: inline; margin: 0; }

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; }
  .topbar {
    justify-content: flex-start;
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 0.65rem 1rem;
    background: #f3efe6;
  }
  .side {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 80;
    width: min(18.5rem, 86vw);
    min-height: 100dvh;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 1.5rem;
    padding: 1.35rem 1.1rem 1.5rem;
  }
  body.nav-open .side { transform: none; }
  body.nav-open .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(26, 23, 20, 0.45);
  }
  .side-nav { flex-direction: column; flex-wrap: nowrap; }
  .side-foot { margin-top: auto; }
  .dash-grid,
  .hero { grid-template-columns: 1fr; }
  .pagehead { flex-wrap: wrap; }
  .pagehead-end { flex-wrap: wrap; justify-content: flex-end; }
  .searchbar label { flex: 1 1 8.5rem; }
  .searchbar label.grow { flex: 1 1 100%; }
  .tablewrap { -webkit-overflow-scrolling: touch; }
  .ticket-visit {
    grid-template-columns: 10.5rem minmax(11rem, 1fr);
  }
  .ticket-visit .f-miles {
    max-width: 7.25rem;
  }
  .service-line {
    grid-template-columns: 11.5rem 13rem minmax(8rem, 1fr) 6.25rem;
  }
  .service-line .warr-flag,
  .service-line [data-line-remove] {
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .service-line { grid-template-columns: 1fr 1fr; }
  .service-line label.grow { grid-column: 1 / -1; }
  .service-line .f-cost { width: 6.25rem; }
  .service-line .warr-flag,
  .service-line [data-line-remove] { justify-self: start; }
  .service-line-warr { grid-template-columns: 1fr 7.25rem; }
  .service-line-warr [data-warr-clear] { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  body.app main.wide,
  body.app main.dash,
  body.app main.narrow {
    width: calc(100% - 1.25rem);
    padding: 0 0.25rem;
  }
  body.app h1 { font-size: 1.45rem; }
  .pagehead { flex-direction: column; align-items: stretch; gap: 0.75rem; }
  .pagehead .actions { width: 100%; }
  .pagehead .actions .btn { flex: 1 1 auto; }
  .you-form .you-half,
  .you-form .you-third { grid-column: 1 / -1; }
  .fields { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .fields label { grid-column: span 3; }
  .fields label.span-2,
  .fields label.span-3 { grid-column: span 3; }
  .fields label.span-4,
  .fields label.span-5,
  .fields label.span-6,
  .fields label.span-8 { grid-column: span 6; }
  .logbar { grid-template-columns: 1fr 1fr; }
  .logbar label.grow,
  .logbar .file,
  .logbar .grow { grid-column: 1 / -1; }
  .logbar.attach,
  .logbar.papers { grid-template-columns: 1fr; }
  .logbar .warranty-box { grid-template-columns: 1fr; }
  .searchbar { flex-direction: column; align-items: stretch; }
  .searchbar label,
  .searchbar label.grow { min-width: 0; flex: 1 1 auto; }
  .searchbar input,
  .searchbar select,
  .ticket-form input,
  .ticket-form select,
  .ticket-form textarea,
  .todo-add input,
  .fields input,
  .fields select,
  .fields textarea {
    font-size: 16px;
  }
  .acc-visit,
  .acc-place,
  .acc-party,
  .acc-veh,
  .acc-test { grid-template-columns: 1fr 1fr; }
  .acc-visit .f-shop,
  .acc-place .f-street,
  .acc-veh .f-vin { grid-column: 1 / -1; }
  .acc-attach { grid-template-columns: 1fr; }
  .ticket-visit { grid-template-columns: 1fr 7.25rem; }
  .ticket-visit .f-date { grid-column: 1; }
  .ticket-visit .f-miles { grid-column: 2; max-width: none; }
  .ticket-visit .f-shop,
  .ticket-visit .f-mech,
  .ticket-visit .f-unit { grid-column: 1 / -1; }
  .ticket-visit-short { grid-template-columns: 1fr 7.25rem 6.25rem; }
  .ticket-visit-short .f-cost { grid-column: auto; }
  .ticket-why { grid-template-columns: 1fr; }
  .ticket-warranty-fields { grid-template-columns: 1fr 7.25rem; }
  .ticket-warranty-fields .f-file { grid-column: 1 / -1; }
  .ticket-line-bar { flex-wrap: wrap; }
  .ticket-line-bar-end { margin-left: auto; }
  .service-line { grid-template-columns: 1fr 1fr; }
  .service-line label.grow { grid-column: 1 / -1; }
  .service-line .f-cost { width: 6.25rem; }
  .service-line .warr-flag,
  .service-line [data-line-remove] { justify-self: start; }
  .service-line-warr { grid-template-columns: 1fr 7.25rem; }
  .service-line-warr [data-warr-clear] { grid-column: 1 / -1; }
  .ticket-actions { flex-wrap: wrap; }
  .lookup-bar { grid-template-columns: 1fr; }
  .lookup-bar button[type="submit"] { grid-column: 1; grid-row: auto; }
  .hit { grid-template-columns: 1fr; }
  .hit .chip,
  .hit form,
  .hit .btn { justify-self: start; }
  .facts { grid-template-columns: 1fr; gap: 0.15rem 0; }
  .facts dt { margin-top: 0.45rem; }
  .app .tabs { gap: 0.35rem 0.75rem; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* Membership slots on the dashboard.
   How many records the membership includes, how many are in use, and what the
   next monthly run would charge. On the front page deliberately: nobody should
   learn what their fleet costs from an invoice.
   The left rule carries the state, not a fill colour — the words say it too, so
   it still reads on a mono screen and to somebody who cannot tell the two
   colours apart. */
.slots { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.slots__head { min-width: 0; }
.slots__go { flex: 0 0 auto; }
.slots.is-close { border-left: 4px solid #c4842a; }
.slots.is-over { border-left: 4px solid #9b2414; }
@media (max-width: 560px) {
  .slots { align-items: flex-start; }
  .slots__go { width: 100%; }
  .slots__go .btn { width: 100%; text-align: center; }
}

/* Investigator handover: the one-time password, the link to copy, and the
   warning when there is no USDOT for them to type. */
.pw-once {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.15rem; letter-spacing: .06em;
  padding: .35rem .6rem; border: 1px solid var(--rule, #d7d2c8);
  border-radius: 6px; background: #fff; user-select: all;
}
.copy-src { width: min(34rem, 100%); font-size: .85rem; }
.warn-line { color: #8a4b12; margin: .35rem 0 0; }
