/* Driveway Brakes
   Asphalt, concrete, curb-paint yellow and caliper red. Barlow, a typeface
   drawn from highway signs, set condensed for headings. */
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("../fonts/barlow-latin-400-normal.81419bf5abb5.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("../fonts/barlow-latin-500-normal.8e986e86d57e.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-latin-600-normal.a1e2a2d7d4c0.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-condensed-latin-600-normal.ba4513495282.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("../fonts/barlow-condensed-latin-700-normal.e1180918b873.woff2") format("woff2"); }

:root {
  --asphalt: #1d262d;
  --asphalt-2: #2c3943;
  --concrete: #eceff0;
  --paper: #ffffff;
  --line: #d3d9dd;
  --steel: #56646e;
  --ink: #141a1f;
  --red: #c5281c;
  --red-dark: #9f1d13;
  --yellow: #f4be1a;
  --green: #1c7448;
  --amber: #a15c00;
  --body: "Barlow", system-ui, sans-serif;
  --display: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); font-size: 17px; line-height: 1.5; color: var(--ink); background: var(--concrete); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; margin: 0 0 .5em; letter-spacing: .005em; }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1em; max-width: 68ch; }
a { color: var(--red-dark); text-underline-offset: 2px; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
small, .muted { color: var(--steel); }
.muted { font-size: .92em; }
[x-cloak] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font: 600 1rem var(--body); padding: .6rem 1.1rem; border: 2px solid var(--asphalt); border-radius: var(--radius); background: var(--paper); color: var(--asphalt); cursor: pointer; text-decoration: none; min-height: 44px; }
.btn:hover { background: var(--concrete); color: var(--asphalt); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn-dark { background: var(--asphalt); color: #fff; }
.btn-dark:hover { background: var(--asphalt-2); color: #fff; }
.btn-quiet { border-color: transparent; background: transparent; padding-inline: .5rem; text-decoration: underline; }
.btn-small { min-height: 34px; padding: .25rem .7rem; font-size: .92rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.btn-google { background: #fff; border-color: var(--line); font-weight: 600; }
.btn-google svg { width: 20px; height: 20px; }

/* Forms */
label, .label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .25rem; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=password], input[type=search], select, textarea {
  width: 100%; font: inherit; padding: .55rem .65rem; border: 1.5px solid #9aa6ae; border-radius: var(--radius); background: #fff; color: var(--ink); min-height: 44px; }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--asphalt); }
.field { margin-bottom: 1rem; }
.field-row { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.check input { width: 20px; height: 20px; margin-top: .15rem; flex: none; accent-color: var(--red); }
.errorlist, .field-error { color: var(--red-dark); font-weight: 600; font-size: .92rem; list-style: none; padding: 0; margin: .25rem 0 0; }
fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; }
legend { font: 700 1.35rem var(--display); padding: 0; margin-bottom: .6rem; }

/* Surfaces */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.panel-head h2, .panel-head h3 { margin: 0; }
.flash { list-style: none; margin: 0 0 1rem; padding: 0; }
.flash li { padding: .7rem 1rem; border-left: 5px solid var(--green); background: #e5f3ec; margin-bottom: .5rem; font-weight: 500; }
.flash li.error { border-color: var(--red); background: #fbe9e7; }
.empty { color: var(--steel); padding: .5rem 0; }
.grid-2 { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
dl.facts dt { color: var(--steel); }
dl.facts dd { margin: 0; font-weight: 500; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .97rem; }
th { text-align: left; font-weight: 600; color: var(--steel); font-size: .88rem; padding: .45rem .6rem; border-bottom: 2px solid var(--line); white-space: nowrap; }
td { padding: .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr.link-row:hover { background: #f6f8f8; }

/* Status pills */
.pill { display: inline-block; font-size: .82rem; font-weight: 600; padding: .1rem .55rem; border-radius: 99px; background: #e3e8ea; color: var(--asphalt); white-space: nowrap; }
.pill.requested, .pill.pending, .pill.sent, .pill.invited, .pill.onboarding { background: #fdf0c4; color: #5c4400; }
.pill.approved, .pill.accepted, .pill.active, .pill.completed, .pill.delivered { background: #d9efe3; color: #125234; }
.pill.scheduled, .pill.in_progress, .pill.quoted { background: #dbe7f3; color: #17406a; }
.pill.cancelled, .pill.declined, .pill.failed, .pill.inactive, .pill.skipped { background: #f8dcd9; color: #7d150d; }

/* Tabs */
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; margin-bottom: 1rem; border-bottom: 2px solid var(--line); }
.tabs a { padding: .45rem .8rem; text-decoration: none; color: var(--steel); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a[aria-current] { color: var(--ink); border-color: var(--red); }

/* Public site ------------------------------------------------------- */
.curb { height: 8px; background: repeating-linear-gradient(-45deg, var(--yellow) 0 18px, var(--asphalt) 18px 36px); }
.site-head { background: var(--asphalt); color: #fff; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .8rem; flex-wrap: wrap; }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 1.25rem; }
.narrow { max-width: 720px; }
.brand { font: 700 1.7rem var(--display); color: #fff; text-decoration: none; letter-spacing: .01em; }
.brand span { color: var(--yellow); }
.brand:hover { color: #fff; }
.site-nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.site-nav a { color: #fff; text-decoration: none; font-weight: 500; }
.site-nav a:hover, .site-nav a[aria-current] { text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.site-nav form { margin: 0; }
.site-nav .linklike { background: none; border: 0; color: #fff; font: inherit; font-weight: 500; cursor: pointer; padding: 0; }
.page { padding-block: 2rem 4rem; }

.hero { background: var(--asphalt); color: #fff; padding-block: 3rem 4rem; }
.hero .wrap { display: grid; gap: 2.5rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.05fr .95fr; } }
.hero h1 { font-size: clamp(2.9rem, 7.2vw, 5.4rem); line-height: .93; margin-bottom: 1.25rem; text-wrap: balance; }
.hero p { font-size: 1.2rem; color: #d7dee2; max-width: 44ch; }
.hero ul { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .5rem; color: #d7dee2; }
.hero li { padding-left: 1.4rem; position: relative; }
.hero li::before { content: ""; position: absolute; left: 0; top: .6em; width: .7rem; height: 4px; background: var(--yellow); }

/* The estimator is drawn as a shop work order. */
.ticket { background: #fffdf5; color: var(--ink); border-radius: var(--radius); padding: 1.4rem 1.4rem 1.2rem; position: relative; box-shadow: 0 18px 0 -10px rgba(0,0,0,.35); }
.ticket::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 10px; border-radius: var(--radius) var(--radius) 0 0; background: var(--red); }
.hero .ticket p { color: var(--steel); font-size: 1rem; }
.hero .ticket .fine { font-size: .88rem; }
.ticket h2 { font-size: 1.9rem; margin: .4rem 0 .2rem; }
.ticket-group { font: 600 1rem var(--display); color: var(--steel); margin: 1rem 0 .2rem; border-bottom: 1px dashed #b9b29a; padding-bottom: .2rem; }
.ticket-line { display: grid; grid-template-columns: 1fr auto; gap: .2rem .8rem; align-items: center; padding: .5rem 0; border-bottom: 1px dashed #d8d2bc; }
.ticket-line label { margin: 0; font-weight: 500; display: flex; gap: .6rem; align-items: center; cursor: pointer; }
.ticket-line input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--red); flex: none; }
.ticket-line .price { font-variant-numeric: tabular-nums; color: var(--steel); white-space: nowrap; }
.ticket-total { display: flex; justify-content: space-between; align-items: baseline; margin: 1rem 0; font: 700 1.2rem var(--display); }
.ticket-total output { font-size: 2.3rem; font-variant-numeric: tabular-nums; }
.ticket .fine { font-size: .88rem; color: var(--steel); margin: .7rem 0 0; }
.qty { display: inline-flex; align-items: center; gap: .3rem; }
.qty button { width: 32px; height: 32px; border: 1.5px solid var(--asphalt); background: #fff; border-radius: var(--radius); font: 600 1.1rem var(--body); cursor: pointer; line-height: 1; }
.qty span { min-width: 1.6ch; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

.band { padding-block: 3.5rem; }
.band-white { background: var(--paper); }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps li { counter-increment: step; border-top: 4px solid var(--asphalt); padding-top: .8rem; }
.steps li::before { content: counter(step); font: 700 2.6rem var(--display); color: var(--red); display: block; line-height: 1; margin-bottom: .3rem; }
.steps h3 { margin-bottom: .3rem; }
.price-list { display: grid; gap: 0 3rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); margin-top: 1.5rem; }
.price-list h3 { border-bottom: 3px solid var(--asphalt); padding-bottom: .3rem; margin-top: 1.2rem; }
.price-item { display: grid; grid-template-columns: 1fr auto; gap: .1rem 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.price-item strong { font-weight: 600; }
.price-item .price { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-item p { grid-column: 1 / -1; margin: 0; color: var(--steel); font-size: .95rem; }
.site-foot { background: var(--asphalt); color: #c5ced3; padding-block: 2rem; font-size: .95rem; }
.site-foot a { color: #fff; }

/* Bell menu */
.bell { position: relative; }
.bell > button { background: none; border: 0; color: inherit; cursor: pointer; padding: .3rem; position: relative; min-width: 40px; min-height: 40px; }
.bell svg { width: 22px; height: 22px; }
.bell .count { position: absolute; top: 0; right: 0; background: var(--yellow); color: var(--ink); font-size: .72rem; font-weight: 700; border-radius: 99px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; }
.bell-menu { position: absolute; right: 0; top: calc(100% + 6px); width: min(340px, 90vw); background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(20,26,31,.25); z-index: 50; max-height: 70vh; overflow: auto; }
.bell-menu a, .bell-menu div.item { display: block; padding: .7rem .9rem; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.bell-menu a:hover { background: var(--concrete); }
.bell-menu .new { border-left: 4px solid var(--yellow); }
.bell-menu strong { display: block; font-weight: 600; }
.bell-menu small { display: block; }

/* Conversation thread */
.thread { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.bubble { max-width: min(520px, 88%); padding: .6rem .8rem; border-radius: 10px; background: #fff; border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.theirs { align-self: flex-start; border-bottom-left-radius: 2px; }
.bubble.ours { align-self: flex-end; background: var(--asphalt); color: #fff; border-color: var(--asphalt); border-bottom-right-radius: 2px; }
.bubble.automated { background: #e7ebed; color: var(--ink); border-color: var(--line); }
.bubble .meta { display: block; font-size: .78rem; opacity: .75; margin-top: .25rem; white-space: normal; }
.bubble.failed { outline: 2px solid var(--red); }
.composer textarea { margin-bottom: .5rem; }
.composer .channels { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.composer .channels label { font-weight: 500; display: flex; gap: .35rem; align-items: center; margin: 0; }

/* Dashboard shell --------------------------------------------------- */
body.dash { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; font-size: 16px; }
.dash-side { background: var(--asphalt); color: #fff; padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.dash-side .brand { font-size: 1.45rem; padding: .2rem .5rem .9rem; display: block; }
.dash-nav { display: grid; gap: 2px; }
.dash-nav a { display: flex; justify-content: space-between; align-items: center; padding: .55rem .65rem; color: #d7dee2; text-decoration: none; font-weight: 500; border-radius: var(--radius); border-left: 4px solid transparent; }
.dash-nav a:hover { background: var(--asphalt-2); color: #fff; }
.dash-nav a[aria-current] { background: var(--asphalt-2); color: #fff; border-left-color: var(--yellow); }
.dash-nav .badge { background: var(--yellow); color: var(--ink); font-size: .78rem; font-weight: 700; border-radius: 99px; padding: 0 .45rem; }
.dash-side .foot { margin-top: auto; padding: .75rem .5rem 0; border-top: 1px solid var(--asphalt-2); font-size: .9rem; color: #b8c2c8; display: grid; gap: .5rem; }
.dash-side .foot a, .dash-side .foot button { color: #fff; }
.dash-side .foot .row { display: flex; justify-content: space-between; align-items: center; }
.dash-side .linklike { background: none; border: 0; font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
#main { padding: 1.5rem clamp(1rem, 3vw, 2.25rem) 4rem; min-width: 0; }
#main.htmx-request { opacity: .55; transition: opacity .15s; }
.screen-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.screen-head h1 { margin: 0; font-size: 2.1rem; }
.crumb { font-size: .92rem; margin-bottom: .3rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.25rem; }
.stats a { padding: 1rem 1.1rem; text-decoration: none; color: var(--ink); border-right: 1px solid var(--line); }
.stats a:last-child { border-right: 0; }
.stats a:hover { background: #f6f8f8; }
.stats b { display: block; font: 700 2.4rem var(--display); line-height: 1; }
.stats span { color: var(--steel); font-size: .93rem; }
@media (max-width: 860px) {
  body.dash { grid-template-columns: 1fr; }
  .dash-side { position: static; height: auto; padding: .6rem .75rem; }
  .dash-side .brand { padding-bottom: .5rem; }
  .dash-nav { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; padding-bottom: .3rem; }
  .dash-nav a { border-left: 0; border-bottom: 3px solid transparent; }
  .dash-nav a[aria-current] { border-bottom-color: var(--yellow); }
  .dash-side .foot { border: 0; grid-auto-flow: column; justify-content: space-between; padding-top: .4rem; }
}

/* Week schedule */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.day { border-right: 1px solid var(--line); min-height: 220px; padding: .5rem; min-width: 0; }
.day:last-child { border-right: 0; }
.day h3 { font-size: 1.05rem; margin: 0 0 .5rem; padding-bottom: .3rem; border-bottom: 2px solid var(--line); display: flex; justify-content: space-between; }
.day.today h3 { border-color: var(--red); color: var(--red-dark); }
.appt { display: block; text-decoration: none; color: var(--ink); background: #eef3f7; border-left: 4px solid #2f6aa3; border-radius: 2px; padding: .35rem .45rem; margin-bottom: .4rem; font-size: .88rem; line-height: 1.3; overflow-wrap: anywhere; }
.appt:hover { background: #e0e9f1; color: var(--ink); }
.appt.pending, .appt.unassigned, .appt.declined { border-left-color: var(--yellow); background: #fdf6dc; }
.appt.completed { border-left-color: var(--green); background: #e7f3ec; }
.appt b { display: block; }
@media (max-width: 1000px) { .week { grid-template-columns: 1fr; } .day { border-right: 0; border-bottom: 1px solid var(--line); min-height: 0; } }

/* Messages screen */
.inbox { display: grid; grid-template-columns: 290px 1fr; gap: 1.25rem; align-items: start; }
.inbox-list { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); max-height: 75vh; overflow: auto; }
.inbox-list a { display: block; padding: .7rem .9rem; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.inbox-list a[aria-current] { background: var(--concrete); box-shadow: inset 4px 0 0 var(--red); }
.inbox-list a.unread strong::after { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--red); margin-left: .4rem; }
.inbox-list small { display: block; }
@media (max-width: 900px) { .inbox { grid-template-columns: 1fr; } .inbox-list { max-height: 220px; } }

/* Quote editor and quote page */
.q-line { display: grid; grid-template-columns: 96px minmax(70px, .7fr) minmax(130px, 1.3fr) auto auto; gap: .4rem .6rem; align-items: center; padding: .6rem 0; border-bottom: 1px dashed var(--line); }
.q-line .q-desc { grid-column: 1 / -1; }
.q-line input, .q-line select { min-height: 38px; padding: .3rem .45rem; }
.q-line label { display: flex; align-items: center; gap: .4rem; margin: 0; font-weight: 500; font-size: .9rem; white-space: nowrap; }
.q-line label input[type=number] { min-width: 0; }
.q-line .q-tax input { width: 18px; height: 18px; accent-color: var(--red); }
@media (max-width: 520px) { .q-line { grid-template-columns: 1fr 1fr; } }
.totals { margin-left: auto; width: min(100%, 300px); }
.totals div { display: flex; justify-content: space-between; padding: .2rem 0; font-variant-numeric: tabular-nums; }
.totals .grand { font: 700 1.5rem var(--display); border-top: 3px solid var(--asphalt); margin-top: .3rem; padding-top: .4rem; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: .45rem 0 .45rem 1rem; border-left: 3px solid var(--line); margin-left: .3rem; }
.timeline small { display: block; }

/* Checklist */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: grid; grid-template-columns: auto 1fr auto; gap: .75rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #9aa6ae; display: grid; place-items: center; font-weight: 700; color: transparent; }
.tick.done { background: var(--green); border-color: var(--green); color: #fff; }

/* Mechanic portal and customer account share the public header. */
.subnav { background: var(--asphalt-2); }
.subnav .wrap { display: flex; gap: 1.2rem; overflow-x: auto; }
.subnav a { color: #d7dee2; text-decoration: none; font-weight: 500; padding: .6rem 0; border-bottom: 3px solid transparent; white-space: nowrap; }
.subnav a[aria-current] { color: #fff; border-color: var(--yellow); }
.job-card { display: block; text-decoration: none; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-left: 6px solid var(--asphalt); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: .75rem; }
.job-card:hover { color: var(--ink); border-color: var(--asphalt); }
.job-card.attention { border-left-color: var(--yellow); }
.job-card .top { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; flex-wrap: wrap; }
.job-card b { font: 600 1.25rem var(--display); }
.notice { background: #fdf0c4; border-left: 6px solid var(--yellow); padding: .9rem 1rem; margin-bottom: 1.25rem; }
.notice p:last-child { margin: 0; }
.big-number { font: 700 3rem var(--display); line-height: 1; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-head, .subnav, .site-foot, .curb, .btn-row, .no-print { display: none !important; } body { background: #fff; } }
