.ops-root {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
}
.ops-card > h2 {
  margin-top: 0;
}
.ops-cockpit {
  background: linear-gradient(130deg, #27233c, #394368);
  color: #fff;
  border: 0;
}
.ops-cockpit h2,
.ops-cockpit .eyebrow,
.ops-cockpit .help,
.ops-cockpit label {
  color: inherit;
}
.ops-cockpit .eyebrow {
  color: #ffc76d;
}
.ops-cockpit input {
  background: #fff;
  color: #222;
}
.ops-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.ops-metric {
  border: 1px solid #e6e3ec;
  border-radius: 14px;
  padding: 16px;
  background: #fff;
  color: #29263b;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.ops-metric > span {
  font-size: 13px;
  font-weight: 600;
}
.ops-metric strong {
  font-size: clamp(19px, 2vw, 29px);
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}
.ops-metric small {
  font-size: 12px;
  color: #605c6b;
  line-height: 1.45;
}
.ops-cockpit .ops-metric {
  background: #ffffff12;
  border-color: #ffffff30;
  color: #fff;
}
.ops-cockpit .ops-metric small {
  color: #e0e3f2;
}
.ops-metrics.compact strong {
  font-size: 21px;
}
.ops-target {
  background: #ffffff12;
  padding: 20px;
  border-radius: 14px;
}
.ops-target > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.ops-target progress {
  width: 100%;
  height: 13px;
  margin: 16px 0 4px;
  accent-color: #fbb552;
  border: 0;
  border-radius: 8px;
}
.ops-target progress::-webkit-progress-bar {
  background: #ffffff30;
  border-radius: 8px;
}
.ops-target progress::-webkit-progress-value {
  background: #fbb552;
  border-radius: 8px;
}
.ops-target p {
  margin-bottom: 0;
  font-size: 14px;
}
.ops-card .table-wrap {
  margin-top: 14px;
  max-width: 100%;
  overflow: auto;
}
.ops-card table {
  width: 100%;
  border-collapse: collapse;
}
.ops-card th,
.ops-card td {
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #ece9f1;
}
.ops-card th {
  font-size: 12px;
  color: #655e76;
}
.ops-card td .btn {
  margin: 0 4px 5px 0;
}
.ops-disclosure {
  background: #fff;
  border: 1px solid #dedbe8;
  border-radius: 14px;
  padding: 18px;
  margin: 0;
}
.ops-disclosure > summary {
  font-weight: 700;
  cursor: pointer;
  min-height: 28px;
}
.ops-disclosure[open] > summary {
  margin-bottom: 20px;
}
.ops-form {
  margin-top: 20px;
}
.ops-form-message {
  color: #982d32;
  max-width: 100%;
  font-size: 14px;
}
.ops-dialog {
  width: min(850px, calc(100vw - 30px));
  max-height: 88dvh;
  overflow: auto;
  border: 0;
  border-radius: 18px;
  padding: 26px;
  background: #fcfbfe;
  color: #262137;
  box-shadow: 0 25px 100px #10122350;
}
.ops-dialog::backdrop {
  background: #17132288;
  backdrop-filter: blur(3px);
}
.ops-dialog .card-head {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
}
.ops-dialog .card-head h2 {
  font-size: 23px;
  margin: 0;
}
.ops-dialog .form-grid {
  margin: 18px 0;
}
.ops-dialog input,
.ops-dialog select {
  width: 100%;
  padding: 11px;
  border: 1px solid #ccc5da;
  border-radius: 8px;
  background: #fff;
  color: #242038;
  font: inherit;
  min-width: 0;
}
.ops-dialog input[type="checkbox"] {
  width: 20px;
  height: 20px;
}
.ops-dialog input[type="hidden"] {
  display: none;
}
.ops-dialog label:has(input[type="hidden"]) {
  display: none;
}
.ops-dialog label {
  font-size: 13px;
  display: grid;
  gap: 7px;
  font-weight: 600;
}
.ops-dialog table {
  width: 100%;
  border-collapse: collapse;
}
.ops-dialog td,
.ops-dialog th {
  padding: 10px;
  border-bottom: 1px solid #e3deeb;
  text-align: left;
  font-size: 13px;
}
.ops-dialog .table-wrap {
  overflow: auto;
  max-height: 40vh;
}
.ops-alert {
  padding: 16px;
  border-left: 4px solid #c94c36;
  background: #fff1e9;
  border-radius: 8px;
  color: #712817;
}
.ops-health {
  font-size: 12px;
  letter-spacing: 0.01em;
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 15px;
  color: #5b6170;
}
.ops-health[data-error="true"] {
  color: #972b22;
}
.ops-global-search {
  position: relative;
  min-width: 200px;
  max-width: 350px;
}
.ops-global-search label {
  font-size: 11px;
  display: block;
  margin-bottom: 4px;
  color: #5b5962;
}
.ops-global-search input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ddd7e6;
  border-radius: 9px;
  background: #fff;
}
.ops-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  box-shadow: 0 10px 35px #25203630;
  border-radius: 12px;
  max-height: 55vh;
  overflow: auto;
  padding: 8px;
}
.ops-search-results .btn {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 13px;
  white-space: normal;
  margin: 3px 0;
}
.ops-agenda {
  padding-left: 20px;
  line-height: 1.8;
}
.ops-account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.ops-lock {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: #191a2ee8;
  display: grid;
  place-items: center;
  padding: 20px;
}
.ops-lock[hidden] {
  display: none;
}
.ops-lock > div {
  background: #fff;
  border-radius: 18px;
  padding: 30px;
  max-width: 480px;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  box-shadow: 0 20px 60px #0005;
}
.ops-lock h2 {
  color: #27233c;
}
.ops-lock p {
  color: #605c6b;
}
.ops-sync-conflict {
  border: 2px solid #e3a145;
  background: #fff9eb;
  padding: 16px;
  border-radius: 12px;
}
.ops-team-person {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #ddd;
}
.ops-status-pill {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 20px;
  background: #eeeaf8;
  color: #4f3b78;
  font-size: 12px;
  font-weight: 700;
}
.ops-ready {
  color: #196442;
}
.ops-staff [data-finance-only] {
  display: none !important;
}
.ops-hidden {
  display: none !important;
}
@media (max-width: 1000px) {
  .ops-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ops-global-search {
    max-width: 260px;
  }
  .ops-cockpit .card-head {
    flex-wrap: wrap;
  }
}
@media (max-width: 600px) {
  .ops-metrics {
    gap: 8px;
  }
  .ops-metric {
    padding: 12px;
  }
  .ops-metric strong {
    font-size: 20px;
  }
  .ops-dialog {
    padding: 18px;
    width: calc(100vw - 16px);
  }
  .ops-dialog .form-grid {
    grid-template-columns: 1fr;
  }
  .ops-global-search {
    display: none;
  }
  .ops-card {
    padding: 17px;
  }
  .ops-target {
    padding: 14px;
  }
  .ops-target > div {
    font-size: 14px;
  }
  .ops-account-grid {
    grid-template-columns: 1fr;
  }
  .ops-cockpit input {
    min-height: 40px;
  }
  .ops-card .button-row .btn {
    min-height: 44px;
  }
  .ops-root {
    gap: 14px;
  }
}
.ai-launch {
  border: 1px solid #8360b8;
  background: #f1e9ff;
  color: #4b287d;
  white-space: nowrap;
}
.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 20px;
  align-items: center;
}
.topbar .page-heading {
  min-width: 0;
}
.topbar .ops-global-search {
  display: block;
  min-width: 0;
  width: 100%;
  max-width: 460px;
}
.topbar > .ai-launch {
  justify-self: end;
}
@media (max-width: 1100px) {
  .topbar .page-heading,
  .topbar .top-actions {
    grid-column: 1 / -1;
  }
  .topbar .top-actions {
    justify-content: flex-start;
  }
}
.ai-invite {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-color: #d7c5f1;
  background: linear-gradient(110deg, #f4edff, #fff5e5);
}
.ai-invite p {
  margin: 5px 0;
}
.ai-invite .eyebrow {
  color: #684691;
}
.ai-conversation {
  max-height: 260px;
  overflow: auto;
  margin: 16px 0;
}
.ai-message {
  white-space: pre-wrap;
  padding: 12px 14px;
  border-radius: 12px;
  line-height: 1.55;
  font-size: 14px;
}
.ai-user {
  background: #eae4f4;
  margin-left: 24px;
}
.ai-assistant {
  background: #f3f5f8;
  margin-right: 16px;
}
.ai-item {
  border: 1px solid #d8cde7;
  padding: 16px;
  border-radius: 12px;
  margin: 12px 0;
}
#ai-description {
  width: 100%;
  padding: 14px;
  border: 1px solid #bdb2cc;
  border-radius: 10px;
  font: inherit;
  resize: vertical;
}
#ai-proposal {
  margin-top: 22px;
}
#ai-apply-status,
#ai-status {
  font-size: 13px;
  color: #66473b;
}
@media (max-width: 600px) {
  .ai-invite {
    align-items: stretch;
    flex-direction: column;
  }
  .ai-invite .btn {
    width: 100%;
  }
  .ai-launch {
    font-size: 12px;
  }
}

/* V33: readable touch layouts, including the account and assistant dialogs. */
.ops-priorities { display:grid; gap:12px; }
.ops-priority { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px 16px; border:1px solid #e3dbea; border-left:5px solid #9c7db9; border-radius:12px; background:#fcfaff; }
.ops-priority.level-1 { border-left-color:#d46b34; background:#fff7ef; }
.ops-priority p { margin:4px 0 0; color:var(--muted); }
.ops-priority > div { min-width:0; overflow-wrap:anywhere; }
.ops-priority .btn { flex-shrink:0; }
.ai-capture { margin-top:10px; }
.reliability-file, .ai-photo-label { position:relative; overflow:hidden; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; min-height:44px; }
.ai-capture input[type=file], .reliability-file input { position:absolute; inset:0; width:100%; max-width:none; height:100%; margin:0; opacity:0; cursor:pointer; }
.reliability-file:focus-within, .ai-photo-label:focus-within { outline:3px solid #7b55a4; outline-offset:3px; }
.ai-photos { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr)); gap:12px; margin:12px 0; }
.ai-photos:empty { display:none; }
.ai-photos figure { min-width:0; margin:0; padding:8px; border:1px solid var(--line); border-radius:12px; background:#faf7fe; }
.ai-photos img { width:100%; height:170px; object-fit:contain; background:white; border-radius:8px; }
.ai-photos figcaption { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:4px; margin-top:6px; }
.ai-transcription { border:1px solid #c9b1e2; border-radius:12px; padding:14px; margin:14px 0; background:#fbf7ff; }
.ai-transcription summary { cursor:pointer; font-weight:700; min-height:44px; display:flex; align-items:center; }
.ai-transcription summary::before { content:"+"; margin-right:10px; }
.ai-transcription[open] summary::before { content:"−"; }
.ai-transcription textarea, .ai-review-field textarea { width:100%; box-sizing:border-box; font:inherit; line-height:1.55; resize:vertical; }
.ai-review-field { min-width:0; }
.ai-review-field small { display:block; overflow-wrap:anywhere; }
.ai-value-unit { display:grid; grid-template-columns:minmax(0,1fr) minmax(85px,.55fr); align-items:end; gap:8px; }
.ai-services { min-width:0; padding:12px; margin:16px 0 0; border:1px solid var(--line); border-radius:10px; display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)); gap:8px; }
.ai-services label { display:flex; align-items:center; gap:10px; min-height:44px; }
.ai-services input { flex:none; width:22px; height:22px; margin:0; }
.ai-item > label { margin-bottom:12px; }
.ai-before { color:var(--muted); align-self:end; padding:8px; background:#f5f2f8; border-radius:8px; }
.ai-undo-banner { position:fixed; z-index:1500; bottom:max(18px,env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); width:max-content; max-width:calc(100vw - 24px); display:flex; align-items:center; gap:12px; padding:12px 16px; background:#faf4ff; color:#442563; border:1px solid #bda2d5; border-radius:14px; box-shadow:0 8px 30px #29133f25; }
.reliability-file { margin-top:12px; }
#ai-budget-body progress { width:100%; accent-color:#7b55a4; }
.ops-dialog { max-height:calc(100dvh - 32px); overscroll-behavior:contain; overflow-y:auto; scroll-padding-block:80px; }
.ops-dialog > .card-head { position:sticky; top:-20px; z-index:2; padding:12px 0; background:var(--card); }
.ops-dialog :is(input,select,textarea) { max-width:100%; min-width:0; }
.ops-dialog .button-row { flex-wrap:wrap; }
.ops-card :is(p,span,strong), .ai-item { overflow-wrap:anywhere; }
@media (pointer:coarse), (max-width:1100px) {
  .btn, .icon-btn, .catalog-card summary, .ops-disclosure summary { min-height:44px; }
  input:not([type=checkbox]):not([type=radio]), select, textarea { font-size:16px; min-height:44px; }
  input[type=checkbox],input[type=radio] { min-width:22px; min-height:22px; }
  .table-wrap { -webkit-overflow-scrolling:touch; overscroll-behavior-x:contain; }
  .catalog-grid { grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr)); }
}
@media (min-width:601px) and (max-width:1024px) {
  .ops-dialog { width:calc(100vw - 48px); max-width:760px; padding:24px; }
  .ops-team-person { flex-wrap:wrap; }
}
@media (max-width:767px) {
  .ops-responsive-table { min-width:0 !important; width:100%; }
  .ops-responsive-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .ops-responsive-table tbody, .ops-responsive-table tr { display:block; }
  .ops-responsive-table tr { padding:10px 0; border-bottom:1px solid var(--line); }
  .ops-responsive-table td { display:grid; grid-template-columns:minmax(90px,36%) minmax(0,1fr); gap:12px; align-items:center; padding:7px 0; border:0; white-space:normal; overflow-wrap:anywhere; text-align:left; }
  .ops-responsive-table td::before { content:attr(data-label); color:var(--muted); font-size:12px; font-weight:600; }
  .ops-responsive-table td[colspan] { display:block; }
  .ops-responsive-table td[colspan]::before { content:none; }
  .ops-responsive-table td .btn { justify-self:start; }
  .ops-priority { padding:12px; }
  .ai-undo-banner { bottom:calc(88px + env(safe-area-inset-bottom)); flex-wrap:wrap; gap:8px; font-size:13px; }
  .ai-undo-banner > span { flex-basis:100%; }
  .ops-team-person { flex-wrap:wrap; align-items:flex-start; }
  .ops-team-person > span { flex:1 1 180px; overflow-wrap:anywhere; }
}
@media (max-width:600px) {
  .ops-dialog { width:calc(100vw - 12px); max-width:none; margin:6px auto; max-height:calc(100dvh - 12px); padding:16px; border-radius:16px; }
  .ops-dialog > .card-head { top:-16px; padding:10px 0; gap:10px; }
  .ops-dialog > .card-head h2 { font-size:21px; }
  .ops-dialog-close { flex-shrink:0; }
  .ops-dialog form .button-row, .ai-capture { align-items:stretch; }
  .ops-dialog form .button-row .btn { flex:1 1 120px; }
  .ai-message { margin-left:0; margin-right:0; }
  .ai-item { padding:12px; }
  #ai-apply { width:100%; min-height:48px; }
  .ops-cockpit .card-head label { width:100%; }
  .topbar .top-actions { flex-wrap:wrap; gap:8px; }
  .topbar .ops-global-search { max-width:none; }
  .ops-card .button-row { flex-wrap:wrap; }
  .ops-card .button-row .btn { flex:1 1 150px; white-space:normal; }
  .ops-priority .btn { min-width:48px; }
}
@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
  *,*::before,*::after { animation-duration:0.01ms !important; transition-duration:0.01ms !important; }
}

/* Completion report: a readable page, including at narrow workshop widths. */
.completion-dialog { width:min(1100px,calc(100vw - 32px)); max-width:1100px; max-height:calc(100dvh - 32px); padding:0; background:#faf8fd; border:1px solid #e2d8ed; scroll-padding-top:24px; }
.completion-dialog * { box-sizing:border-box; }
.completion-dialog :is(h2,h3,h4,p) { overflow-wrap:anywhere; }
.completion-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; padding:30px 32px 24px; background:linear-gradient(118deg,#402262,#702f83 64%,#a8397c); color:white; }
.completion-heading .eyebrow { margin:0 0 10px; color:#ffdc9b; }
.completion-heading h2 { margin:0; font-size:clamp(24px,3.2vw,34px); line-height:1.12; letter-spacing:-.6px; }
.completion-heading p:last-child { margin:10px 0 0; opacity:.92; }
.completion-heading .btn { flex:none; border:1px solid #ffffff65; background:#ffffff12; color:white; }
.completion-heading .btn:hover { background:#ffffff24; }
.completion-intro { margin:0; padding:22px 32px 4px; color:#62576f; line-height:1.65; }
#completion-form { padding:20px 32px 0; }
.completion-summary { border:1px solid #ddd0ee; border-radius:18px; padding:20px; background:#f1e9fa; }
.completion-summary-head { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:8px; margin-bottom:16px; }
.completion-summary-head h3 { margin:0; color:#472162; font-size:19px; }
.completion-summary-head > span { color:#71607d; font-size:12px; }
.completion-totals { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; }
.completion-totals > div { display:flex; min-width:0; flex-direction:column; gap:5px; }
.completion-totals span { font-size:12px; color:#6c577b; }
.completion-totals strong { color:#492562; font-size:clamp(21px,2.3vw,29px); letter-spacing:-.7px; overflow-wrap:anywhere; }
.completion-totals small { color:#776784; line-height:1.55; }
.completion-totals .completion-negative strong { color:#a33036; }
.completion-summary > p { color:#776784; font-size:12px; margin:16px 0 0; line-height:1.6; }
.completion-section { padding-top:30px; }
.completion-section-title { display:flex; align-items:flex-start; gap:14px; margin-bottom:16px; }
.completion-section-title > span { display:grid; place-items:center; flex:none; min-width:38px; height:38px; border-radius:12px; background:#eadcf6; color:#652d85; font-size:13px; font-weight:800; }
.completion-section:nth-of-type(3) .completion-section-title > span { background:#fff0d0; color:#986024; }
.completion-section:nth-of-type(4) .completion-section-title > span { background:#f9dded; color:#9a306c; }
.completion-section-title h3 { font-size:21px; margin:1px 0 7px; color:#362145; }
.completion-section-title p { margin:0; font-size:13px; color:#7a6a85; line-height:1.6; }
.completion-entries,.completion-measurements { display:grid; gap:14px; }
.completion-entry { background:white; border:1px solid #e5ddec; border-radius:14px; padding:18px; min-width:0; }
.completion-entry h4 { font-size:16px; margin:0; color:#402450; }
.completion-entry > .help { margin:8px 0 12px; line-height:1.6; }
.completion-entry-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; }
.completion-entry-head h4 { min-width:0; }
.completion-entry-head > .btn { flex:none; }
.completion-dialog .completion-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.completion-dialog .completion-fields label { min-width:0; line-height:1.5; }
.completion-fields .completion-wide { grid-column:1/-1; }
.completion-dialog :is(input,select,textarea) { max-width:100%; width:100%; min-width:0; }
.completion-dialog input[readonly] { color:#706179; background:#f5f1f7; }
.completion-dialog textarea { font:inherit; line-height:1.6; resize:vertical; border:1px solid #ccc5da; border-radius:10px; padding:12px; background:white; color:#242038; }
.completion-dialog .completion-check { display:flex; align-items:flex-start; gap:12px; font-size:14px; line-height:1.6; padding:8px 0; margin-top:12px; }
.completion-check input[type=checkbox] { flex:none; width:22px; height:22px; margin:0; accent-color:#763997; }
.completion-dialog .completion-confirm { padding:18px; border:1px solid #d6bddf; background:#f1e7f7; border-radius:12px; color:#462158; margin:20px 0; }
.completion-linked { background:#f9f7fb; }
.completion-linked p { margin:8px 0; }
.completion-tag { display:inline-block; padding:5px 9px; border-radius:7px; font-size:11px; line-height:1.4; color:#644b74; background:#ebe2f2; }
.completion-empty { margin:0; padding:20px; border:1px dashed #d8c8e5; border-radius:14px; color:#887692; font-size:14px; line-height:1.6; }
.completion-add { margin-top:12px; min-height:44px; border-color:#cdb7df; color:#682e88; }
.completion-footer { padding:12px 0 22px; border-top:1px solid #e4d8ed; }
.completion-footer-actions { display:flex; justify-content:space-between; flex-wrap:wrap; gap:12px; }
.completion-footer-actions .primary { background:#773994; color:white; border-color:#773994; }
.completion-footer-actions .primary:hover { background:#642b81; }
.completion-footer .help { margin-bottom:0; line-height:1.6; }
#completion-message { margin:0 0 12px; color:#8b2f59; line-height:1.6; }
#completion-message:empty { display:none; }
.completion-report-meta { margin-bottom:14px; }
.completion-dialog[aria-busy=true] { cursor:progress; }
.completion-dialog :focus-visible { outline:3px solid #ae75cc; outline-offset:3px; }
@media (min-width:601px) and (max-width:1024px) {
  .completion-dialog { width:calc(100vw - 32px); max-width:1100px; padding:0; }
}
@media (max-width:700px) {
  .completion-totals { grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px 14px; }
  .completion-heading { padding:24px; }
  .completion-intro { padding:20px 24px 0; }
  #completion-form { padding:20px 24px 0; }
}
@media (max-width:600px) {
  .completion-dialog { width:calc(100vw - 12px); max-width:none; margin:6px auto; padding:0; max-height:calc(100dvh - 12px); border-radius:16px; }
  .completion-heading { gap:12px; padding:20px 16px; }
  .completion-heading h2 { font-size:25px; }
  .completion-heading .btn { min-width:48px; padding:8px; font-size:12px; }
  .completion-intro { padding:18px 16px 0; font-size:13px; }
  #completion-form { padding:18px 16px 0; }
  .completion-summary { padding:16px; }
  .completion-section { padding-top:26px; }
  .completion-section-title { gap:10px; }
  .completion-section-title h3 { font-size:19px; }
  .completion-section-title > span { min-width:32px; height:32px; border-radius:10px; }
  .completion-entry { padding:14px; }
  .completion-dialog .completion-fields { grid-template-columns:minmax(0,1fr); gap:14px; }
  .completion-entry-head { align-items:flex-start; }
  .completion-entry-head .completion-tag { max-width:45%; }
  .completion-footer-actions { flex-direction:column-reverse; align-items:stretch; }
  .completion-footer-actions .btn { width:100%; white-space:normal; min-height:48px; }
  .completion-dialog .completion-check { font-size:13px; }
  .completion-dialog .completion-confirm { padding:14px; }
}

/* Purchasing: a compact daily workspace, shared by desktop and mobile. */
.purchase-root { gap: 22px; }
.purchase-hero { background: linear-gradient(125deg, #123e50, #086b72); color: #fff; border: 0; }
.purchase-hero h2 { color: #fff; font-size: clamp(1.55rem, 3vw, 2.15rem); letter-spacing: -.035em; }
.purchase-hero .eyebrow { color: #ffdb73; }
.purchase-hero p { color: #e5f3f4; }
.purchase-hero .ops-metric { background: #ffffff13; border: 1px solid #ffffff24; color: #fff; }
.purchase-hero .ops-metric :is(span, strong, small) { color: inherit; }
.purchase-hero .ops-metric small { opacity: .85; }
.purchase-hero .btn.primary { background: #ffce62; color: #153746; border-color: #ffce62; }
.purchase-hero .btn.ghost { border: 1px solid #ffffff75; color: #fff; background: transparent; }
.purchase-hero .button-row { flex-shrink: 0; }
.purchase-order-list { display: grid; gap: 10px; margin-top: 18px; }
.purchase-order { display: flex; align-items: center; justify-content: space-between; text-align: left; gap: 16px; width: 100%; border: 1px solid var(--border, #d9e3e8); border-radius: 14px; padding: 16px 18px; color: var(--text, #153746); background: var(--card, #fff); font: inherit; cursor: pointer; }
.purchase-order > span { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.purchase-order > span:last-child { text-align: right; }
.purchase-order strong { font-size: 1.04rem; }
.purchase-order small { color: var(--muted, #5a6b78); }
.purchase-order:hover, .purchase-order.selected { border-color: #118282; background: #edf9f8; }
.purchase-order:focus-visible { outline: 3px solid #158d91; outline-offset: 3px; }
.purchase-detail { scroll-margin-top: 18px; border-top: 4px solid #118282; }
.purchase-detail h3 { margin-top: 26px; }
.purchase-pill { display: inline-block; padding: 6px 10px; border-radius: 20px; font-size: .82rem; font-weight: 700; background: #edf5f5; color: #20525b; }
.purchase-milestones { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 18px 0; }
.purchase-milestones span { padding: 11px; background: #f1f4f6; color: #546574; border-radius: 9px; font-weight: 650; font-size: .85rem; }
.purchase-milestones .done { background: #ddf2eb; color: #17604c; }
.purchase-empty { background: #f4f8fa; border: 1px dashed #bfced5; border-radius: 14px; padding: 26px; text-align: center; }
.purchase-empty p { margin-bottom: 0; color: #516675; }
.purchase-warning { border-left: 4px solid #e1a338; background: #fff5df; color: #624311; padding: 14px; border-radius: 8px; }
.purchase-dashboard { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-left: 5px solid #118282; }
.purchase-dashboard h2 { font-size: 1.35rem; }
.purchase-dashboard p:last-child { margin-bottom: 0; }
.purchase-dashboard .btn { flex-shrink: 0; }
.purchase-dialog { width: min(860px, calc(100vw - 28px)); max-width: calc(100vw - 28px); max-height: calc(100dvh - 28px); padding: 22px; box-sizing: border-box; overflow-y: auto; }
.purchase-dialog, .purchase-dialog * { box-sizing: border-box; }
.purchase-dialog .card-head { align-items: flex-start; gap: 12px; }
.purchase-dialog h2 { font-size: 1.4rem; }
.purchase-dialog .ops-form, .purchase-form-body { display: grid; gap: 16px; min-width: 0; }
.purchase-dialog label { display: grid; gap: 6px; font-weight: 600; font-size: .88rem; min-width: 0; }
.purchase-dialog :is(input, select, textarea) { max-width: 100%; width: 100%; min-width: 0; }
.purchase-dialog textarea { min-height: 84px; resize: vertical; }
.purchase-dialog .purchase-check { display: flex; align-items: flex-start; line-height: 1.5; gap: 10px; }
.purchase-dialog input[type="checkbox"] { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 2px; }
.purchase-line { border: 1px solid #ccdce0; background: #f6fafb; border-radius: 13px; padding: 16px; margin: 0 0 14px; min-width: 0; }
.purchase-line legend { padding: 0 8px; font-weight: 750; color: #215366; overflow-wrap: anywhere; max-width: 100%; }
.purchase-line .btn { margin-top: 12px; }
.purchase-form-footer { padding-top: 12px; border-top: 1px solid #dbe4e9; }
.purchase-form-footer [role="status"] { color: #9b3d29; white-space: normal; overflow-wrap: anywhere; }
.purchase-draft-total { font-size: 1.15rem; font-weight: 750; color: #175865; }
.purchase-bills { display: grid; gap: 14px; }
.purchase-bill { min-width: 0; border: 1px solid #d5e3e6; border-radius: 14px; padding: 18px; background: #fbfdfd; overflow-wrap: anywhere; }
.purchase-bill .card-head { align-items: flex-start; gap: 12px; }
.purchase-bill h4 { margin: 0; font-size: 1.06rem; color: #174d59; }
.purchase-bill .card-head p { margin: 5px 0 0; }
.purchase-bill-paid { color: #17604c; background: #ddf2eb; }
.purchase-bill-partial { color: #775314; background: #fff0cd; }
.purchase-bill-amounts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 16px 0; gap: 10px; }
.purchase-bill-amounts > div { min-width: 0; background: #f0f5f6; padding: 12px; border-radius: 10px; }
.purchase-bill-amounts dt { font-size: .82rem; color: #526571; }
.purchase-bill-amounts dd { font-size: 1.2rem; font-weight: 750; margin: 5px 0 0; }
.purchase-bill-amounts .purchase-bill-remaining { background: #e1f2ee; color: #155c52; }
.purchase-bill-remaining dt { color: #155c52; }
.purchase-payment-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.purchase-payment-remainder { border-radius: 10px; background: #e1f2ee; color: #155c52; padding: 12px; font-weight: 700; }
.purchase-payment-history { margin-top: 16px; border-top: 1px solid #d5e3e6; padding-top: 14px; }
.purchase-payment-history summary { cursor: pointer; font-weight: 700; color: #215366; padding: 5px 0; }
.purchase-payment-history summary:focus-visible { outline: 3px solid #158d91; outline-offset: 4px; }
.purchase-payment-history ol { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.purchase-payment-history li { padding: 12px 0; border-top: 1px solid #e0e9eb; }
.purchase-payment-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.purchase-payment-row > div { min-width: 0; }
.purchase-payment-row p { margin: 5px 0 0; }
.purchase-payment-row .btn { flex-shrink: 0; }
.purchase-payment-row .purchase-payment-actions { display: grid; gap: 8px; flex-shrink: 0; }
.purchase-payment-voided { color: #6b7379; }
@media (max-width: 700px) {
  .purchase-hero .card-head, .purchase-dashboard { flex-direction: column; align-items: stretch; }
  .purchase-milestones { grid-template-columns: repeat(2, 1fr); }
  .purchase-hero .button-row > .btn, .purchase-form-footer > .btn { width: 100%; }
  .purchase-dialog { padding: 16px; }
  .purchase-dialog .form-grid.two { grid-template-columns: 1fr; }
  .purchase-order { padding: 14px; gap: 10px; }
  .purchase-line { padding: 12px; }
  .purchase-bill { padding: 14px; }
  .purchase-bill .card-head, .purchase-payment-row { flex-direction: column; align-items: stretch; }
  .purchase-bill .purchase-pill { align-self: flex-start; }
  .purchase-bill .button-row > .btn, .purchase-payment-row .btn { width: 100%; }
  .purchase-bill-amounts { gap: 6px; }
  .purchase-bill-amounts > div { padding: 9px; }
  .purchase-bill-amounts dd { font-size: 1rem; }
  .purchase-payment-summary { grid-template-columns: 1fr; }
}
