/* DK Construction — "Job Board".
   Dark ops-terminal aesthetic: near-black console surfaces, IBM Plex Mono for
   structure and data, DK gold as the amber phosphor accent, flat fills, hairline
   borders, zero gradients. Precision over decoration.
   UX laws still hold: big readable text, 44px+ tap targets, one clear action. */

:root {
  --bg: #0a0e12;
  --panel: #10161d;         /* cards */
  --well: #0c1117;          /* inputs, inset wells */
  --elev: #151d26;          /* hover / raised */
  --line: #1e2833;          /* hairlines */
  --line-strong: #2c3947;   /* borders on interactive */
  --text: #e6edf3;
  --muted: #8b98a5;
  --amber: #e0a93b;         /* DK gold = phosphor accent */
  --amber-hi: #f5b301;
  --blue: #4f94d4;
  --blue-deep: #2f6fb0;
  --green: #3fb950;
  --green-deep: #238636;
  --red: #e5534b;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --gutter: max(16px, calc((100% - 608px) / 2));
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg);
  /* faint CRT scanlines — texture, not costume */
  background-image: repeating-linear-gradient(0deg,
    rgba(230, 237, 243, 0.017) 0px, rgba(230, 237, 243, 0.017) 1px,
    transparent 1px, transparent 3px);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px 130px; }
.ic { flex: 0 0 auto; }

a, button, input, textarea, select { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ---- Top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(10, 14, 18, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  display: flex; align-items: center; gap: 12px;
  padding: 10px var(--gutter);
}
.topbar img { height: 40px; width: 40px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line-strong); }
.topbar .brand { display: flex; flex-direction: column; line-height: 1.15; }
.topbar .title {
  font-family: var(--font-mono); font-size: 18px; font-weight: 700;
  letter-spacing: 0.03em;
}
.topbar .title .sl { color: var(--amber); font-weight: 600; }
.topbar .brand-sub {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted); margin-top: 2px;
}
.topbar .spacer { flex: 1; }
.topbar .logout {
  background: transparent; border: 1px solid var(--line-strong);
  color: var(--muted); font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  min-height: 44px; padding: 0 14px; border-radius: 8px; cursor: pointer;
  letter-spacing: 0.04em;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.topbar .logout:hover { color: var(--text); border-color: var(--muted); }

/* ---- Chrome panel (feed greeting + docket) ---- */
.chrome {
  position: relative;
  background: linear-gradient(180deg, #0d131a 0%, var(--bg) 100%);
  padding: 16px var(--gutter) 20px;
  overflow: hidden;
}
.chrome::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(480px 200px at 85% -30%, rgba(224, 169, 59, 0.09), transparent 70%);
}
.chrome > * { position: relative; }
.hello {
  font-family: var(--font-mono); font-size: 20px; font-weight: 600;
  margin: 2px 0 0; line-height: 1.3; color: var(--text);
  animation: rise 0.4s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.hello::before { content: "> "; color: var(--amber); font-weight: 700; }
.cursor {
  display: inline-block; width: 0.55em; height: 1.05em; margin-left: 7px;
  background: var(--amber); vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}
.hello-sub {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
  margin: 6px 0 0 1.15em;
  animation: rise 0.4s cubic-bezier(0.2, 0.7, 0.3, 1) 0.05s both;
}

/* ---- Docket: the two numbers that make him money, both tappable ---- */
.docket {
  display: flex; align-items: stretch; margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: 10px; overflow: hidden;
  animation: rise 0.4s cubic-bezier(0.2, 0.7, 0.3, 1) 0.1s both;
}
.docket-cell {
  flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 12px;
  padding: 14px 14px 14px 16px; text-decoration: none; color: inherit;
  transition: background 0.15s ease;
}
.docket-cell + .docket-cell { border-left: 1px dashed var(--line-strong); }
@media (hover: hover) { .docket-cell:hover { background: var(--elev); } }
.docket-cell:active { background: var(--elev); }
.docket-count {
  font-family: var(--font-mono); font-weight: 700; font-size: 38px; line-height: 0.9;
  color: var(--amber);
  text-shadow: 0 0 18px rgba(224, 169, 59, 0.35);
}
.docket-out .docket-count { color: var(--blue); text-shadow: none; }
.docket-count.zero { color: var(--muted); text-shadow: none; }
.docket-side { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.docket-tag {
  font-family: var(--font-mono); font-weight: 600; font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text); line-height: 1.35;
}
.docket-val { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--muted); }

/* Hazard stripe: the one construction artifact, dimmed to fit the console. */
.hazard {
  height: 5px;
  background-image: repeating-linear-gradient(-45deg,
    #b8892f 0 10px, #10161d 10px 20px);
  border-bottom: 1px solid var(--line);
}

/* ---- Headings ---- */
h1 {
  font-family: var(--font-mono); font-size: 26px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.01em; line-height: 1.2; margin: 10px 0 6px;
}
h2 {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 14px;
  display: flex; align-items: center; gap: 10px;
}
h2::before { content: ""; width: 14px; height: 2px; background: var(--amber); flex: 0 0 auto; }
h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sub { color: var(--muted); font-size: 16px; margin: 0 0 18px; }
.sec-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sec-head h2 { flex: 1; margin: 0; }
.sec-head h2::after { display: none; }

/* ---- Filter toggles ---- */
.filters {
  display: flex; gap: 8px; overflow-x: auto; padding: 16px 0;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  background: var(--panel); color: var(--muted);
  border: 1px solid var(--line-strong); border-radius: 8px;
  min-height: 46px; padding: 0 16px; font-family: var(--font-mono); font-size: 14px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip.active { background: var(--amber); color: #141003; border-color: var(--amber); font-weight: 700; }
.chip-n { font-family: var(--font-mono); font-size: 13px; font-weight: 600; opacity: 0.75; }
.chip-n::before { content: "("; }
.chip-n::after { content: ")"; }

/* ---- Work-order ticket ---- */
.ticket {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow);
  padding: 0 16px 16px; margin-bottom: 14px; overflow: hidden;
  animation: rise 0.34s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  animation-delay: calc(min(var(--i, 0), 8) * 45ms);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
@media (hover: hover) {
  .ticket:hover { border-color: var(--line-strong); transform: translateY(-1px); }
}
/* status rail, color-coded */
.ticket::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line-strong); }
.ticket.status-new::before    { background: var(--amber); box-shadow: 0 0 10px rgba(224, 169, 59, 0.5); }
.ticket.status-quoted::before { background: var(--blue); }
.ticket.status-won::before    { background: var(--green); }
.ticket.status-done::before   { background: var(--line-strong); }
.ticket.status-lost::before   { background: var(--red); }
.ticket:active { transform: translateY(1px); }
.ticket-link { text-decoration: none; color: inherit; display: block; cursor: pointer; }

.ticket-top {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0 11px; margin-bottom: 2px;
  border-bottom: 1px dashed var(--line);
}
.wo { font-family: var(--font-mono); font-size: 13px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); }
.ticket-when { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.ticket-when.overdue { color: var(--amber); font-weight: 600; }
.ticket-top .stamp { margin-left: auto; }

/* status tag: [ NEW ] — bracketed, phosphor-lit */
.stamp {
  font-family: var(--font-mono); font-size: 13px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; white-space: nowrap;
}
.stamp::before { content: "[ "; opacity: 0.6; }
.stamp::after { content: " ]"; opacity: 0.6; }
.stamp-new    { color: var(--amber-hi); text-shadow: 0 0 12px rgba(245, 179, 1, 0.35); }
.stamp-quoted { color: var(--blue); }
.stamp-won    { color: var(--green); }
.stamp-done   { color: var(--muted); }
.stamp-lost   { color: var(--red); }

.ticket-body { display: flex; gap: 14px; align-items: center; padding-top: 9px; }
.ticket-text { flex: 1; min-width: 0; }
.ticket-thumb {
  flex: 0 0 auto; width: 72px; height: 72px; border-radius: 8px; object-fit: cover;
  border: 1px solid var(--line-strong);
}
.job-title {
  font-family: var(--font-mono); font-size: 21px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.01em; margin: 0 0 3px; line-height: 1.2; color: var(--text);
}
.job-meta { color: var(--muted); font-size: 16px; margin: 0; }
.job-meta .dot { margin: 0 8px; color: var(--amber); font-weight: 600; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 52px; padding: 0 18px; width: 100%;
  font-family: var(--font-mono); font-size: 16px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; border-radius: 8px; color: #fff;
  transition: filter 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn.is-busy { opacity: 0.65; pointer-events: none; }
.btn-call    { background: var(--green-deep); border-color: #2ea043; }
.btn-text    { background: var(--blue-deep); border-color: #3d80c2; }
.btn-primary { background: var(--amber); border-color: var(--amber-hi); color: #141003; }
.btn-gold    { background: var(--amber); border-color: var(--amber-hi); color: #141003; }
.btn-ghost   { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--muted); filter: none; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.btn-row.one { grid-template-columns: 1fr; }

.mini-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 14px; border-radius: 8px; text-decoration: none; cursor: pointer;
  background: transparent; color: var(--text); border: 1px solid var(--line-strong);
  font-family: var(--font-mono); font-size: 13px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; white-space: nowrap;
  transition: border-color 0.15s ease;
}
.mini-btn:hover { border-color: var(--muted); }

/* ---- Floating "New job" action ---- */
.fab {
  position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 30;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 56px; padding: 0 20px; border-radius: 10px; text-decoration: none; cursor: pointer;
  background: var(--amber); color: #141003; border: 1px solid var(--amber-hi);
  font-family: var(--font-mono); font-size: 16px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 24px rgba(224, 169, 59, 0.25);
  animation: fab-in 0.34s cubic-bezier(0.2, 0.7, 0.3, 1) 0.2s both;
  transition: filter 0.15s ease;
}
.fab:hover { filter: brightness(1.08); }
.fab:active { transform: translateY(1px); }

/* ---- Toast ---- */
.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 40;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  padding: 13px 20px; border-radius: 8px;
  background: var(--elev); border: 1px solid var(--line-strong); border-left: 3px solid var(--amber);
  color: var(--text); font-family: var(--font-mono); font-weight: 600; font-size: 15px;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow); pointer-events: none; white-space: nowrap;
  animation: toast-in 0.28s ease both, toast-out 0.5s ease 2.6s forwards;
}
.toast .ic { color: var(--amber); }
.toast-err { border-left-color: var(--red); white-space: normal; max-width: min(90vw, 420px); }
.toast-err .ic { color: var(--red); }

/* ---- Detail head ---- */
.detail-head { display: flex; align-items: center; gap: 12px; margin: 14px 0 2px; }
.detail-head .wo { font-size: 14px; }

/* ---- Detail sections ---- */
.section {
  margin-top: 16px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 18px;
}
.kv { margin: 0 0 14px; }
.kv:last-child { margin-bottom: 0; }
.kv .label { font-family: var(--font-mono); color: var(--muted); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; }
.kv .value { font-size: 18px; }
.kv .value a { color: var(--blue); font-weight: 600; }
.desc {
  background: var(--well); border: 1px solid var(--line); border-left: 3px solid var(--amber);
  border-radius: 8px; padding: 15px 16px; font-size: 18px; white-space: pre-wrap;
}

/* ---- Photos ---- */
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.photos a { display: block; border-radius: 8px; }
.photos img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line-strong); display: block;
  transition: border-color 0.15s ease;
}
@media (hover: hover) { .photos a:hover img { border-color: var(--muted); } }
.photo-add {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 60px; border: 1px dashed var(--line-strong); border-radius: 8px;
  background: var(--well); color: var(--text); cursor: pointer;
  font-family: var(--font-mono); font-size: 14px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.photo-add:hover { border-color: var(--amber); }
.photo-add:active { background: var(--elev); }
.photo-add .ic { color: var(--amber); }

/* ---- Notes ---- */
.note { background: var(--well); border: 1px solid var(--line); border-radius: 8px; padding: 13px 15px; margin-bottom: 10px; font-size: 17px; }
.note .when { font-family: var(--font-mono); color: var(--muted); font-size: 11px; margin-top: 6px; letter-spacing: 0.06em; }

/* ---- Forms ---- */
label.field { display: block; font-family: var(--font-mono); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 8px; }
label.field .opt { font-weight: 500; color: var(--muted); text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-size: 13px; }
input[type=text], input[type=tel], input[type=email], input[type=password], textarea, select {
  width: 100%; font-family: var(--font-body); font-size: 18px; padding: 13px 14px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--well); color: var(--text);
  caret-color: var(--amber);
}
input::placeholder, textarea::placeholder { color: #5c6975; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(224, 169, 59, 0.15); }
textarea { resize: vertical; min-height: 96px; }
.stack > * + * { margin-top: 16px; }
.form-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 20px; margin-top: 6px;
}

/* ---- Status picker ---- */
.status-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.status-picker button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; font-family: var(--font-mono); font-size: 15px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--well); color: var(--text);
  transition: border-color 0.15s ease;
}
.status-picker button:hover { border-color: var(--muted); }
.status-picker button:active { transform: translateY(1px); }
.status-picker .stat-lost { color: var(--red); }
.status-picker .stat-new.current    { background: var(--amber); color: #141003; border-color: var(--amber-hi); font-weight: 700; }
.status-picker .stat-quoted.current { background: var(--blue-deep); color: #fff; border-color: var(--blue); font-weight: 700; }
.status-picker .stat-won.current    { background: var(--green-deep); color: #fff; border-color: var(--green); font-weight: 700; }
.status-picker .stat-done.current   { background: #39434e; color: #fff; border-color: #4d5a66; font-weight: 700; }
.status-picker .stat-lost.current   { background: #b03e37; color: #fff; border-color: var(--red); font-weight: 700; }

/* ---- Login ---- */
.page-login {
  min-height: 100vh;
  min-height: 100svh;
  background-color: var(--bg);
  background-image:
    radial-gradient(700px 380px at 50% -10%, rgba(224, 169, 59, 0.10), transparent 60%),
    repeating-linear-gradient(0deg,
      rgba(230, 237, 243, 0.017) 0px, rgba(230, 237, 243, 0.017) 1px,
      transparent 1px, transparent 3px);
}
.login-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 26px 22px; margin-top: clamp(24px, 8vh, 80px);
  animation: rise 0.4s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.login-card h1 { margin-top: 0; }
.login-card h1::before { content: "> "; color: var(--amber); }

/* ---- Misc ---- */
.empty {
  text-align: center; color: var(--muted); padding: 44px 24px 40px; font-size: 17px;
  background: var(--panel); border: 1px dashed var(--line-strong); border-radius: 10px;
  animation: rise 0.34s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.empty .ic { color: var(--amber); opacity: 0.8; }
.empty-title {
  font-family: var(--font-mono); font-size: 18px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text); margin: 16px 0 8px;
}
.empty-sub { margin: 0 auto; max-width: 42ch; }
.empty-cta { width: auto; margin-top: 20px; }
.back {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); color: var(--muted); text-decoration: none; font-weight: 600;
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em;
  margin: 16px 0 2px; min-height: 44px;
  transition: color 0.15s ease;
}
.back:hover { color: var(--text); }
.banner { background: rgba(63, 185, 80, 0.1); color: var(--green); border: 1px solid rgba(63, 185, 80, 0.35); border-radius: 8px; padding: 13px 16px; font-weight: 600; font-size: 16px; margin-bottom: 14px; }
.error { background: rgba(229, 83, 75, 0.1); color: #f0a8a3; border: 1px solid rgba(229, 83, 75, 0.4); border-radius: 8px; padding: 13px 16px; font-weight: 600; margin-bottom: 14px; }

/* ---- Quote builder (terminal ledger) ---- */
.quote-cta { margin-top: 12px; }
.quote-cta .q-lbl { white-space: nowrap; }
.quote-cta .q-side {
  margin-left: auto; display: flex; flex-direction: column; align-items: flex-end;
  gap: 1px; line-height: 1.2; text-align: right;
}
.quote-cta .q-amt { font-size: 16px; white-space: nowrap; }
.q-flag { font-family: var(--font-mono); font-size: 11px; opacity: 0.8; white-space: nowrap; }
.chase-hint {
  display: flex; align-items: center; gap: 8px; margin: 10px 2px 0;
  color: var(--amber); font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  letter-spacing: 0.02em;
}
.kv-missing { color: var(--muted); font-size: 15px; margin: 6px 0 0; }
.kv-missing a { color: var(--blue); font-weight: 600; }
.stamp-draft { color: var(--muted); }
.sent-when { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

/* Numbered steps: the builder reads as a worksheet — 1 list, 2 check, 3 terms, 4 send. */
h2.step::before { display: none; }
.step-n {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 24px; height: 24px; border: 1px solid rgba(224, 169, 59, 0.55); border-radius: 6px;
  color: var(--amber); font-size: 12px; font-weight: 700;
}
.hint { color: var(--muted); font-size: 15px; margin: -4px 0 12px; }
.qrow {
  background: var(--well); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; margin-bottom: 10px;
}
.qrow input, .qrow select { background: var(--bg); }
.qrow-top { display: flex; gap: 8px; }
.qrow-top input { flex: 1; min-width: 0; }
.qrow-del {
  flex: 0 0 48px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line-strong); border-radius: 8px;
  color: var(--muted); cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.qrow-del:hover { color: var(--red); border-color: var(--red); }
.qrow-grid { display: grid; grid-template-columns: 0.8fr 1.1fr 1.1fr; gap: 8px; margin-top: 10px; }
.qcell { display: block; }
.qcell span {
  display: block; font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 5px;
}
.qcell input, .qcell select { padding: 11px 10px; font-size: 17px; }
.qrow-amt {
  display: flex; justify-content: flex-end; align-items: baseline; gap: 10px; margin-top: 10px;
  border-top: 1px dashed var(--line); padding-top: 9px;
}
.qeq { font-family: var(--font-mono); font-size: 14px; color: var(--muted); }
.qamt { font-family: var(--font-mono); font-size: 18px; font-weight: 700; }
/* A line with the work written but no price yet: the one thing left is HIS number. */
.qrow.needs-price input[name=price] { border-color: rgba(224, 169, 59, 0.55); }
.qrow.needs-price .qeq, .qrow.needs-price .qamt { color: var(--amber); }
.qtotal-need {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--amber);
  text-transform: uppercase; letter-spacing: 0.08em;
}
#add-line { margin-top: 4px; }
#qform textarea[name=terms] { min-height: 132px; }
.pb { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 14px; }
.pb summary {
  display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 14px;
  cursor: pointer; list-style: none;
  background: var(--well); border: 1px solid var(--line-strong); border-radius: 8px;
  font-family: var(--font-mono); font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--amber);
  transition: border-color 0.15s ease;
}
.pb summary:hover { border-color: var(--amber); }
.pb summary::-webkit-details-marker { display: none; }
.pb-n { color: var(--muted); }
.pb-chev {
  margin-left: auto; width: 9px; height: 9px; flex: 0 0 auto;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px); transition: transform 0.15s ease;
}
.pb[open] .pb-chev { transform: rotate(-135deg) translateY(-2px); }
.pb-hint { margin: 10px 2px 0; }
.pb-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 12px; }
.pb-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  min-height: 48px; padding: 4px 14px; text-align: left; cursor: pointer;
  background: var(--well); border: 1px solid var(--line-strong); border-radius: 8px;
  color: var(--text); font-family: var(--font-body); font-size: 16px;
  transition: border-color 0.15s ease;
}
.pb-item:hover { border-color: var(--amber); }
.pb-price { font-family: var(--font-mono); font-size: 13px; color: var(--amber); white-space: nowrap; }
.pb-empty { color: var(--muted); font-size: 15px; margin: 14px 0 0; }
.pb-empty a { color: var(--blue); }
.qtotal {
  display: flex; align-items: center; gap: 12px; margin-top: 16px;
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--amber);
  border-radius: 10px; padding: 15px 18px;
  /* Rides the bottom of the screen while Dwayne is up in the line items, then
     docks into place — the running total is never out of sight. */
  position: sticky; bottom: 10px; z-index: 5;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}
.qtotal-side { display: flex; flex-direction: column; gap: 2px; margin-right: auto; }
.qtotal-label { font-family: var(--font-mono); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); }
.qtotal-lines { font-family: var(--font-mono); font-size: 11px; color: var(--muted); opacity: 0.8; }
.qtotal-val {
  font-family: var(--font-mono); font-size: 28px; font-weight: 700; color: var(--amber);
  text-shadow: 0 0 16px rgba(224, 169, 59, 0.3);
}

.sent-fallback {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 14px;
}
.sent-fallback span { color: var(--muted); font-size: 15px; }

/* Quote line on a feed card: the money at a glance, amber when a draft still
   needs finishing. */
.job-quote { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--text); margin: 4px 0 0; }
.jq { font-size: 11px; letter-spacing: 0.06em; }
.jq-draft { color: var(--amber); }
.jq-sent { color: var(--muted); }
.jq-chase { color: var(--amber); text-transform: uppercase; margin-left: 4px; }
.job-meta .no-phone {
  font-family: var(--font-mono); font-size: 11px; color: var(--amber);
  text-transform: uppercase; letter-spacing: 0.06em; margin-left: 10px; white-space: nowrap;
}

.feed-tool {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; width: 100%; margin: 18px 0 4px;
  color: var(--muted); font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em; text-decoration: none;
  border: 1px dashed var(--line-strong); border-radius: 8px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.feed-tool:hover { color: var(--amber); border-color: var(--amber); }

/* ---- Price book page ---- */
.price-row {
  background: var(--well); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; margin-bottom: 12px;
}
.price-row input, .price-row select { background: var(--bg); }
.price-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 8px; margin-top: 10px; }
.price-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.price-actions .mini-btn { justify-content: center; }
.mini-save { color: var(--amber); border-color: rgba(224, 169, 59, 0.45); }
.mini-save:hover { border-color: var(--amber); }
.mini-danger { color: var(--red); border-color: rgba(229, 83, 75, 0.4); }
.mini-danger:hover { border-color: var(--red); }

/* ---- Motion ---- */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fab-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translate(-50%, 6px); }
}
@keyframes blink {
  0%, 55% { opacity: 1; }
  56%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .cursor { opacity: 1; }
}

/* ---- Operations hub: visit banner, today agenda, timeline, compose ---- */
.visit-banner {
  display: flex; align-items: center; gap: 12px; margin: 14px 0 2px;
  background: rgba(224, 169, 59, 0.08); border: 1px solid rgba(224, 169, 59, 0.35);
  border-left: 3px solid var(--amber); border-radius: 10px; padding: 13px 16px;
}
.visit-banner .ic { color: var(--amber); flex: 0 0 auto; }
.visit-when { font-family: var(--font-mono); font-weight: 700; font-size: 16px; line-height: 1.25; }
.visit-sub { font-size: 13px; color: var(--muted); }
.visit-btn { margin-top: 12px; }
.email-btn { margin-top: 10px; }

.agenda { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.agenda-label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin: 2px 0 0 2px;
}
.agenda-item {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit;
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--blue);
  border-radius: 8px; padding: 11px 14px; transition: background 0.15s ease;
}
.agenda-item:hover, .agenda-item:active { background: var(--elev); }
.agenda-item .ic { color: var(--blue); flex: 0 0 auto; }
.agenda-when { font-family: var(--font-mono); font-weight: 700; font-size: 14px; color: var(--text); white-space: nowrap; }
.agenda-who { font-size: 15px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 12px; padding: 10px 0; }
.tl-item + .tl-item { border-top: 1px dashed var(--line); }
.tl-ic {
  flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--well); color: var(--muted);
}
.tl-ic.k-email_sent, .tl-ic.k-quote_sent { color: var(--blue); }
.tl-ic.k-visit_set, .tl-ic.k-text_opened { color: var(--amber); }
.tl-ic.k-lead_in, .tl-ic.k-visit_done { color: var(--green); }
.tl-body { flex: 1; min-width: 0; }
.tl-summary { font-size: 16px; line-height: 1.4; }
.tl-when { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.06em; margin-top: 2px; }

.tmpl-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 6px; margin: 6px 0 4px; scrollbar-width: none; }
.tmpl-row::-webkit-scrollbar { display: none; }
.tmpl-chip {
  flex: 0 0 auto; min-height: 42px; display: inline-flex; align-items: center; padding: 0 14px;
  border-radius: 8px; text-decoration: none; background: var(--well); border: 1px solid var(--line-strong);
  color: var(--muted); font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.tmpl-chip:hover { border-color: var(--muted); color: var(--text); }
.tmpl-chip.on { background: var(--amber); color: #141003; border-color: var(--amber-hi); }

.visit-when-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; }
.ask-toggle { display: flex; align-items: center; gap: 10px; font-size: 16px; color: var(--muted); cursor: pointer; }
.ask-toggle input { width: 22px; height: 22px; accent-color: var(--amber); flex: 0 0 auto; }
input[type=date], input[type=time] {
  width: 100%; font-family: var(--font-mono); font-size: 18px; padding: 12px 14px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--well); color: var(--text);
}
