:root {
  font-family:Inter,"Segoe UI",system-ui,sans-serif;
  color:#273742;
  background:#f3f5f7;
  font-synthesis:none;
  line-height:1.55;
  --red:#ab1421;
  --line:#dce2e7;
  --muted:#596976;
  --ink:#263640;
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
}

a {
  color:var(--red);
  text-underline-offset:3px;
}

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

button,a,input,select,textarea,summary {
  touch-action:manipulation;
}

button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,summary:focus-visible {
  outline:3px solid #1976d2;
  outline-offset:3px;
}

[hidden] {
  display:none!important;
}

.app-header {
  background:#fff;
  border-bottom:1px solid var(--line);
}

.header-inner {
  max-width:1240px;
  margin:auto;
  display:flex;
  gap:1.7rem;
  align-items:center;
  padding:1rem 2rem;
  flex-wrap:wrap;
}

.header-inner>a:not(.brand) {
  color:var(--ink);
  text-decoration:none;
  font-size:.93rem;
}

.brand {
  display:flex;
  gap:.55rem;
  align-items:center;
  text-decoration:none;
  color:var(--ink);
  font-weight:800;
  letter-spacing:.04em;
  font-size:1.15rem;
  margin-right:auto;
}

.brand-mark {
  display:grid;
  place-items:center;
  background:var(--red);
  color:#fff;
  width:32px;
  height:32px;
  border-radius:7px;
}

.brand-sub {
  font-weight:400;
  color:var(--muted);
  letter-spacing:0;
}

.header-logout {
  background:none;
  color:var(--muted);
  padding:.4rem .2rem;
  min-height:38px;
}

.header-inner form {
  margin:0;
}

main {
  max-width:1240px;
  margin:0 auto;
  padding:2rem;
  overflow-wrap:anywhere;
}

h1,h2,h3,p {
  margin-top:0;
}

h1 {
  font-size:clamp(1.6rem,2.5vw,2.1rem);
  line-height:1.22;
  letter-spacing:-.035em;
  margin-bottom:.65rem;
}

h2 {
  font-size:1.22rem;
  line-height:1.35;
  letter-spacing:-.015em;
}

h3 {
  font-size:1.03rem;
  line-height:1.45;
}

p:last-child {
  margin-bottom:0;
}

.muted,small,.helptext {
  color:var(--muted);
}

small,.helptext {
  font-size:.85rem;
}

.eyebrow {
  font-size:.77rem;
  text-transform:uppercase;
  letter-spacing:.1em;
  color:var(--muted);
  font-weight:700;
  margin-bottom:.45rem;
}

.breadcrumb {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:.55rem;
  font-size:.83rem;
  margin-bottom:1.5rem;
}

.breadcrumb a {
  color:var(--muted);
  text-decoration:none;
}

.badge {
  display:inline-flex;
  align-items:center;
  gap:.4rem;
  background:#f1f4f6;
  border:1px solid var(--line);
  color:#53636e;
  border-radius:30px;
  padding:.2rem .65rem;
  font-size:.76rem;
  white-space:normal;
}

.page-heading {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:1rem;
  margin-bottom:1.6rem;
}

.page-heading p {
  color:var(--muted);
}

.panel,.card {
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  padding:1.35rem;
  margin:0 0 1rem;
  min-width:0;
}

.panel>header,.section-heading {
  display:flex;
  justify-content:space-between;
  gap:1rem;
  align-items:center;
  margin-bottom:1rem;
}

.panel>header h2,.section-heading h2 {
  margin:0;
}

.jobs-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:1.2rem;
}

.job-card {
  display:block;
  text-decoration:none;
  color:var(--ink);
  border-top:3px solid var(--red);
  transition:box-shadow .15s;
}

.job-card:hover {
  box-shadow:0 6px 20px #26364012;
}

.job-card h2 {
  margin-bottom:.65rem;
}

.job-card .open-label {
  display:block;
  margin-top:1.3rem;
  color:var(--red);
  font-weight:650;
}

.job-meta {
  display:grid;
  gap:.6rem;
}

.job-meta p {
  margin:0;
}

.summary-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(230px,1fr));
  gap:1rem;
}

.place h3 {
  margin-bottom:.5rem;
}

.place address {
  font-style:normal;
  color:var(--muted);
  margin-bottom:.9rem;
}

.place dl {
  margin:0;
}

.place dt {
  font-size:.8rem;
  color:var(--muted);
}

.place dd {
  margin:0 0 .5rem;
}

.job-hero {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(280px,.7fr);
  gap:2rem;
  align-items:start;
  margin-bottom:1.4rem;
}

.hero-action {
  background:#fff;
  border:1px solid var(--line);
  padding:1.4rem;
  border-radius:12px;
}

.hero-action .action {
  width:100%;
  text-align:center;
}

.hero-action .secondary-action {
  display:block;
  margin-top:.9rem;
  text-align:center;
}

.job-sections {
  display:flex;
  gap:1.2rem;
  flex-wrap:wrap;
  margin:1.5rem 0;
}

.job-sections a {
  color:var(--ink);
}

.report-choice {
  margin:0;
}

.report-choice summary.action {
  list-style:none;
}

.report-choice summary.action::-webkit-details-marker {
  display:none;
}

.report-options {
  padding-top:.9rem;
}

.report-option {
  padding:1rem 0;
  border-bottom:1px solid var(--line);
}

.report-option:last-child {
  border:0;
}

.report-option p {
  font-size:.85rem;
  margin-bottom:.45rem;
}

.report-option a {
  font-weight:650;
}

.visit-list {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:1rem;
}

.visit-list .card {
  margin:0;
}

.visit-days {
  display:flex;
  gap:.5rem;
  flex-wrap:wrap;
  list-style:none;
  padding:0;
  margin:.7rem 0 0;
}

.visit-days li {
  font-size:.83rem;
  padding:.25rem .5rem;
  background:#f1f4f6;
  border-radius:5px;
}

.tentative {
  background:#fff0c2!important;
  color:#644900;
}

.cancelled {
  text-decoration:line-through;
}

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

.equipment-list>li {
  padding:1rem 0;
  border-bottom:1px solid var(--line);
}

.equipment-list>li:last-child {
  border:0;
}

.equipment-list .item-line {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
}

.item-actions {
  display:flex;
  gap:1rem;
  flex-wrap:wrap;
  margin-top:.5rem;
  font-size:.86rem;
}

.editor-heading {
  display:flex;
  justify-content:space-between;
  gap:1rem;
  align-items:flex-start;
  margin-bottom:1.2rem;
}

.editor-heading h1 {
  font-size:1.6rem;
  margin-bottom:.4rem;
}

.editor-heading p {
  margin-bottom:.3rem;
  font-size:.9rem;
  color:var(--muted);
}

.editor-heading .back-link {
  white-space:nowrap;
  font-size:.86rem;
}

.step-nav {
  display:grid;
  grid-template-columns:.85fr 1.35fr 1.15fr .85fr;
  background:#fff;
  border:1px solid var(--line);
  border-radius:10px;
  overflow:hidden;
  margin:1.3rem 0;
}

.step-nav a {
  display:flex;
  align-items:center;
  gap:.65rem;
  text-decoration:none;
  color:var(--muted);
  padding:1.1rem 1rem;
  border-right:1px solid var(--line);
  font-size:.9rem;
  font-weight:600;
  min-width:0;
}

.step-nav a:last-child {
  border:0;
}

.step-number {
  width:26px;
  height:26px;
  border-radius:50%;
  background:#edf0f2;
  display:grid;
  place-items:center;
  font-size:.8rem;
  flex-shrink:0;
}

.step-nav a[aria-current=step] {
  color:var(--red);
  background:#fff7f7;
  box-shadow:inset 0 -3px var(--red);
}

.step-nav a[aria-current=step] .step-number {
  background:var(--red);
  color:white;
}

.editor-status {
  display:flex;
  align-items:center;
  gap:.65rem;
  font-size:.85rem;
  margin:0 0 1.3rem;
  padding:.8rem 1rem;
  background:#eaf4ed;
  color:#245334;
  border:1px solid #cce0d2;
  border-radius:7px;
  min-height:46px;
}

.editor-status[data-kind=dirty],.editor-status[data-kind=saving] {
  background:#fff7df;
  color:#694d0b;
  border-color:#e7d59b;
}

.editor-status[data-kind=error],.editor-status[data-kind=conflict] {
  background:#fff0f0;
  color:#8f1722;
  border-color:#e6b6bd;
}

.editor-status a {
  color:inherit;
}

.editor-page [data-save-status] {
  font-size:.87rem;
}

.editor-page [data-save-status] {
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip-path:inset(50%);
}

.editor-footer {
  display:flex;
  justify-content:space-between;
  gap:1rem;
  border-top:1px solid var(--line);
  padding-top:1.2rem;
  margin-top:1.4rem;
  align-items:center;
}

.time-columns {
  display:grid;
  grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);
  gap:1.2rem;
  align-items:start;
}

.totals {
  font-size:1.4rem;
  font-weight:750;
  letter-spacing:-.025em;
}

.record-card {
  border:1px solid var(--line);
  padding:1rem;
  border-radius:8px;
  margin:.9rem 0;
}

.record-card h3 {
  margin-bottom:.5rem;
}

.record-card p {
  font-size:.87rem;
}

.device-nav {
  display:flex;
  gap:.5rem;
  flex-wrap:wrap;
  margin-bottom:1rem;
}

.device-nav button {
  background:#fff;
  color:var(--ink);
  border:1px solid var(--line);
  padding:.55rem .9rem;
  font-size:.87rem;
}

.device-card summary {
  padding:1rem 1.2rem;
  list-style:none;
  display:flex;
  align-items:center;
  gap:.7rem;
}

.device-card summary::before {
  content:'+';
  color:var(--red);
  font-size:1.3rem;
  font-weight:400;
}

.device-card[open] summary::before {
  content:'−';
}

.device-card {
  border:1px solid var(--line);
  background:#fff;
  border-radius:10px;
  margin:.8rem 0;
  min-width:0;
}

.device-card[open] summary {
  border-bottom:1px solid var(--line);
}

.device-card form,.device-card .read-text {
  padding:1.2rem;
}

.device-card .form-actions {
  justify-content:flex-end;
}

.notes-fields {
  display:grid;
  grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);
  gap:1rem;
}

.notes-fields .field-work_performed {
  grid-row:span 2;
}

.notes-fields .field-work_performed textarea {
  min-height:23rem;
}

.notes-fields textarea {
  min-height:9rem;
}

.form-page {
  max-width:900px;
  margin:0 auto;
}

.form-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:1rem 1.3rem;
}

.form-grid>.wide {
  grid-column:1/-1;
}

.form-grid .helptext {
  margin-top:.4rem;
}

.form-actions {
  display:flex;
  gap:.7rem;
  align-items:center;
  flex-wrap:wrap;
  margin-top:1.2rem;
}

label {
  display:block;
  font-size:.9rem;
  font-weight:650;
  margin-bottom:.45rem;
}

form p>label {
  margin-top:1rem;
}

input,select,textarea {
  max-width:100%;
  padding:.7rem .8rem;
  border:1px solid #aebac4;
  border-radius:6px;
  background:#fff;
  color:var(--ink);
}

input:not([type=checkbox]):not([type=hidden]),select,textarea {
  width:100%;
}

textarea {
  resize:vertical;
  line-height:1.6;
}

input[type=checkbox] {
  width:1.15rem;
  height:1.15rem;
  vertical-align:middle;
  margin-right:.45rem;
}

form ul {
  padding-left:1.2rem;
}

button,.action {
  border:1px solid transparent;
  background:var(--red);
  color:#fff;
  border-radius:6px;
  padding:.7rem 1rem;
  cursor:pointer;
  text-decoration:none;
  font-weight:600;
  display:inline-block;
  min-height:44px;
  text-align:center;
}

button:disabled {
  opacity:.55;
  cursor:not-allowed;
}

.button-secondary {
  background:#fff;
  border-color:var(--line);
  color:var(--ink);
}

.secondary-action {
  font-size:.87rem;
}

.notice {
  padding:1rem;
  background:#eef2f5;
  border-left:3px solid #71828e;
  margin-bottom:1rem;
  border-radius:4px;
  font-size:.9rem;
}

.errorlist,[role=alert] {
  color:#961521;
}

.errorlist {
  padding-left:1.3rem;
}

summary {
  cursor:pointer;
  font-weight:600;
}

details.panel>summary {
  padding:.2rem 0;
}

details.panel[open]>summary {
  margin-bottom:1.2rem;
}

.history {
  margin-top:1.2rem;
}

pre {
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  font:inherit;
  line-height:1.6;
  margin-top:.4rem;
}

.review-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:1rem;
}

.review-grid .wide {
  grid-column:1/-1;
}

td,th {
  text-align:left;
  padding:.7rem;
  border-bottom:1px solid var(--line);
}

table {
  width:100%;
  border-collapse:collapse;
}

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

.sr-only,.skip-link:not(:focus) {
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip-path:inset(50%);
}

.skip-link:focus {
  position:absolute;
  z-index:20;
  top:.5rem;
  left:.5rem;
  background:white;
  padding:1rem;
}

.empty-state {
  padding:2rem;
  text-align:center;
  color:var(--muted);
}

@media(max-width:800px) {
  main {
    padding:1.25rem;
  }
  .header-inner {
    padding:.8rem 1.25rem;
    gap:1rem;
  }
  .jobs-grid,.job-hero,.time-columns {
    grid-template-columns:1fr;
  }
  .job-hero {
    gap:1rem;
  }
  .step-nav a {
    padding:.9rem .65rem;
    font-size:.83rem;
    gap:.4rem;
  }
  .editor-heading {
    flex-wrap:wrap;
  }
  .editor-heading .back-link {
    order:-1;
    width:100%;
  }
  .notes-fields {
    grid-template-columns:1fr;
  }
  .notes-fields .field-work_performed {
    grid-row:auto;
  }
  .notes-fields .field-work_performed textarea {
    min-height:12rem;
  }
  .notes-fields textarea {
    min-height:8rem;
  }
}

@media(max-width:520px) {
  main {
    padding:1rem;
  }
  .header-inner {
    padding:.7rem 1rem;
    gap:.85rem;
  }
  .profile-text {
    display:none;
  }
  .brand {
    font-size:1.03rem;
  }
  .brand-mark {
    width:28px;
    height:28px;
  }
  .header-inner>a:not(.brand),.header-logout {
    font-size:.8rem;
  }
  .header-logout {
    padding:.3rem 0;
  }
  .step-nav {
    grid-template-columns:repeat(2,minmax(0,1fr));
    border-radius:8px;
  }
  .step-nav a {
    padding:.8rem;
    border-bottom:1px solid var(--line);
    border-right:1px solid var(--line);
  }
  .step-nav a:nth-child(2) {
    border-right:0;
  }
  .step-nav a:nth-child(n+3) {
    border-bottom:0;
  }
  .step-nav a:last-child {
    border-right:0;
  }
  .summary-grid,.visit-list,.review-grid,.form-grid {
    grid-template-columns:1fr;
  }
  .review-grid .wide,.form-grid>.wide {
    grid-column:auto;
  }
  .panel,.card {
    padding:1rem;
  }
  .page-heading {
    gap:.5rem;
    flex-wrap:wrap;
  }
  .page-heading h1 {
    width:100%;
  }
  .editor-footer {
    font-size:.86rem;
  }
  .editor-footer .action {
    padding:.7rem .85rem;
  }
  .device-card summary {
    padding:.85rem;
  }
  .device-card form,.device-card .read-text {
    padding:.9rem;
  }
  .job-meta {
    font-size:.9rem;
  }
}

.editor-status {
  flex-wrap:wrap;
}

.editor-status button {
  font-size:.82rem;
  padding:.45rem .7rem;
  min-height:36px;
}

main>form {
  max-width:48rem;
  background:white;
  border:1px solid var(--line);
  padding:1.5rem;
  border-radius:10px;
}

.profile-icon {
  display:none;
}

.bulk-layout {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:1.5rem;
}

.bulk-layout fieldset {
  margin:0;
  border:1px solid var(--line);
  border-radius:7px;
  padding:1rem;
}

.bulk-layout legend {
  font-weight:650;
  padding:0 .3rem;
}

.bulk-layout fieldset label {
  font-weight:450;
  font-size:.87rem;
  margin:.4rem 0;
}

.bulk-parameters>.field {
  margin:1rem 0;
}

.place {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:1rem;
}

.place-location address {
  margin-bottom:0;
}

@media(max-width:650px) {
  .bulk-layout {
    grid-template-columns:1fr;
  }
}

@media(max-width:520px) {
  .profile-icon {
    display:block;
  }
  .profile-link {
    display:grid;
    place-items:center;
    min-width:30px;
    min-height:38px;
  }
  .place {
    grid-template-columns:1fr;
  }
  .header-inner {
    gap:.65rem;
  }
  .brand {
    font-size:.95rem;
  }
}

.editor-status[data-kind=idle] {
  background:#edf1f4;
  color:#526370;
  border-color:var(--line);
}

/* UX-02: summaries show saved values; opening editors keeps every form in DOM. */
.work-table { width:100%; border-collapse:collapse; font-size:.85rem; margin-bottom:1rem; table-layout:fixed; }
.work-table caption { text-align:left; font-size:.8rem; color:var(--muted); margin-bottom:.5rem; }
.work-table th,.work-table td { padding:.7rem .3rem; text-align:left; vertical-align:top; border-bottom:1px solid var(--line); }
.work-table th { color:var(--muted); font-size:.8rem; }
.work-table th:first-child { width:29%; }
.work-table small { display:block; font-size:.72rem; }
.work-table a[data-inline-work] { display:inline-block; padding:.4rem .1rem; min-height:44px; }
.work-inline { background:#f7f9fa; border:1px solid var(--line); border-radius:8px; padding:1rem; }
.work-overnight { margin:.7rem 0; }
.work-overnight summary { cursor:pointer; padding:.6rem 0; min-height:44px; }
.work-overnight .field { max-width:360px; }
.work-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
.work-fields .wide { grid-column:1/-1; }
.work-table .work-inline { font-size:1rem; }
#work .bulk-layout { grid-template-columns:1fr; }
@media (max-width:600px) {
  .work-table { font-size:.77rem; }
  .work-table th,.work-table td { padding:.6rem .2rem; }
  .work-inline { padding:.7rem; }
  .work-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

/* Device card: current assembly first; history stays outside the component grid. */
.assembly-intro { color:#536675; margin-top:0; }
.assembly-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)); gap:1rem; }
.assembly-component { min-width:0; margin:0; overflow-wrap:anywhere; }
.assembly-component h3 { margin-top:0; }
.assembly-component dl { margin:.75rem 0; }
.assembly-component dt { color:#536675; font-size:.85rem; }
.assembly-component dd { margin:0 0 .5rem; font-weight:600; }
.assembly-component summary, .device-history > summary { cursor:pointer; padding:.6rem 0; }
.assembly-component > a { display:inline-block; margin-top:.6rem; }
.assembly-missing { color:#536675; }
.device-history { border-top:1px solid #d9e1e6; margin-top:1.5rem; }
.device-history > summary { font-weight:700; }
.assembly-component { padding:1rem; }
.assembly-component dl { display:grid; grid-template-columns:auto minmax(0,1fr); gap:.4rem .75rem; }
.assembly-component dd { margin:0; }

/* Documents: bounded rows and on-demand, raster-only preview. */
.documents {margin-top:2rem; border-top:1px solid var(--line); padding-top:1rem;}
.documents-heading,.documents-toolbar,.document-pagination {display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;}
.documents-heading h2 {margin:.3rem 0;}
.documents .button-link {background:var(--red);color:#fff;padding:.65rem 1rem;border-radius:6px;text-decoration:none;font-weight:600;}
.documents-toolbar {margin:1rem 0;}
.documents-toolbar form {display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;margin:0;padding:0;border:0;background:none;max-width:100%;}
.documents-toolbar select {max-width:100%;width:auto;}
.document-group {font-size:1rem;margin:1.2rem 0 .4rem;}
.document-list {list-style:none;padding:0;margin:0;border:1px solid var(--line);border-radius:8px;background:#fff;}
.document-row {padding:.65rem .85rem;border-bottom:1px solid var(--line);}
.document-row:last-child {border-bottom:0;}
.document-main {display:flex;align-items:center;justify-content:space-between;gap:.75rem;}
.document-title {min-width:0;}
.document-title h4 {margin:0;font-size:1rem;overflow-wrap:anywhere;}
.document-date {font-size:.85rem;color:var(--muted);}
.document-actions {display:flex;gap:1rem;flex-shrink:0;align-items:center;}
.document-details {font-size:.9rem;overflow-wrap:anywhere;}
.document-details summary {color:var(--muted);cursor:pointer;padding:.2rem 0;}
.document-details p {white-space:pre-wrap;margin:.5rem 0;}
.document-pagination {justify-content:flex-start;margin:1rem 0;}
.document-preview h1 {overflow-wrap:anywhere;}
.document-preview-image {display:block;max-width:100%;height:auto;margin:1rem auto;background:white;border:1px solid var(--line);}
@media(max-width:600px){.document-main {align-items:flex-start;flex-direction:column;gap:.2rem;}.document-actions a {padding:.25rem 0;}.documents-toolbar form {width:100%;}.documents-toolbar select {width:100%;min-width:0;}.document-row {padding:.6rem;}}

/* M3.1: one read-only calendar, with a mobile day list from the same data. */
.schedule-toolbar,.schedule-tabs,.schedule-period,.schedule-legend {display:flex;align-items:center;flex-wrap:wrap;gap:.75rem;}
.schedule-toolbar {justify-content:space-between;}
.schedule-tabs a,.schedule-period a {padding:.5rem .75rem;border:1px solid var(--line);border-radius:5px;background:white;}
.schedule-tabs [aria-current] {background:var(--red);color:white;border-color:var(--red);font-weight:600;}
.schedule-label {margin:1rem 0 .5rem;}
.schedule-legend {font-size:.9rem;margin:.75rem 0 1rem;}
.schedule-grid {display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:1px;background:var(--line);border:1px solid var(--line);border-radius:6px;overflow:hidden;}
.schedule-weekday {text-align:center;background:#edf1f4;font-size:.9rem;padding:.4rem;}
.schedule-day,.schedule-padding {min-width:0;background:white;padding:.5rem;}
.schedule-padding {background:#f7f8f9;}
.schedule-day h3 {margin:0 0 .5rem;display:flex;gap:.4rem;align-items:center;flex-wrap:wrap;font-size:1rem;}
.schedule-day-name {display:none;}
.schedule-today {box-shadow:inset 0 3px var(--red);}
.schedule-today-label {font-size:.75rem;color:var(--red);}
.schedule-day ul {padding:0;margin:0;list-style:none;}
.schedule-entry {border-left:3px solid #176454;background:#f3f8f6;padding:.45rem;margin:.5rem 0;font-size:.85rem;overflow-wrap:anywhere;}
.schedule-entry.tentative {border-color:#9a5a00;background:#fff7e9;}
.schedule-entry a {display:block;}
.schedule-entry a span {display:block;margin-top:.15rem;}
.schedule-entry p {margin:.4rem 0;}
.schedule-status {display:inline-block;padding:.1rem .35rem;border-radius:4px;font-size:.8rem;font-weight:600;}
.schedule-status.confirmed {background:#e0f0e8;color:#14523d;}
.schedule-status.tentative {background:#fff0d4;color:#754000;}
.schedule-free {color:var(--muted);font-size:.8rem;}
.schedule-month .schedule-free {visibility:hidden;}
.schedule-month .schedule-day {min-height:115px;}
.schedule-mobile-note {display:none;}
@media(max-width:900px){.schedule-grid {grid-template-columns:1fr;gap:.5rem;background:none;border:none;overflow:visible;}.schedule-weekday,.schedule-padding {display:none;}.schedule-day {border:1px solid var(--line);border-radius:6px;padding:.75rem;}.schedule-day-name {display:inline;}.schedule-entry {font-size:1rem;}.schedule-month .schedule-day-empty {display:none;}.schedule-mobile-note {display:block;color:var(--muted);font-size:.85rem;}.schedule-toolbar {align-items:flex-start;flex-direction:column;}}

/* Dispatcher controls use the same calendar and mobile layout as M3.1. */
.team-filter {display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;padding:.7rem;max-width:100%;}
.team-filter select {width:auto;max-width:100%;}.plan-person {display:block;margin-bottom:.4rem;}
.plan-history {padding-left:1.2rem;overflow-wrap:anywhere;}.plan-history li {padding:.75rem;border-bottom:1px solid var(--line);}

.schedule-heading {display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.75rem 1rem;}
.schedule-heading .action {font-weight:700;}
.schedule-entry.schedule-entry-past,.schedule-entry.cancelled {border-color:#84929c;background:#eef1f3!important;color:#52606b;}
.schedule-entry-past .schedule-visit-link,.schedule-entry.cancelled .schedule-visit-link {color:inherit;}
.schedule-entry-past .schedule-status,.schedule-status.cancelled {background:#dce2e7!important;color:#35434d;}
.schedule-entry.cancelled,.schedule-entry.cancelled .schedule-visit-link,.schedule-status.cancelled {text-decoration:none;}
.schedule-entry.cancelled .schedule-visit-link>strong,.schedule-entry.cancelled .schedule-visit-link>span,.schedule-entry.cancelled .plan-person {text-decoration:line-through;text-decoration-thickness:2px;}
[data-plan-move] {cursor:grab;}
[data-plan-handle] {touch-action:none;}
[data-plan-handle]::before {content:"↔";margin-right:.35em;}
.schedule-dragging {cursor:grabbing;user-select:none;}
.schedule-entry-dragged {opacity:.55;}
.schedule-drop-target {box-shadow:inset 0 0 0 2px var(--red);background:#fff7f7;}
@media(max-width:900px) {
  .schedule-month.schedule-dragging .schedule-day-empty {display:block;min-height:3rem;}
}

.plan-extend { display:block; width:100%; margin-top:.5rem; padding:.35rem; border:1px dashed #68778c; border-radius:4px; background:#edf4ff; color:#17345b; cursor:ew-resize; touch-action:none; }
[data-plan-message]:not(:empty) { padding:.7rem; border-left:4px solid #4277b5; background:#edf4ff; }

/* Team information supplements text labels; color is never the only state cue. */
.technician-dot{display:inline-block;width:.8rem;height:.8rem;border-radius:50%;margin-right:.35rem;border:1px solid #455468;flex-shrink:0}
.technician-color-blue{background:#3575d5}.technician-color-green{background:#298148}.technician-color-purple{background:#8252bb}.technician-color-orange{background:#ce7825}.technician-color-red{background:#bf4242}.technician-color-teal{background:#138786}.technician-color-pink{background:#ca5593}.technician-color-gray{background:#7b8390}
.visit-team{display:block;font-size:.9rem;margin:.3rem 0 .5rem;line-height:1.5}
.filter-form{display:flex;flex-wrap:wrap;gap:1rem;align-items:end}.filter-form p{margin:0;min-width:12rem;flex:1}.filter-form input,.filter-form select{width:100%}.filter-form label{display:block}
@media(max-width:600px){.filter-form{display:block}.filter-form p{margin-bottom:1rem}}

.customer-layout{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(300px,1fr);gap:1.5rem;align-items:start}.customer-main,.customer-sidebar{min-width:0}.customer-sidebar .panel{margin-top:0}.customer-counts{display:flex;gap:1rem;flex-wrap:wrap}.customer-counts>a{flex:1;min-width:110px}.customer-counts strong{display:block;font-size:1.6rem}.customer-counts p{flex-basis:100%;margin:0}.customer-documents{list-style:none;padding:0}.customer-documents>li{padding:1rem 0;border-bottom:1px solid #d7dee7;overflow-wrap:anywhere}.customer-documents p{margin:.35rem 0}.customer-document-filters input,.customer-document-filters select{min-width:0;width:100%;max-width:100%}.customer-document-filters label{display:block}
@media(max-width:850px){.customer-layout{grid-template-columns:minmax(0,1fr)}.customer-sidebar{grid-row:2}}

.customer-main>details>summary h2{display:inline;margin:0;font-size:1.1rem}
/* Contiguous ranges are real grid items; gaps keep their date columns. */
.calendar-scroll {max-width:100%;overflow-x:auto;border:1px solid var(--line);border-radius:6px;}
.team-calendar {min-width:840px;}
.calendar-week-names,.calendar-week {display:grid;grid-template-columns:repeat(7,minmax(0,1fr));}
.calendar-week-names span {text-align:center;background:#edf1f4;padding:.5rem;font-size:.85rem;}
.calendar-week {position:relative;grid-template-rows:2.4rem repeat(calc(var(--rows) - 1),auto);min-height:150px;border-top:1px solid var(--line);}
.calendar-week>.schedule-day,.calendar-week>.calendar-blank {grid-row:1 / -1;min-height:150px;min-width:0;border:0;border-right:1px solid var(--line);border-radius:0;padding:.35rem;background:#fff;}
.calendar-week>.calendar-blank {background:#edf1f4;}
.calendar-week>.schedule-today {background:#fff5f5;}
.calendar-week>.schedule-day h3 {font-size:.85rem;margin:0;}
.calendar-bar {position:relative;z-index:1;min-width:0;margin:.15rem .2rem .4rem;padding:.4rem .5rem;border-radius:5px;align-self:stretch;}
.calendar-bar .bar-top,.bar-controls {display:flex;flex-wrap:wrap;align-items:center;gap:.2rem .5rem;}
.calendar-bar .schedule-visit-link span {display:inline;margin-right:.35rem;}
.calendar-bar .schedule-visit-link strong {display:block;}
.calendar-bar .bar-dates {font-size:.75rem;margin:.25rem 0;}
.calendar-bar .bar-continuation {font-weight:600;font-size:.75rem;}
.bar-resize {border:1px dashed #68778c;background:#edf4ff;color:#17345b;font:inherit;font-size:.75rem;padding:.2rem .35rem;cursor:ew-resize;touch-action:none;border-radius:3px;}
.calendar-bar.mixed {border-color:#9a5a00;background:#f7f5e8;}
.calendar-scroll-note {font-size:.85rem;color:var(--muted);}
@media(max-width:900px){.calendar-week>.schedule-day{display:block!important;}.calendar-bar {font-size:.85rem;}}
.calendar-bar .schedule-visit-link .bar-job-title {display:block;}

/* Keep the row compact even when several visits share a narrow date column. */
.calendar-bar {align-self:start;}
.calendar-bar .schedule-visit-link>strong,.calendar-bar .schedule-visit-link>span {display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.calendar-bar .bar-dates {white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.calendar-bar .plan-person {margin:0;font-size:.78rem;}
.calendar-bar .bar-resize {min-height:26px;line-height:1.2;}
@media(max-width:900px){.calendar-bar .bar-resize {min-height:44px;}}

/* Device card: one readable validity row and the same side-panel pattern as customers. */
.equipment-layout{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(300px,1fr);gap:1.5rem;align-items:start}
.equipment-main,.equipment-sidebar{min-width:0}.equipment-actions{display:flex;gap:.6rem;flex-wrap:wrap}
.equipment-validity p{display:flex;align-items:baseline;gap:.5rem;flex-wrap:wrap;margin:0}.equipment-validity a{margin-left:auto}
.equipment-sidebar .documents{margin-top:0;padding:1rem;border:1px solid var(--line);border-radius:8px;background:white}
.equipment-sidebar .document-main{align-items:flex-start;flex-direction:column}.equipment-sidebar input,.equipment-sidebar select{width:100%;min-width:0}
.equipment-sidebar .documents-toolbar form{display:block;width:100%}.equipment-sidebar .documents-toolbar label{display:block;margin-top:.5rem}
.equipment-sidebar .documents-toolbar button{margin-top:.75rem}.equipment-main>.device-history{margin-bottom:1.5rem}
.preview-banner{padding:.5rem 1rem;background:#fff6dc;text-align:center;color:#634b13}
@media(max-width:850px){.equipment-layout{grid-template-columns:minmax(0,1fr)}.equipment-sidebar{grid-row:2}}

.equipment-heading{flex-wrap:wrap}.equipment-heading h1{flex:1 1 26rem;min-width:0;overflow-wrap:anywhere}.equipment-heading .equipment-actions{flex:0 0 auto;max-width:100%}

/* Job overview: compact source data per visit, no cross-site contact mixing. */
.job-detail-panels {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1.25rem;align-items:stretch;}
.job-detail-panels>.panel {min-width:0;margin:0;overflow-wrap:anywhere;}
.job-detail-panels h2 {margin-top:0;font-size:1.15rem;}
.job-detail-panels h3 {font-size:1rem;margin-bottom:.5rem;}
.job-detail-panels dd {margin-left:0;margin-bottom:1rem;}
.job-detail-panels dt {color:var(--muted);font-size:.8rem;text-transform:uppercase;}
.job-visit-place {border-top:1px solid var(--line);padding-top:.5rem;margin-top:1rem;}
.call-customer {display:block;text-align:center;background:#236ba3;color:white;}
.job-detail-panels textarea {width:100%;max-width:100%;}
.job-detail-panels [data-job-devices] {display:flex;flex-direction:column;}
[data-job-devices]>.action {margin-top:auto;text-align:center;}
.job-maps {margin-top:1.25rem;}
.job-maps>div+div {border-top:1px solid var(--line);margin-top:1rem;padding-top:.5rem;}
.saved-note {white-space:pre-wrap;overflow-wrap:anywhere;}
.component-group>summary {font-weight:700;cursor:pointer;padding:.3rem 0;}
.component-group[open]>.assembly-grid {margin-top:1rem;}
.dashboard-layout {display:grid;grid-template-columns:minmax(0,2fr) minmax(260px,1fr);gap:1.25rem;align-items:start;}
.dashboard-layout>* {min-width:0;}
.dashboard-job {display:flex;gap:1rem;justify-content:space-between;padding:1rem 0;border-bottom:1px solid var(--line);overflow-wrap:anywhere;}
.dashboard-job h3,.dashboard-job p {margin:.25rem 0;}
.dashboard-job>div:last-child {text-align:right;flex-shrink:0;}
.job-state {display:inline-block;background:#edf2f7;border-radius:6px;padding:.2rem .65rem;font-size:.82rem;}
[data-personal-note] textarea {width:100%;max-width:100%;}
@media(max-width:1000px){.job-detail-panels{grid-template-columns:1fr;}.dashboard-layout{grid-template-columns:1fr;}}
@media(max-width:500px){.dashboard-job{display:block;}.dashboard-job>div:last-child{text-align:left;margin-top:.5rem;}}

.brand-symbol {position:relative;display:block;flex:0 0 34px;width:34px;height:29px;overflow:hidden;background:white;}
.brand-symbol img {position:absolute;top:0;left:0;width:186px;height:auto;max-width:none;}
