:root {
  --ink: #161616;
  --paper: #f3efe6;
  --card: #fffcf7;
  --black: #0b0b0b;
  --amber: #e08a12;
  --amber-dark: #c4740a;
  --muted: #5c5852;
  --line: #d9d2c6;
  --ok: #2d6a3a;
  --ok-bg: #e5f3e8;
  --bad: #8c2a22;
  --bad-bg: #f8e6e4;
  --info-bg: #efe6d2;
  --radius: 10px;
  --tap: 44px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 17px;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.45;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--ink);
  font-weight: 600;
}

a:hover {
  color: var(--amber-dark);
}

h1,
h2 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h1 {
  font-size: 1.6rem;
  margin: 0 0 0.6rem;
}

h2 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.site-header {
  background: var(--black);
  color: #fff;
}

.header-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0.7rem 1rem 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.header-search {
  flex: 1 1 14rem;
  min-width: 10rem;
  max-width: 28rem;
}

.header-search input[type="search"] {
  width: 100%;
  min-height: 40px;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  background: #1c1c1c;
  color: #f3efe6;
  padding: 0.35rem 0.7rem;
  font-size: 1rem;
}

.header-search input[type="search"]::placeholder {
  color: #9a948a;
}

.nav-create {
  background: var(--amber);
  color: #161616 !important;
  padding: 0.2rem 0.65rem;
  border-radius: 6px;
}

.nav-create:hover {
  background: var(--amber-dark);
  color: #fff !important;
}

.nav a.nav-todo {
  background: var(--amber);
  color: #161616 !important;
  padding: 0.2rem 0.7rem;
  border-radius: 6px;
  font-weight: 800;
}

.nav a.nav-todo:hover,
.nav a.nav-todo.is-active {
  background: var(--amber-dark);
  color: #fff !important;
}

.nav a.nav-todo .badge {
  background: #161616;
  color: var(--amber);
}

.jobs-tabs {
  margin: 0.2rem 0 0.9rem;
}

.brand {
  display: block;
  line-height: 0;
}

.brand img {
  display: block;
  height: 42px;
  width: auto;
  max-width: min(260px, 72vw);
  object-fit: contain;
  object-position: left center;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.85rem;
  font-size: 0.92rem;
}

.nav a {
  color: #f3efe6;
  text-decoration: none;
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.nav a:hover {
  color: var(--amber);
}

.logout-form {
  display: inline;
  margin-left: 0.25rem;
}

.logout-form button {
  background: transparent;
  border: 1px solid #444;
  color: #f3efe6;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  font: inherit;
}

.logout-form button:hover {
  border-color: var(--amber);
  color: var(--amber);
}

.badge {
  display: inline-block;
  background: var(--amber);
  color: #111;
  border-radius: 999px;
  padding: 0 0.45rem;
  font-size: 0.75rem;
  margin-left: 0.15rem;
}

.preview-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #111;
  color: var(--amber);
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  vertical-align: middle;
}

.probe-json {
  background: #111;
  color: #f3efe6;
  padding: 0.9rem;
  border-radius: 8px;
  overflow: auto;
  font-size: 0.8rem;
}

.wrap {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
  flex: 1;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  padding: 1rem;
  text-align: center;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 1.2rem;
  margin: 0.85rem 0;
}

.login-card,
.quote-card {
  max-width: 28rem;
}

.lede,
.hint,
.kicker,
.muted {
  color: var(--muted);
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.hint {
  font-size: 0.9rem;
}

.stack {
  display: grid;
  gap: 0.85rem;
}

label {
  display: grid;
  gap: 0.28rem;
  font-weight: 650;
  font-size: 0.92rem;
}

[hidden] {
  display: none !important;
}

input,
select,
textarea,
button {
  font: inherit;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 0.45rem 0.65rem;
  border: 1px solid #c9c2b5;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--amber);
  border-color: var(--amber);
}

input[readonly] {
  background: #efebe3;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0.4rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  background: #f6f1e6;
  color: var(--ink);
}

.btn-primary {
  background: var(--amber);
  border-color: var(--amber-dark);
  color: #111;
}

.btn-primary:hover {
  background: #f0a02a;
}

.btn-danger {
  background: var(--bad);
  border-color: #6e1f19;
  color: #fff;
}

.btn-danger:hover {
  background: #a4332a;
  color: #fff;
}

.btn-small {
  min-height: 36px;
  padding: 0.2rem 0.65rem;
  font-size: 0.85rem;
}

.week-switch {
  display: grid;
  gap: 0.6rem;
  margin: 0.75rem 0 1rem;
}

.btn-last-week {
  min-height: 52px;
  font-size: 1.05rem;
}

.btn-last-week-cta {
  display: flex;
  width: 100%;
  min-height: 72px;
  font-size: 1.2rem;
  line-height: 1.25;
  text-align: center;
  background: var(--amber);
  border-color: var(--amber-dark);
  color: #111;
}

.btn-last-week-cta:hover {
  background: #f0a02a;
  color: #111;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0;
}

.flashes {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.flash {
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  margin: 0 0 0.5rem;
}

.flash-ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.flash-error {
  background: var(--bad-bg);
  color: var(--bad);
}

.flash-info,
.flash-message {
  background: var(--info-bg);
}

.grid-cards {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 720px) {
  .grid-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

.plain {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
}

.plain li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.section-title {
  margin-top: 1.5rem;
}

.status {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #e7e2d8;
}

.status-lg {
  font-size: 0.95rem;
  padding: 0.35rem 0.7rem;
}

.invoice-status-panel h2 {
  margin-bottom: 0.5rem;
}

.job-notes-box {
  display: grid;
  gap: 0.15rem;
  width: 100%;
  margin: 0 0 0.75rem;
  padding: 0.7rem 0.85rem;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f6f1e6;
  cursor: pointer;
  min-height: var(--tap);
}

.job-notes-box:hover {
  border-color: var(--amber, #e6b325);
  background: #fff8ea;
}

.job-notes-box span {
  color: var(--muted);
  font-size: 0.9rem;
}

.status-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
}

.status-steps li {
  margin: 0;
  padding: 0.55rem 0.4rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.88rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f1e6;
  color: var(--muted);
}

.status-steps li.is-done {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: var(--ok);
}

.status-steps li.is-current {
  background: var(--amber, #e6b325);
  color: var(--ink);
  border-color: var(--amber, #e6b325);
}

.invoice-history-title {
  margin: 1rem 0 0.25rem;
  font-size: 1rem;
}

.invoice-history {
  margin: 0;
  padding-left: 1.1rem;
}

.invoice-history li {
  margin: 0.2rem 0;
}

.status-pending { background: #f3d7a0; }
.status-draft { background: #e7e2d8; }
.status-submitted { background: #f3d7a0; }
.status-approved { background: var(--ok-bg); color: var(--ok); }
.status-rejected { background: var(--bad-bg); color: var(--bad); }
.status-new { background: #f3d7a0; }
.status-contacted { background: #d9e4f0; }
.status-accepted { background: var(--ok-bg); color: var(--ok); }
.status-accepted-archived { background: #5c5852; color: #f4f1ea; }
.status-sent { background: #d9e4f0; }
.status-xero { background: #d5ead8; }
.status-superseded { background: #e7e2d8; color: var(--muted); }
.status-declined { background: var(--bad-bg); color: var(--bad); }
.status-quote { background: #f3d7a0; }
.status-needs-fix { background: var(--bad-bg); color: var(--bad); }
.status-closed { background: var(--ok-bg); color: var(--ok); }
.status-archived { background: #e7e2d8; color: var(--muted); }

.ohs-form .card {
  margin: 0;
}

.ohs-notifiable {
  border-color: #e0c07a;
}

.quote-copy-lines,
.quote-copy-children {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
}

.quote-copy-children {
  margin-left: 1.1rem;
  border-left: 2px solid var(--line);
  padding-left: 0.7rem;
}

.quote-copy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
}

.quote-copy-row span {
  flex: 1 1 12rem;
}

.job-quote-banner {
  border-color: #e0c07a;
}

.source-chip {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: #e7e2d8;
}
.source-sam_email, .source-sam_chat { background: #d9e4f0; }
.source-manual, .source-app { background: #e4eedc; }
.source-proposed, .source-quote, .source-enquiry, .source-pdf { background: #f3d7a0; }

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.95rem;
}

.table th,
.table td {
  text-align: left;
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.table th {
  background: #ece6da;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table tr:last-child td {
  border-bottom: 0;
}

.day-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 0.95rem 1rem;
  margin: 0.7rem 0;
}

.day-card h2 {
  margin-bottom: 0.7rem;
}

.day-card.is-off .day-body {
  display: none;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 650;
  margin-bottom: 0.7rem;
}

.check input {
  width: 1.25rem;
  height: 1.25rem;
}

.day-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

@media (min-width: 720px) {
  .day-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.week-total {
  font-size: 1.05rem;
  margin: 1rem 0;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: end;
  margin: 0.5rem 0 0.3rem;
}

.inline-form label {
  min-width: 12rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
}

.filters a.is-active {
  color: var(--amber-dark);
  text-decoration: none;
  border-bottom: 2px solid var(--amber);
}

.mhiaa-queues {
  margin: 0.4rem 0 1rem;
}

.mhiaa-bill {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: var(--info-bg);
}

.mhiaa-bill-warranty_mason {
  background: var(--ok-bg);
  color: var(--ok);
}

.mhiaa-bill-charge_customer {
  background: var(--bad-bg);
  color: var(--bad);
}

.mhiaa-bill-pending_diagnosis {
  background: var(--info-bg);
}

.mhiaa-panel textarea {
  width: 100%;
}

.req {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.8rem;
}

.hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.kv {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.35rem 0.8rem;
}

.kv dt {
  color: var(--muted);
  font-weight: 650;
}

.kv dd {
  margin: 0;
}

.prewrap {
  white-space: pre-wrap;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: start;
}

.row-actions form {
  margin: 0;
}

details summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 650;
}

.review-box {
  margin-top: 1.5rem;
}

.nav-group {
  position: relative;
}

.nav-group > summary {
  list-style: none;
  color: #f3efe6;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.nav-group > summary::-webkit-details-marker {
  display: none;
}

.nav-group.is-current > summary,
.nav a.is-active {
  color: var(--amber);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.45rem 0 0.2rem 0.4rem;
}

.nav-group[open] > summary {
  color: var(--amber);
}

@media (max-width: 799px) {
  .header-inner {
    align-items: stretch;
  }

  .header-search {
    flex: 1 1 100%;
    max-width: none;
    order: 2;
  }

  .nav {
    order: 3;
    width: 100%;
    gap: 0.25rem 0.55rem;
  }

  .brand {
    order: 1;
  }
}

@media (min-width: 800px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 12rem;
    background: #161616;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    z-index: 20;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  }

  .nav-group:hover > .nav-menu,
  .nav-group:focus-within > .nav-menu,
  .nav-group[open] > .nav-menu {
    display: flex;
  }
}

.filter-panel {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
}

@media (min-width: 720px) {
  .filter-panel {
    grid-template-columns: repeat(3, 1fr);
  }
}

.check-set {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  grid-column: 1 / -1;
}

.check-set legend {
  font-weight: 650;
  font-size: 0.85rem;
}

.table-wrap {
  overflow-x: auto;
}

.table-click tbody tr {
  cursor: pointer;
}

.queue-note {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--amber-dark);
}

.page-job .wrap {
  max-width: 52rem;
}

body.app-wide .header-inner,
body.app-wide .wrap,
body.office-wide .header-inner,
body.office-wide .wrap {
  max-width: none;
  width: 100%;
}

body.app-wide .header-inner,
body.office-wide .header-inner {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

body.app-wide .wrap,
body.office-wide .wrap {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

@media (min-width: 1200px) {
  body.app-wide .header-inner,
  body.office-wide .header-inner,
  body.app-wide .wrap,
  body.office-wide .wrap {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

body.office-wide.page-job .wrap {
  max-width: none;
}

.office-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.office-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.office-head-actions .inline-form {
  margin: 0;
}

.po-invoice-upload {
  display: inline;
  margin: 0;
}

.po-invoice-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.table-office .inline-form {
  display: inline-flex;
  margin: 0;
  align-items: center;
  gap: 0.35rem;
}

.price-picker {
  position: relative;
}

.price-picker-list {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: 100%;
  margin: 0;
  padding: 0.2rem 0;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 16rem;
  overflow: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.price-picker-list button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  font: inherit;
}

.price-picker-list button:hover {
  background: #f6f1e6;
}

.price-dialog-list {
  position: static;
  max-height: 22rem;
  margin-top: 0.6rem;
  box-shadow: none;
}

.col-unit.sell-down input[name="line_unit"] {
  background: var(--ok-bg);
  border-color: var(--ok);
}

.col-unit.sell-up input[name="line_unit"] {
  background: var(--bad-bg);
  border-color: var(--bad);
}

.line-prior-note {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
}

.col-unit.sell-down .line-prior-note {
  color: var(--ok);
}

.col-unit.sell-up .line-prior-note {
  color: var(--bad);
}

.price-search,
.page-prices .price-search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.6rem 0 0.4rem;
}

.page-prices .price-search input[type="search"] {
  flex: 1 1 16rem;
  min-height: var(--tap);
  padding: 0.4rem 0.7rem;
}

.price-cats {
  row-gap: 0.35rem;
}

.price-tools {
  margin: 0.6rem 0 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.5rem 0.85rem 0.7rem;
}

.price-tools summary {
  cursor: pointer;
  font-weight: 700;
  padding: 0.35rem 0;
}

.price-tools-grid {
  display: grid;
  gap: 1rem;
  margin-top: 0.6rem;
}

@media (min-width: 800px) {
  .price-tools-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.price-group-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1rem;
  margin: 1.1rem 0 0.35rem;
}

.price-table {
  margin-bottom: 0.75rem;
}

.price-table .col-code {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  width: 1%;
}

.price-table .col-cost,
.price-table .col-markup,
.price-table .col-mode,
.price-table .col-edit {
  white-space: nowrap;
  width: 1%;
}

.price-table .col-cost {
  text-align: right;
}

.price-item-name {
  display: block;
}

.price-item-name + .muted {
  display: block;
  font-size: 0.85rem;
}

.price-edit-delete {
  margin: 0 1.15rem 1rem;
}

body.page-prices .table-wrap {
  overflow-x: auto;
}

.office-filters,
.jobs-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: flex-end;
  margin: 0.5rem 0 0.4rem;
  padding: 0.7rem 0.85rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.office-filters label,
.jobs-filter label {
  min-width: 9rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.jobs-filter-search {
  flex: 1 1 16rem;
}

.search-results {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  max-height: 14rem;
  overflow: auto;
}

.search-results button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.45rem 0.65rem;
  min-height: 40px;
  cursor: pointer;
}

.search-results button:hover,
.search-results button:focus {
  background: #f6f1e6;
}

.jobs-filter-go {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.jobs-filter-go .btn {
  min-height: 40px;
  padding: 0.25rem 0.9rem;
}

.jobs-filter .jobs-hide-scheduled {
  min-width: auto;
  margin-bottom: 0.15rem;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9rem;
  color: var(--ink);
  align-self: center;
}

.jobs-clear {
  font-size: 0.88rem;
}

.jobs-sort {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.jobs-sort a {
  margin-left: 0.45rem;
}

.jobs-sort a.is-on {
  color: var(--amber-dark);
  text-decoration: underline;
}

.office-search {
  flex: 1 1 16rem;
}

.office-status-set {
  flex: 1 1 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.table-office,
.table-tasks {
  font-size: 0.82rem;
  width: 100%;
}

.table-office thead th,
.table-tasks thead th {
  position: sticky;
  top: 0;
  background: #ece6da;
  z-index: 1;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.table-office th,
.table-office td,
.table-tasks th,
.table-tasks td {
  padding: 0.32rem 0.45rem;
  white-space: nowrap;
  vertical-align: middle;
}

.table-tasks thead th a {
  color: inherit;
  text-decoration: none;
}

.table-tasks thead th.is-sorted a {
  color: var(--amber-dark);
  text-decoration: underline;
}

.table-office tbody tr:nth-child(even),
.table-tasks tbody tr:nth-child(even) {
  background: #faf6ee;
}

.table-tasks .col-task,
.table-tasks .col-loc {
  white-space: normal;
  min-width: 11rem;
  max-width: 22rem;
}

.table-tasks .col-sched {
  font-size: 0.8rem;
  white-space: nowrap;
  min-width: 8rem;
}

.table-tasks .col-sched a {
  font-weight: 650;
}

.table-tasks .col-jn {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.table-tasks .col-po {
  max-width: 12rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.table-tasks .col-po .ww-sub {
  display: block;
  font-weight: 650;
  font-size: 0.8rem;
  color: var(--muted);
}

.job-order-banner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem 1.5rem;
  margin: 0.85rem 0 0.35rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f6f1e6;
}

@media (min-width: 640px) {
  .job-order-banner {
    grid-template-columns: 1fr 1fr;
  }
  .job-order-banner.is-single {
    grid-template-columns: 1fr;
  }
}

.job-order-banner dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.job-order-banner dd {
  margin: 0.15rem 0 0;
  font-size: 1.55rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

.job-order-with-mail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.job-order-with-mail .job-order-input {
  flex: 1;
  min-width: 0;
}

.job-order-fields {
  display: grid;
  gap: 0.65rem;
}

@media (min-width: 640px) {
  .job-order-fields.is-recom {
    grid-template-columns: 1fr 1fr;
  }
}

.job-order-input {
  font-size: 1.25rem !important;
  font-weight: 700;
  min-height: 2.75rem;
  font-variant-numeric: tabular-nums;
}

.job-ww-readout {
  margin: 0;
  padding: 0.55rem 0.7rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f6f1e6;
  font-size: 1.35rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.job-ww-readout span {
  display: block;
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.table-office .jn {
  display: inline-block;
  margin-right: 0.25rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.chip {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
}

.job-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.65rem 1.25rem;
  margin: 0.75rem 0 0;
}

.job-meta dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.job-meta dd {
  margin: 0.1rem 0 0;
}

.job-desc {
  margin: 0.4rem 0 0;
}

.board-list {
  list-style: none;
  padding: 0;
  margin: 0.85rem 0 0;
  display: grid;
  gap: 0.75rem;
}

.board-card-title {
  margin: 0 0 0.25rem;
  font-weight: 600;
}

.board-card-missing {
  color: #a33;
}

.board-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem;
}

.board-slot h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.board-slot img,
.board-extras img {
  display: block;
  max-width: 100%;
  max-height: 12rem;
  object-fit: cover;
  border-radius: 0.4rem;
  margin: 0.35rem 0;
}

.board-extras {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.55rem;
}

textarea.notes-warn {
  outline: 2px solid #c48a2a;
}

.intake-people {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.85rem;
  margin: 0.85rem 0 0;
}

.intake-people h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.intake-preview,
.intake-extract {
  white-space: pre-wrap;
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
}

.intake-extract {
  max-height: 18rem;
  overflow: auto;
  font-size: 0.8rem;
}

.job-title-row {
  align-items: flex-start;
}

.job-title h1 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.2;
}

.job-jn {
  margin: 0.2rem 0 0;
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink, #1c1a16);
}

.job-card .job-desc {
  margin-top: 0.85rem;
  font-size: 1.05rem;
}

.quote-sheet-kicker {
  margin: 0 0 0.35rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber-dark);
}

.quote-sheet-card h1 .job-jn {
  display: inline-block;
  margin-left: 0.35rem;
}

.quote-status-box {
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
}

.quote-status-box .kicker {
  margin: 0;
}

.quote-status-box .status-steps {
  display: flex;
  flex-wrap: wrap;
  grid-template-columns: none;
  gap: 0.35rem;
  margin: 0;
}

.quote-status-box .status-steps li {
  flex: 1 1 0;
  min-width: 7.5rem;
  padding: 0.4rem 0.45rem;
  font-size: 0.82rem;
}

.status-steps .step-date {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.9;
}

.quote-status-box .hint {
  margin: 0;
}

.quote-status-box .job-sheet-buttons {
  width: 100%;
}

.quote-status-box .job-sheet-buttons .btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 40px;
}

.quote-history-fold {
  margin: 0.15rem 0 0;
}

.quote-history-fold > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
}

.quote-scope-field textarea,
.rich-field {
  width: 100%;
}

.rich-field {
  border: 1px solid var(--line, #d4cfc4);
  background: #fff;
}

.rich-field .ql-toolbar.ql-snow {
  border: none;
  border-bottom: 1px solid var(--line, #d4cfc4);
  background: #f6f3ee;
  padding: 0.3rem 0.4rem;
}

.rich-field .ql-container.ql-snow {
  border: none;
  font: inherit;
}

.rich-field .ql-editor {
  min-height: 8rem;
  line-height: 1.45;
}

.rich-field .ql-editor.ql-blank::before {
  color: #8a857c;
  font-style: normal;
}

.rich-tools {
  display: flex;
  gap: 0.2rem;
  margin: 0;
  padding: 0.25rem 0.3rem;
  border-bottom: 1px solid var(--line, #d4cfc4);
  background: #f6f3ee;
}

.rich-tools button {
  min-width: 1.7rem;
  height: 1.7rem;
  padding: 0 0.35rem;
  border: 1px solid transparent;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.rich-tools button:hover {
  border-color: var(--line, #d4cfc4);
  background: #fff;
}

.rich-edit {
  min-height: 6rem;
  padding: 0.55rem 0.65rem;
  outline: none;
  line-height: 1.45;
}

.rich-edit b,
.rich-edit strong,
.rich-desc b,
.rich-desc strong {
  font-weight: 700;
}

.rich-edit .sz-small {
  font-size: 0.85em;
}

.rich-edit .sz-large,
.rich-desc .sz-large {
  font-size: 1.25em;
}

.rich-desc .sz-small,
.rich-desc .ql-size-small {
  font-size: 0.85em;
}

.rich-desc .ql-size-large,
.rich-desc .ql-size-huge {
  font-size: 1.25em;
}

.rich-desc {
  white-space: normal;
}

.rich-desc p {
  margin: 0 0 0.4rem;
}

.rich-edit ul,
.rich-edit ol,
.rich-desc ul,
.rich-desc ol {
  margin: 0.25rem 0 0.45rem 1.25rem;
  padding: 0;
}

.rich-edit li,
.rich-desc li {
  margin: 0.12rem 0;
}

.line-labour-desc {
  width: 100%;
  min-width: 10rem;
}

.job-quote-links {
  margin: 0.85rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.job-quote-btn {
  display: inline-flex;
  margin: 0;
  align-items: center;
}

.job-line-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  align-items: flex-end;
  margin-top: 0.65rem;
}

.job-line-form label {
  min-width: 7rem;
}

.job-line-form .btn {
  min-height: 40px;
}

.file-compact {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  font-size: 0.85rem;
}

.file-compact li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  overflow: visible;
  white-space: nowrap;
}

.file-compact li a {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 16rem;
}

.file-compact .inline-form {
  margin: 0;
  gap: 0;
  flex-wrap: nowrap;
  align-items: center;
}

.file-compact .file-show-field .check {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}

.quote-files-block h3 {
  margin: 0.6rem 0 0.35rem;
  font-size: 1rem;
}

.quote-files {
  list-style: none;
  padding: 0;
  margin: 0.35rem 0 0;
  display: grid;
  gap: 0.35rem;
}

.quote-files li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.quote-files .check {
  margin: 0;
  flex: 0 0 auto;
}

.quote-files a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-line.is-group {
  background: #f6f1e6;
}

.quote-line.is-child td:nth-child(2),
.quote-line.is-child td:nth-child(3) {
  padding-left: 1.4rem;
}

.quote-line.is-child .line-item-desc,
.quote-line.is-child .line-labour-desc,
.quote-line.is-child .line-sor-desc {
  border-left: 3px solid var(--amber);
  padding-left: 0.4rem;
}

.quote-group-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  align-items: center;
  margin: 0.35rem 0 0;
}

.quote-option-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  align-items: center;
  margin: 0.85rem 0 0.35rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f1e6;
}

.quote-option-flags .hint {
  flex: 1 1 100%;
  margin: 0;
}

.quote-line.is-collapsed-hidden {
  display: none;
}

.file-cards {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: grid;
  gap: 0.65rem;
}

.file-card {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 0.65rem 0.75rem;
  align-items: start;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.file-card .check {
  grid-column: 1;
  margin: 0;
  align-self: center;
}

.file-thumb {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 6px;
  overflow: hidden;
  background: #f3f1ec;
  border: 1px solid var(--line);
  flex: 0 0 auto;
}

.file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

img.file-thumb-inline {
  width: 2.4rem;
  height: 2.4rem;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.35rem;
}

.file-thumb-pdf,
.file-thumb-doc {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-decoration: none;
}

.file-card-body {
  min-width: 0;
  display: grid;
  gap: 0.35rem;
}

.file-card-name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.file-card-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.file-rename {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.file-rename input[type="text"] {
  min-width: 10rem;
  flex: 1 1 10rem;
  min-height: 36px;
}

.job-task {
  margin: 0.2rem 0 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.email-send-form.is-sending {
  pointer-events: none;
}

.email-send-form.is-sending .email-sending-status {
  color: var(--amber-dark);
  font-weight: 700;
}

.email-send-form.is-sending button[type="submit"] {
  opacity: 0.85;
}

.note-add {
  margin-top: 0.85rem;
}

.table-rates {
  max-width: 52rem;
  font-size: 0.88rem;
}

.table-rates input,
.table-rates select {
  min-height: 36px;
}

.table-rates td:first-child input {
  min-width: 12rem;
  width: 100%;
}

.table-rates td:nth-child(3) input {
  max-width: 7rem;
}

.rate-head {
  margin: 1rem 0 0.4rem;
  font-size: 0.95rem;
}

.labour-form label:nth-child(4),
.labour-form label:nth-child(5) {
  min-width: 10rem;
}

.po-form {
  margin-top: 0.75rem;
}

.po-lines {
  display: grid;
  gap: 0.45rem;
}

.po-panel {
  max-width: 44rem;
}

.po-panel-card {
  max-height: 85vh;
  overflow: auto;
}

.po-card {
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffcf7;
}

.po-card .table {
  margin: 0.5rem 0;
}

.note-edit {
  margin-top: 0.35rem;
  font-size: 0.85rem;
}

.note-edit summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
}

.office-form {
  max-width: 40rem;
  overflow: visible;
}

.office-form input,
.office-form select,
.office-form textarea {
  font-size: 1rem;
}

.client-picker {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.8rem 0.9rem;
  margin: 0;
}

.client-picker legend {
  font-weight: 700;
  padding: 0 0.3rem;
}

.seg-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin: 0.2rem 0 0.75rem;
}

.seg-toggle label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 44px;
  margin: 0;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f1e6;
  font-weight: 650;
}

.seg-toggle label:has(input:checked) {
  background: var(--amber, #e6b325);
  border-color: var(--amber, #e6b325);
}

.seg-toggle input {
  margin: 0;
}

#client-id,
.client-select {
  width: 100%;
  min-height: 10.5rem;
}

#known-sites {
  width: 100%;
  min-height: 2.75rem;
}

#location-contact-box .check {
  margin-bottom: 0.4rem;
}

.page-job-new .address-suggest-list {
  z-index: 40;
}

.job-layout {
  display: grid;
  gap: 1rem;
}

.job-status-box,
.job-sheet-actions {
  width: 100%;
  margin: 0.4rem 0;
  padding: 0.7rem 0.85rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.job-status-box {
  display: flex;
}

.job-status-box + .job-sheet-actions {
  margin-top: 0.4rem;
}

.job-sheet-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.job-status-box .job-status-form {
  width: 100%;
  margin: 0;
}

.job-sheet-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: stretch;
  align-items: stretch;
  gap: 0.4rem;
  margin: 0;
  width: 100%;
}

.job-sheet-actions .btn {
  width: auto;
  min-width: 0;
  min-height: 40px;
  flex: 1 1 0;
}

.job-sheet-buttons .job-quote-btn {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
}

.job-sheet-buttons .job-quote-btn .btn {
  width: 100%;
}

.job-status-form .btn {
  flex: 0 0 auto;
  min-width: 5.5rem;
  min-height: 40px;
}

.job-sheet-actions + .run-block {
  margin-top: 0.4rem;
}

.sheet-panel {
  max-width: 44rem;
}

dialog.modal.sheet-panel-wide {
  max-width: min(72rem, calc(100vw - 1.25rem));
  width: min(72rem, calc(100vw - 1.25rem));
  height: min(92vh, 100%);
  max-height: 92vh;
}

dialog.modal.sheet-panel-wide .modal-card,
dialog.modal.sheet-panel-wide .po-panel-card {
  max-height: 92vh;
  min-height: min(70vh, 92vh);
  display: flex;
  flex-direction: column;
  padding: 1.2rem 1.35rem 1.4rem;
  overflow: auto;
}

.sheet-list {
  flex: 1 1 auto;
  overflow: auto;
  margin: 0.45rem 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.sheet-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem 1rem;
  align-items: start;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}

.sheet-row:last-child {
  border-bottom: 0;
}

.sheet-row-title {
  margin: 0 0 0.15rem;
  font-weight: 700;
}

.sheet-row .hint {
  margin: 0;
}

.sheet-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-self: end;
  align-items: start;
}

.sheet-row-edit {
  justify-self: end;
}

.sheet-row:has(.sheet-row-edit[open]) .sheet-row-actions {
  grid-column: 1 / -1;
  justify-self: stretch;
  flex-direction: column;
}

.sheet-row-edit[open] {
  grid-column: 1 / -1;
  justify-self: stretch;
  min-width: 0;
  width: 100%;
}

.sheet-add {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 0.7rem 0.85rem;
  align-items: end;
  margin-top: 0.35rem;
  padding: 1rem 1.05rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.sheet-add label {
  min-width: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 700;
}

.sheet-add input,
.sheet-add select {
  width: 100%;
  min-height: 44px;
}

.sheet-add .btn {
  min-height: 44px;
  justify-self: start;
}

.sheet-add .hours-step input {
  min-height: 44px;
  width: 5rem;
}

@media (max-width: 800px) {
  dialog.modal.sheet-panel-wide {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
  }

  dialog.modal.sheet-panel-wide .modal-card,
  dialog.modal.sheet-panel-wide .po-panel-card {
    min-height: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  .sheet-row {
    grid-template-columns: 1fr;
  }

  .sheet-row-actions,
  .sheet-row-edit {
    justify-self: stretch;
  }
}

.table-lines {
  width: 100%;
  margin: 0.4rem 0 0.75rem;
}

.table-lines th,
.table-lines td {
  text-align: left;
  vertical-align: top;
  padding: 0.4rem 0.5rem 0.4rem 0;
  border-bottom: 1px solid var(--line);
}

.table-lines th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 700;
}

.invoice-lines .col-drag {
  width: 2.2rem;
  padding-right: 0.25rem;
  vertical-align: middle;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  min-height: 2.4rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  letter-spacing: -0.15em;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.invoice-lines tr.is-dragging {
  opacity: 0.45;
  background: var(--card);
  pointer-events: none;
}

.chargeout-visit {
  border: 0;
  padding: 0;
  margin: 0;
}

.chargeout-visit legend {
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.chargeout-vs {
  margin: 0.2rem 0 0;
}

.chargeout-table input[name="charge_qty"] {
  width: 5.5rem;
}

.line-edit summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
  list-style: none;
}

.line-edit summary::-webkit-details-marker {
  display: none;
}

.line-edit[open] {
  min-width: 16rem;
}

.line-edit[open] summary {
  margin-bottom: 0.4rem;
}

.sheet-add-title {
  margin: 1rem 0 0.35rem;
  font-size: 1rem;
}

.line-one {
  display: grid;
  grid-template-columns: 4.2rem minmax(8rem, 1.5fr) 7rem 5.5rem auto;
  gap: 0.35rem;
  align-items: end;
  margin-top: 0.55rem;
}

.line-one.labour-one {
  grid-template-columns: 8.2rem 6.2rem minmax(7rem, 1fr) 7.6rem auto;
}

.line-one.po-head-line {
  grid-template-columns: minmax(10rem, 1.4fr) 8rem;
}

.line-one.sor-one {
  grid-template-columns: 5.5rem minmax(8rem, 1.6fr) 4.5rem 5.5rem minmax(8rem, 1.2fr) auto;
}

.line-one.sor-client {
  grid-template-columns: 5.5rem minmax(8rem, 1.6fr) 4.5rem 5.5rem auto;
}

@media (max-width: 800px) {
  .line-one,
  .line-one.labour-one,
  .line-one.po-head-line,
  .line-one.sor-one,
  .line-one.sor-client {
    grid-template-columns: 1fr 1fr;
  }
}

.line-one label {
  min-width: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 700;
}

.line-one input,
.line-one select {
  width: 100%;
  min-height: 36px;
}

.hours-step {
  display: flex;
  align-items: stretch;
  gap: 0.2rem;
}

.hours-step input {
  flex: 1;
  min-width: 3.4rem;
  width: 4.2rem;
  text-align: center;
}

.hours-nudge {
  flex: 0 0 2.1rem;
  width: 2.1rem;
  min-width: 2.1rem;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
}

.muted {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.82em;
}

.job-foot {
  margin-top: 0.25rem;
}

.job-status-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  align-items: center;
  margin: 0;
  width: 100%;
}

.job-status-form label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  flex: 1 1 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.job-status-form select.choice-chip {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}

.job-status-form .btn {
  flex: 0 0 auto;
}

.job-status-chip {
  margin: 0.55rem 0 0;
}

select.choice-chip,
span.choice-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.15rem 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  font-weight: 700;
  font-size: 0.86rem;
  text-transform: none;
  letter-spacing: 0;
  color: inherit;
}

select.choice-chip {
  min-width: 8rem;
}

.job-refresh {
  margin: 0.75rem 0 0;
}

.status-aside {
  display: grid;
  gap: 0.4rem;
}

.office-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
}

.schedule-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  align-items: center;
  justify-content: flex-end;
}

.view-toggle {
  display: flex;
  gap: 0.35rem;
}

.board-layout {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 960px) {
  .board-layout {
    grid-template-columns: 16.5rem minmax(0, 1fr);
    align-items: start;
  }
}

.schedule-queue {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  padding: 0.7rem 0.75rem 0.85rem;
}

.schedule-queue h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.side-panes {
  display: flex;
  gap: 0.25rem;
  margin: 0 0 0.65rem;
}

.side-panes .queue-tab {
  flex: 1;
  justify-content: center;
  font-weight: 700;
}

.side-pane[hidden] {
  display: none;
}

.queue-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0 0 0.55rem;
}

.queue-tab {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  border: 1px solid transparent;
  text-decoration: none;
  color: inherit;
  font-size: 0.86rem;
}

.queue-tab.is-active {
  background: #ece6da;
  border-color: var(--line);
  font-weight: 600;
}

.queue-tab.is-over,
.queue-list.is-over {
  outline: 2px dashed #c47b2b;
  background: #f6f1e6;
}

.queue-slot {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin: 0.4rem 0 0.65rem;
  font-size: 0.85rem;
}

.queue-card {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.45rem 0.5rem 0.5rem;
  margin: 0 0 0.45rem;
  background: #f6f1e6;
  cursor: grab;
}

.queue-card-head {
  margin: 0 0 0.15rem;
}

.queue-card-meta,
.queue-card-actions {
  margin: 0;
  font-size: 0.8rem;
}

.queue-card-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.3rem;
}

.queue-weight {
  display: inline-flex;
  gap: 0.2rem;
  align-items: center;
}

.queue-weight-n {
  min-width: 1.1rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.board {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--card);
}

.board-row {
  display: grid;
  grid-template-columns: 8.5rem repeat(5, minmax(7.5rem, 1fr));
  min-height: 5.5rem;
  border-top: 1px solid var(--line);
}

.board.is-weekend .board-row {
  grid-template-columns: 8.5rem repeat(7, minmax(7rem, 1fr));
}

.board-head {
  min-height: 0;
  background: #ece6da;
  font-size: 0.8rem;
  font-weight: 700;
}

.board-name,
.board-day-label,
.board-cell {
  padding: 0.4rem;
  border-left: 1px solid var(--line);
}

.board-name {
  border-left: 0;
  font-weight: 700;
  background: #f6f1e6;
}

.board-cell {
  min-height: 5rem;
  position: relative;
  padding-top: 1.35rem;
}

.board-cell-run {
  position: absolute;
  top: 0.15rem;
  left: 0.3rem;
  right: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-decoration: none;
}

.board-cell-run:hover {
  color: var(--amber-dark);
}

.board-jn {
  font-weight: 700;
  margin-right: 0.2rem;
}

.weekend-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.run-stack {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: grid;
  gap: 0.45rem;
}

.run-stack-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem;
  align-items: start;
  padding: 0.55rem 0.7rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: grab;
}

.run-stack-body {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.run-stack-body > a {
  display: grid;
  gap: 0.12rem;
  text-decoration: none;
  color: inherit;
}

.run-stack-title,
.run-stack-what,
.run-stack-site {
  display: block;
}

.run-stack-site {
  color: var(--muted);
  font-size: 0.88rem;
}

.run-preview {
  margin-top: 0.2rem;
}

.run-preview .prewrap {
  margin: 0.35rem 0;
  font-size: 0.9rem;
}

.quote-badge {
  background: #f3d7a0;
  font-weight: 650;
}

.aroflo-quote-list {
  display: grid;
  gap: 0.65rem;
}

.aroflo-quote-view {
  margin-top: 0.35rem;
}

.aroflo-quote-lines {
  margin-top: 0.5rem;
}

.status-in-progress { background: #d9e4f0; }

.status.status-not-started,
.chip.status-not-started,
.board-block.status-not-started,
.choice-chip.status-not-started { background: #d8d4cc; color: #3a3834; }
.status.status-in-progress,
.chip.status-in-progress,
.board-block.status-in-progress,
.choice-chip.status-in-progress { background: #c9d4f5; color: #24357a; }
.status.status-pending,
.chip.status-pending,
.board-block.status-pending,
.choice-chip.status-pending { background: #f3d7a0; color: #6a4a08; }
.status.status-completed,
.chip.status-completed,
.board-block.status-completed,
.choice-chip.status-completed { background: #c8e6c0; color: #1e5a18; }
.chip.chip-booking { background: #efe8d8; color: #3a3834; }

.run-stack-item.is-dragging {
  opacity: 0.55;
}

.run-stack-handle {
  color: var(--muted);
  font-size: 0.9rem;
}

.board-cell.is-over {
  background: #efe6d2;
}

.board-cell.is-blocked,
.day-track.is-blocked {
  box-shadow: inset 0 0 0 2px rgba(180, 120, 40, 0.35);
}

.board-away-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0 0 0.3rem;
  position: relative;
  z-index: 2;
}

.board-away {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.12rem 0.35rem;
  border-radius: 2px;
}

.board-away-leave { background: #f3d7a0; color: #6a4a08; }
.board-away-holiday { background: #e0d4f0; color: #4a2d6a; }
.board-away-adhoc { background: #d8d4cc; color: #3a3834; }

.board-away-del {
  display: inline;
  margin: 0;
}

.btn-tiny {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0 0.1rem;
  color: inherit;
}

.board-block.is-todo,
.day-block.is-todo,
.queue-card.is-todo {
  background: #e7eef8;
}

.board-run .board-block.is-todo {
  border-left-color: #3a5a8c;
}

.chip.todo-chip {
  background: #d5e0f2;
  color: #24357a;
}

.blockout-fold {
  margin: 1rem 0 0;
  font-size: 0.9rem;
}

.blockout-fold > summary {
  cursor: pointer;
  font-weight: 700;
}

.board.is-month {
  overflow-x: auto;
  min-width: 100%;
}

.board.is-month .board-row {
  grid-template-columns: 7rem repeat(var(--month-days, 31), minmax(2.35rem, 1fr));
}

.month-day-label {
  font-size: 0.72rem;
  text-align: center;
  line-height: 1.15;
}

.month-cell {
  min-height: 3.4rem;
  padding: 0.15rem;
}

.month-cell .board-block {
  margin: 0 0 0.15rem;
  padding: 0.12rem 0.2rem;
  font-size: 0.68rem;
}

.month-cell .board-jn {
  font-size: 0.68rem;
}

.month-cell.is-today {
  box-shadow: inset 0 0 0 2px var(--ink, #222);
}

.blocks-nav {
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin: 0 0 1rem;
}

.blocks-layout {
  display: grid;
  gap: 1rem;
}

@media (min-width: 960px) {
  .blocks-layout {
    grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 0.9fr);
    align-items: start;
  }
}

.blocks-cal {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.blocks-cal th,
.blocks-cal td {
  border: 1px solid var(--line, #ddd);
  vertical-align: top;
  padding: 0.25rem;
  height: 5.5rem;
}

.blocks-cal th {
  height: auto;
  text-align: center;
  font-size: 0.8rem;
}

.cal-day {
  cursor: pointer;
}

.cal-day.is-today {
  box-shadow: inset 0 0 0 2px var(--ink, #222);
}

.cal-day.is-blocked {
  background: #f7f1e4;
}

.cal-num {
  display: block;
  font-weight: 700;
  margin: 0 0 0.2rem;
}

.cal-empty {
  background: #f4f3f0;
}

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

.block-list li {
  display: grid;
  gap: 0.15rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--line, #ddd);
}

.todo-queue {
  min-height: 2.5rem;
}

.board-block {
  display: block;
  position: relative;
  margin: 0 0 0.35rem;
  padding: 0.35rem 1.3rem 0.35rem 0.45rem;
  border-radius: 2px;
  text-decoration: none;
  cursor: grab;
  line-height: 1.25;
}

.board-block-del {
  position: absolute;
  top: 0;
  right: 0;
  margin: 0;
  z-index: 2;
  line-height: 1;
}

.board-block-del .btn-tiny {
  min-width: 1.4rem;
  min-height: 1.4rem;
  font-weight: 700;
}

.board-block span {
  display: block;
  font-weight: 500;
  font-size: 0.8rem;
}

.board-run {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 2.4rem;
}

.board-run .board-block {
  margin: 0;
  padding-left: 0.4rem;
  border-left: 3px solid var(--amber);
}

.board-run .run-n {
  display: inline;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  margin-right: 0.2rem;
}

.day-board {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--card);
}

.day-board-head,
.day-board-row {
  display: grid;
  grid-template-columns: 8.5rem minmax(52rem, 1fr);
  min-height: 5.2rem;
  border-top: 1px solid var(--line);
}

.day-board-head {
  min-height: 0;
  background: #ece6da;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.day-hours {
  display: grid;
  grid-template-columns: repeat(26, minmax(0, 1fr));
  padding: 0.25rem 0 0.15rem;
}

.day-hours span {
  text-align: center;
  border-left: 1px solid var(--line);
  padding: 0.15rem 0;
}

.day-track {
  position: relative;
  min-height: calc(4.4rem * var(--lanes, 1));
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(100% / 26 - 1px),
    var(--line) calc(100% / 26 - 1px),
    var(--line) calc(100% / 26)
  );
}

.day-track.is-over {
  background-color: #efe6d2;
}

.day-block {
  position: absolute;
  z-index: 1;
  margin: 0;
  overflow: hidden;
  cursor: grab;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  padding-right: 1.2rem;
}

.board .chip,
.day-board .chip {
  border-radius: 2px;
}

.day-block.is-dragging,
.board-block.is-dragging {
  opacity: 0.4;
}

.day-block .board-jn,
.day-block .chip {
  display: inline;
  font-size: 0.7rem;
  margin-right: 0.2rem;
}

.day-ghost {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 3px;
  margin-left: -1px;
  background: var(--amber);
  z-index: 2;
  pointer-events: none;
}

.chip.sub-sched,
.chip.sub-mint,
.choice-chip.sub-mint { background: #c8e6c0; color: #1e5a18; }
.chip.sub-lightgreen,
.choice-chip.sub-lightgreen { background: #d4edda; color: #1e5a18; }
.chip.sub-darkgreen,
.choice-chip.sub-darkgreen { background: #2d6a3a; color: #fff; }
.chip.sub-green,
.choice-chip.sub-green { background: #c8e6c0; color: #1e5a18; }
.chip.sub-blue,
.choice-chip.sub-blue { background: #c9d4f5; color: #24357a; }
.chip.sub-orange,
.chip.sub-upgrade,
.choice-chip.sub-orange { background: #f6c48a; color: #7a3e08; }
.chip.sub-purple,
.choice-chip.sub-purple { background: #d4c4f5; color: #3d246e; }
.chip.sub-brown,
.chip.sub-wait,
.choice-chip.sub-brown { background: #e7c4a8; color: #6a3416; }
.chip.sub-red,
.chip.sub-done,
.choice-chip.sub-red { background: #f4c1bc; color: #8c2a22; }
.chip.sub-yellow,
.choice-chip.sub-yellow { background: #f3e6a0; color: #5c4a00; }
.chip.sub-magenta,
.choice-chip.sub-magenta { background: #f5c4e0; color: #6e1a4a; }
.chip.sub-pink,
.choice-chip.sub-pink { background: #f5c4d4; color: #7a1f40; }
.chip.sub-bluegrey,
.choice-chip.sub-bluegrey { background: #c5cdd6; color: #2c3a4a; }
.chip.sub-plain,
.choice-chip.sub-plain { background: #e7e2d8; }

.table-click tbody tr:hover {
  background: #f6f1e6;
}

.modal {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 32rem;
  width: calc(100% - 1.5rem);
}

.modal-wide {
  max-width: 36rem;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.modal-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 1.2rem;
}

.intake-split {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 900px) {
  .intake-split {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.map-grid {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 720px) {
  .map-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.address-suggest {
  position: relative;
  display: block;
  width: 100%;
}

.address-suggest-list {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: 100%;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 14rem;
  overflow: auto;
}

.address-suggest-list li {
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  font-weight: 500;
}

.address-suggest-list li:hover,
.address-suggest-list li.is-active {
  background: #f6f1e6;
}

.pdf-frame {
  width: 100%;
  min-height: 70vh;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.page-run .wrap {
  max-width: 40rem;
}

.run-people {
  display: grid;
  gap: 0.75rem;
}

.run-person {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-height: 72px;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  text-decoration: none;
}

.run-person-name {
  font-size: 1.25rem;
}

.run-person-meta {
  color: var(--muted);
  font-weight: 500;
}

.run-day-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.75rem 0 1rem;
}

.run-day-nav input[type="date"] {
  width: auto;
  min-width: 10rem;
}

.run-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  margin: 0 0 1rem;
}

.run-switch a.is-active {
  color: var(--amber-dark);
}

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

.run-job-card {
  position: relative;
}

.run-job-card.has-quote .run-job {
  padding-bottom: 2.6rem;
}

.run-job-card .quote-pop-open {
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  z-index: 1;
}

.quote-sheet {
  margin: auto;
  border-radius: 12px;
}

.quote-sheet-item h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}

.quote-sheet-item {
  margin-bottom: 1rem;
}

.run-job {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  text-decoration: none;
  min-height: 88px;
}

.run-job-time {
  display: grid;
  align-content: start;
  gap: 0.15rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.run-job-time strong {
  color: var(--ink);
  font-size: 1rem;
}

.run-job-body h2 {
  font-size: 1.05rem;
  margin: 0 0 0.2rem;
}

.run-job-meta,
.run-note {
  margin: 0.15rem 0 0;
  font-weight: 500;
  color: var(--muted);
}

.run-note {
  font-size: 0.9rem;
}

.run-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: #e7e2d8;
  font-size: 0.78rem;
  font-weight: 700;
}

.chip-status {
  background: #f3d7a0;
}

.run-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin: 0.85rem 0;
}

.btn-block {
  width: 100%;
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.run-split {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.55rem;
}

.run-lines {
  list-style: none;
  padding: 0;
  margin: 0.6rem 0 0;
}

.schedule-item-main {
  margin: 0;
  flex: 1 1 12rem;
  min-width: 0;
}

.schedule-edit {
  display: inline-block;
  margin-left: 0.35rem;
  vertical-align: middle;
}
.schedule-edit > summary {
  list-style: none;
  cursor: pointer;
}
.schedule-edit > summary::-webkit-details-marker {
  display: none;
}
.schedule-edit[open] {
  display: block;
  margin: 0.4rem 0 0;
}
.run-lines li {
  padding: 0.45rem 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  align-items: center;
}

.run-note-card {
  margin-top: 0.65rem;
  padding: 0.75rem 0.9rem 0.85rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
}

.run-note-card .kicker {
  margin: 0 0 0.3rem;
}

.run-note-card .prewrap {
  margin: 0;
  color: #111;
}

.note-add textarea,
.note-edit textarea {
  background: #fff;
  color: var(--ink);
}

.job-closed-banner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  align-items: center;
  margin: 0 0 1rem;
  padding: 0.75rem 0.95rem;
  background: #2b2b2b;
  color: #f4f1ea;
  border-radius: 8px;
}

.job-closed-banner .kicker {
  color: #cfc8bc;
  margin: 0;
}

.job-closed-banner p {
  margin: 0.15rem 0 0;
}

.job-closed-banner .actions {
  margin: 0;
}

.job-closed-banner .btn {
  background: #fff;
}

body.page-job-closed .job-card {
  border-color: #b9b3a8;
  background: #ece9e2;
}

.table-tasks tr.is-closed td {
  background: #e8e4dc;
  color: #4a4742;
}

.status-completed {
  background: #c8e6c0;
  color: #1e5a18;
}

.board-block.is-completed,
.run-stack-item.is-completed,
.run-job-card.is-completed .run-job {
  opacity: 0.7;
}

.board-block.is-completed {
  border-left-color: #1e5a18;
}

.run-job-card.is-completed .run-job h2 {
  color: #1e5a18;
}

.status-archived,
.choice-chip.status-archived {
  background: #5c5852;
  color: #f4f1ea;
}

.status-saved {
  background: #d9e4f0;
}

.invoice-totals {
  font-size: 1rem;
}

.compare-fold {
  padding: 0.55rem 0.75rem 0.7rem;
}

.compare-fold > summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  list-style: revert;
}

.compare-fold .compare-wrap {
  margin-top: 0.55rem;
}

.invoice-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0;
}

.invoice-ref-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.6rem 0.85rem;
}

.job-desc-fold {
  margin: 0 0 0.55rem;
}

.job-desc-fold > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
}

.todo-add-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.todo-assignees {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.todo-assignees label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 650;
}

.todo-assignees input {
  width: 1.15rem;
  height: 1.15rem;
}

.todo-list {
  list-style: none;
  margin: 0 0 1.2rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.todo-card {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}

.todo-card.is-done {
  opacity: 0.62;
}

.todo-card.is-overdue {
  border-color: #d9b4ae;
}

.todo-tick {
  margin: 0;
}

.todo-check {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.todo-body {
  flex: 1;
  min-width: 0;
}

.todo-title {
  margin: 0;
  font-weight: 700;
}

.todo-meta {
  display: block;
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.todo-detail {
  margin: 0.4rem 0 0;
  font-size: 0.95rem;
}

.todo-card details > summary {
  cursor: pointer;
  list-style: none;
}

.todo-card details > summary::-webkit-details-marker {
  display: none;
}

.todo-done-fold {
  margin: 0.5rem 0 1.5rem;
}

.todo-done-fold > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
}

.todo-meta .is-overdue,
.is-overdue .todo-meta {
  color: var(--bad);
}

.todo-on-sched {
  color: #24357a;
}

.todo-sched-actions {
  margin: 0.4rem 0 0;
}

.todo-notes {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.todo-notes li {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.55rem;
}

.run-stack-item.is-todo,
.run-job-card.is-todo {
  background: #eef3fa;
}

@media (max-width: 640px) {
  .todo-add-row {
    grid-template-columns: 1fr;
  }
}

.invoice-sheet {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.invoice-totals-card {
  width: min(20rem, 100%);
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  padding: 0.55rem 0.85rem 0.7rem;
}

.invoice-totals-card h2 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.invoice-totals-card dl {
  margin: 0;
}

.invoice-totals-card dl > div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.28rem 0;
  border-top: 1px solid var(--line);
}

.invoice-totals-card dt {
  color: var(--muted);
  font-size: 0.85rem;
}

.invoice-totals-card dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.invoice-totals-card .totals-head {
  margin: 0.7rem 0 0.1rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.invoice-totals-card .totals-head:first-child {
  margin-top: 0.1rem;
}

.invoice-totals-card .is-total {
  border-top: 2px solid var(--amber);
  margin-top: 0.2rem;
  padding-top: 0.45rem;
  font-size: 1.05rem;
}

.invoice-totals-card .is-profit dt,
.invoice-totals-card .is-profit dd {
  color: var(--ok);
}

.invoice-totals-card .is-vs-same dt,
.invoice-totals-card .is-vs-same dd {
  color: var(--ok);
}

.invoice-totals-card .is-vs-over dd,
.invoice-totals-card .is-vs-under dd {
  font-variant-numeric: tabular-nums;
}

.invoice-totals-card .is-vs-under dd {
  color: var(--amber, #b45309);
}

.invoice-totals-card .totals-head a {
  color: inherit;
}

.invoice-actions {
  flex-wrap: wrap;
}

.invoice-lines input[type="text"] {
  width: 100%;
  min-height: 36px;
}

.invoice-lines th.col-qty,
.invoice-lines td.col-qty,
.invoice-lines th.col-cost,
.invoice-lines td.col-cost,
.invoice-lines th.col-markup,
.invoice-lines td.col-markup,
.invoice-lines th.col-unit,
.invoice-lines td.col-unit,
.invoice-lines th.col-amount,
.invoice-lines td.col-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.invoice-lines .col-qty input,
.invoice-lines .col-cost input,
.invoice-lines .col-markup input,
.invoice-lines .col-unit input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.invoice-lines td.col-amount {
  white-space: nowrap;
}

.invoice-lines .col-qty {
  width: 4.5rem;
}

.invoice-lines .col-cost,
.invoice-lines .col-unit,
.invoice-lines .col-amount {
  width: 6.5rem;
}

.invoice-lines .col-markup {
  width: 7.4rem;
}

.markup-edit {
  display: flex;
  align-items: stretch;
  gap: 0.2rem;
}

.markup-edit input {
  flex: 1;
  min-width: 0;
  width: 3.6rem;
}

.markup-edit select,
.markup-kind-label {
  flex: 0 0 2.6rem;
  width: 2.6rem;
  min-width: 2.6rem;
  padding: 0 0.15rem;
  min-height: 36px;
}

.markup-kind-label {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 700;
}

.invoice-lines tr.is-labour .is-muted {
  background: #eeeae2;
  color: var(--muted);
}

.invoice-labour h3,
.invoice-materials h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.invoice-lines.labour-lines {
  min-width: 32rem;
}

.invoice-lines.labour-lines th:nth-child(2),
.invoice-lines.labour-lines th:nth-child(3),
.invoice-lines.labour-lines th:nth-child(4),
.invoice-lines.labour-lines td:nth-child(2),
.invoice-lines.labour-lines td:nth-child(3),
.invoice-lines.labour-lines .col-amount {
  text-align: right;
  width: 7.5rem;
  white-space: nowrap;
}

.invoice-lines .col-remove {
  width: 5.5rem;
  white-space: nowrap;
}

.labour-rate-hint {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
}

.compare-wrap {
  overflow: auto;
}

.compare-table {
  font-size: 0.82rem;
  min-width: 56rem;
}

.compare-table th,
.compare-table td {
  padding: 0.28rem 0.4rem;
  text-align: right;
  white-space: nowrap;
}

.compare-table th:nth-child(1),
.compare-table th:nth-child(2),
.compare-table td:nth-child(1),
.compare-table td:nth-child(2) {
  text-align: left;
  white-space: normal;
}

.compare-table thead tr:first-child th {
  text-align: center;
  background: #2b2b2b;
  color: #f4f1ea;
}

.compare-table tfoot th,
.compare-table tfoot td {
  background: #ece9e2;
  font-weight: 700;
}

.compare-table tr.is-gap td {
  background: #f6f1e6;
}

.compare-table tr.is-extra td {
  background: #e8eef6;
}

.compare-origin {
  font-size: 0.72rem;
  font-weight: 650;
  margin-top: 0.12rem;
}

.compare-side {
  margin: 0.15rem 0;
}

.compare-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.08rem 0.35rem;
  margin-right: 0.35rem;
  border-radius: 3px;
  vertical-align: middle;
}

.compare-tag-used {
  background: #1f4d3a;
  color: #e8f6ee;
}

.compare-tag-quote {
  background: #2c3d66;
  color: #e8eef8;
}

.compare-tag-po {
  background: #5c3d1a;
  color: #f6edd9;
}

.compare-match {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-top: 0.35rem;
}

.compare-match select {
  max-width: 16rem;
  font-size: 0.8rem;
}

.compare-flag {
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 0.12rem;
}

.compare-flag-missing {
  color: #9b2c2c;
}

.compare-flag-extra {
  color: #276749;
}

.compare-flag-qty {
  color: #9a6700;
}

.compare-flag-fuzzy {
  color: #2c5282;
}

.compare-flag-manual {
  color: #2c5282;
}

.compare-table tr.is-fuzzy td {
  background: #eaf2fb;
}

.compare-table .compare-flag + .btn,
.compare-table td > .btn.btn-small {
  margin-top: 0.25rem;
}

.compare-table td .btn-small + .btn-small {
  display: block;
}

.compare-table tr.is-mat-missing td {
  background: #f8e8e8;
}

.compare-table tr.is-mat-extra td {
  background: #e7f0e7;
}

.compare-table tr.is-qty-diff td {
  background: #f7eed6;
}

.compare-extras-title {
  margin: 1.25rem 0 0.35rem;
  font-size: 1.05rem;
}

.labour-hours-bar {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
}

.sync-pill {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #e7e2d8;
}

.sync-synced {
  background: var(--ok-bg);
  color: var(--ok);
}

.sync-pending {
  background: #f3d7a0;
}

.timer-live {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.6rem;
}

.offline-banner {
  position: sticky;
  bottom: 0.5rem;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  background: var(--info-bg);
  font-weight: 650;
}

@media (max-width: 640px) {
  .table,
  .table thead,
  .table tbody,
  .table th,
  .table td,
  .table tr {
    display: block;
  }

  .table thead {
    display: none;
  }

  .table tr {
    padding: 0.7rem;
    border-bottom: 1px solid var(--line);
  }

  .table td {
    border: 0;
    padding: 0.15rem 0;
  }

  .kv {
    grid-template-columns: 1fr;
  }
}

body.page-field-job .wrap {
  max-width: 52rem;
}

.page-field-job .job-sheet-buttons .hint {
  align-self: center;
  margin: 0;
}

.page-field-job .field-po-line {
  display: grid;
  grid-template-columns: 4.5rem 1fr 6.5rem;
  gap: 0.4rem;
}

.page-field-job .field-photo-form {
  margin: 0 0 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.page-field-job .po-card {
  margin: 0 0 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.page-field-job .quote-sheet {
  width: min(36rem, 100%);
}

@media (max-width: 720px) {
  body.page-job.office-wide .wrap,
  body.page-field-job.app-wide .wrap {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .page-job .job-status-form {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }

  .page-job .job-status-form label {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    flex: 1 1 auto;
  }

  .page-job .job-status-form select.choice-chip,
  .page-job .job-status-form select,
  .page-job .job-status-form input[type="date"],
  .page-job .job-status-form input[type="text"] {
    width: 100%;
    min-width: 0;
    min-height: var(--tap);
  }

  .page-job .job-status-form .btn {
    width: 100%;
    min-height: var(--tap);
  }

  .page-job .job-meta {
    grid-template-columns: 1fr;
  }

  .page-job .schedule-list li,
  .page-job .run-lines.schedule-list li {
    flex-direction: column;
    align-items: stretch;
  }

  .page-job .schedule-edit {
    margin-left: 0;
    width: 100%;
  }

  .page-job .schedule-edit > summary.btn {
    width: 100%;
    min-height: var(--tap);
  }

  .page-job .schedule-list .inline-form,
  .page-job .run-lines .inline-form {
    width: 100%;
  }

  .page-job .schedule-list .inline-form .btn,
  .page-job .run-lines .inline-form .btn {
    width: 100%;
    min-height: var(--tap);
  }

  .page-field-job .job-title h1 {
    font-size: 1.25rem;
  }

  .page-field-job .job-jn {
    font-size: 1rem;
  }

  .page-field-job .job-order-banner dd {
    font-size: 1.15rem;
  }

  .page-field-job .job-meta {
    grid-template-columns: 1fr;
  }

  .page-field-job .job-status-form {
    flex-direction: column;
    align-items: stretch;
  }

  .page-field-job .job-status-form label {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .page-field-job .job-status-form .btn {
    width: 100%;
    min-height: var(--tap);
  }

  .page-field-job .job-sheet-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .page-field-job .job-sheet-buttons .btn,
  .page-field-job .job-sheet-buttons .job-quote-btn,
  .page-field-job .job-sheet-buttons a.btn {
    width: 100%;
    min-height: var(--tap);
  }

  .page-field-job .job-sheet-buttons .hint {
    grid-column: 1 / -1;
  }

  .page-field-job .run-split {
    grid-template-columns: 1fr;
  }

  .page-field-job .field-po-line {
    grid-template-columns: 1fr;
  }

  .page-field-job dialog.sheet-panel,
  .page-field-job dialog.quote-sheet {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
  }

  .page-field-job dialog.sheet-panel .modal-card,
  .page-field-job dialog.quote-sheet .modal-card {
    min-height: 100%;
    border-radius: 0;
  }

  .page-field-job .office-head-actions {
    width: 100%;
  }

  .page-field-job .office-head-actions .btn {
    min-height: var(--tap);
  }
}

@media (min-width: 900px) {
  body.page-field-job .wrap {
    max-width: 56rem;
  }
}

.signature-list {
  list-style: none;
  margin: 0.6rem 0 0.85rem;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.signature-card {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.75rem 1rem;
  align-items: start;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
}

.signature-card:first-child {
  border-top: 0;
  padding-top: 0;
}

.signature-thumb {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.signature-thumb img {
  display: block;
  width: 100%;
  height: 4.2rem;
  object-fit: contain;
  background: #fff;
}

.signature-time-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  align-items: end;
  margin-top: 0.35rem;
}

.sig-canvas {
  display: block;
  width: 100%;
  height: 11rem;
  background: #fff;
  border: 1px solid var(--ink);
  border-radius: 8px;
  touch-action: none;
  cursor: crosshair;
}

.invoice-signatures {
  margin-top: 1rem;
}

.page-field-job .sig-canvas {
  height: 12.5rem;
}

.ohs-tiles .card h2 {
  margin-bottom: 0.35rem;
}

.safety-card {
  border-left: 4px solid var(--amber);
}

.safety-card.is-ok {
  border-left-color: var(--ok);
}

.safety-card.is-blocked {
  border-left-color: var(--bad);
}

.safety-card.is-overridden {
  border-left-color: var(--amber);
}

.take5-look .check,
.ohs-form .check {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 0.35rem 0;
}

.page-take5 .ohs-form .card {
  margin: 0.65rem 0;
}

.take5-pack-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin: 0.35rem 0;
}

.take5-pack-row .check {
  flex: 1 1 12rem;
  margin: 0;
}

.pdf-preview {
  display: block;
  width: 100%;
  min-height: 70vh;
  margin: 0.75rem 0 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.page-settings .settings-menu {
  margin: 0 0 1rem;
  padding: 0.55rem 0.65rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.page-settings .settings-menu .btn {
  flex: 1 1 8rem;
  min-height: 40px;
  text-align: center;
}

.page-settings .settings-panel {
  margin-top: 0;
}
