.op-page {
  --op-ink: #1f352a;
  --op-muted: #536356;
  --op-forest: #234736;
  --op-copper: #885730;
  --op-paper: #fffdf7;
  --op-tint: #eef1e6;
  --op-rule: #d4d9cb;
  --op-input-rule: #929d8b;
  container: op-workspace / inline-size;
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: clamp(1rem,2.5vw,1.75rem);
  width: 100%;
  min-width: 0;
  margin-inline: auto;
  color: var(--op-ink);
  font: 1rem/1.5 DM, "Segoe UI", sans-serif;
  overflow-wrap: anywhere;
}
.op-page *, .op-page *::before, .op-page *::after { box-sizing: border-box; }
.op-page [hidden] { display: none !important; }
.op-page :is(p,h3,h4,dd,dl) { margin: 0; }
.op-page :is(strong,b,h3,h4,dt,th) { font-weight: 400; }
.op-panel {
  min-width: 0;
  /* WebKit includes native select option text in scroll extents even before its menu opens. */
  overflow: clip;
  display: grid;
  grid-template-columns: minmax(0,1fr);
  align-content: start;
  gap: 1rem;
  padding: clamp(1rem,3cqi,2rem);
  border: 1px solid var(--op-rule);
  border-radius: 1rem;
  background: var(--op-paper);
  box-shadow: 0 3px 14px #493b2010;
}
.op-panel > .op-heading {
  color: var(--op-ink);
  font: 400 clamp(1.55rem,4.8cqi,2.15rem)/1.14 Playfair, Georgia, serif;
  letter-spacing: -.024em;
}
.op-panel .op-panel {
  background: #f2f4eb;
  border-radius: .7rem;
  padding: clamp(.8rem,2.2cqi,1.35rem);
  box-shadow: none;
}
.op-panel .op-panel > .op-heading { font-size: clamp(1.2rem,2.6cqi,1.55rem); }
.op-subheading { font-size: 1rem; font-weight: 400; line-height: 1.3; }
.op-intro, .op-muted, .op-draft-state, .op-empty { color: var(--op-muted); }
.op-empty { padding-block: .35rem; }
.op-form, .op-detail, .op-field, .op-drawer, .op-optional[open] {
  min-width: 0; display: grid; grid-template-columns: minmax(0,1fr); gap: 1rem;
}
.op-field { align-content: start; gap: .36rem; }
.op-field > .op-label { font-weight: 400; font-size: .94rem; line-height: 1.4; }
.op-field > .op-muted, .op-draft-state, .op-entry .op-muted, .op-photo-caption { font-size: .85rem; line-height: 1.45; }
.op-paired {
  display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,13rem),1fr));
  align-items: start; gap: .85rem 1rem;
}
.op-input {
  appearance: auto;
  display: block;
  width: 100%; min-width: 0; max-width: 100%; min-height: 3rem;
  padding: .62em .8em;
  border: 1px solid var(--op-input-rule); border-radius: .5rem;
  background: #fffefb; color: var(--op-ink);
  font: inherit; font-size: max(1rem,16px); line-height: 1.4;
  box-shadow: 0 1px 0 #45362006;
}
.op-input::placeholder { color: #626c61; opacity: 1; }
.op-assignment-choice {
  position: relative; overflow: clip; display: grid; grid-template-columns: minmax(0,1fr) .65rem; align-items: center;
  gap: .5rem; min-height: 3rem; padding: .62em .8em; border: 1px solid var(--op-input-rule);
  background: #fffefb; border-radius: .5rem; font-size: max(1rem,16px); line-height: 1.4;
}
.op-assignment-choice::after {
  content: ""; justify-self: center; width: .48rem; height: .48rem; margin-bottom: .25rem;
  border: solid var(--op-copper); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
.op-assignment-choice > select.op-input { position: absolute; inset: 0; opacity: 0; height: 100%; }
.op-assignment-choice:focus-within { outline: 3px solid var(--op-copper); outline-offset: 3px; }
.op-assignment-choice:has(select:disabled) { background: #efeee6; color: var(--op-muted); }
.op-assignment-choice:has(select[aria-invalid="true"]) { border: 2px solid #984222; }
@media (forced-colors: active) {
  .op-assignment-choice { border-color: ButtonText; }
  .op-assignment-choice::after { border-color: currentColor; }
  .op-assignment-choice:has(select:disabled) { color: GrayText; border-color: GrayText; }
  .op-assignment-choice:focus-within { outline-color: Highlight; }
}
.op-booking-time { display: none; font-size: .85rem; color: var(--op-muted); }
textarea.op-input { min-height: 5.4rem; resize: vertical; }
input.op-input[readonly], textarea.op-input[readonly] { background: #efeee6; }
.op-input:disabled, .op-page button:disabled { opacity: .64; cursor: default; }
.op-input[aria-invalid="true"] { border: 2px solid #984222; background: #fff8f0; }
.op-input[type="checkbox"] { width: 1.6rem; height: 1.6rem; min-height: 0; accent-color: var(--op-forest); }
.op-field:has(> .op-input[type="checkbox"]) {
  grid-template-columns: auto minmax(0,1fr); align-items: center; gap: .6rem; min-height: 44px;
}
.op-field:has(> .op-input[type="checkbox"]) .op-label { grid-row: 1; grid-column: 2; line-height: 1.45; padding-block: .4rem; }
.op-field:has(> .op-input[type="checkbox"]) .op-input { grid-row: 1; grid-column: 1; }
.op-page :is(button,summary,a,input,select,textarea):focus-visible {
  outline: 3px solid var(--op-copper); outline-offset: 3px;
}
.op-input[type="file"] { padding: .32rem; overflow: hidden; }
.op-input::file-selector-button {
  margin-inline-end: .6rem; padding: .38rem .65rem; min-height: 2.25rem;
  border: 1px solid #b7c2ae; border-radius: .3rem;
  background: var(--op-tint); color: var(--op-ink);
  font: inherit; font-size: .94em; font-weight: 400;
}
.op-primary, .op-secondary, .op-photo-remove {
  justify-self: start;
  max-width: 100%; min-width: 0; min-height: max(44px,2.85rem);
  border: 1px solid var(--op-rule); border-radius: .55rem; padding: .55em 1em;
  text-align: center; white-space: normal; overflow-wrap: anywhere;
  font: inherit; line-height: 1.45; font-weight: 400; cursor: pointer;
}
.op-primary {
  background: var(--op-forest); border-color: var(--op-forest); color: white;
  box-shadow: 0 2px 4px #172d1e18;
}
.op-secondary, .op-photo-remove { color: var(--op-forest); background: #fafbf3; border-color: #b9c4af; }
@media (hover:hover) {
  .op-primary:hover:not(:disabled) { background: #163a29; }
  .op-secondary:hover:not(:disabled), .op-photo-remove:hover:not(:disabled) { background: #e8ecdf; }
  .op-summary:hover { background: #f4f4e9; }
  .op-optional-label:hover { color: var(--op-copper); }
}
.op-previews, .op-attachments { display: flex; flex-wrap: wrap; gap: .75rem; }
.op-photo-actions { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,8.1rem),1fr)); gap: .5rem; }
.op-photo-actions > button { width: 100%; padding-inline: .65rem; }
.op-photo-actions > button:first-child { background: #e9eee2; color: var(--op-forest); border-color: #a0b09a; }
.op-photo-status { color: var(--op-muted); font-size: .85rem; }
.op-photo-status:empty { display: none; }
.op-preview, .op-attachment { width: min(100%,7rem); max-width: 100%; min-width: 0; }
.op-attachment { display: block; color: var(--op-forest); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.op-thumbnail {
  display: block; width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; border-radius: .4rem;
  mask-image: linear-gradient(to bottom,#000 83%,transparent);
}
.op-photo-remove { width: 100%; padding-inline: .3rem; font-size: .84rem; }
.op-photo-caption { display: block; margin-top: .1rem; color: var(--op-muted); }
.op-previews:empty, .op-attachments:empty, .op-draft-state:empty, .op-log:empty { display: none; }
.op-optional { min-width: 0; border-top: 1px solid var(--op-rule); padding-top: .25rem; }
.op-optional-label {
  min-height: max(44px,2.85rem); list-style-position: inside; padding-block: .6rem;
  cursor: pointer; color: var(--op-forest); font-weight: 400; line-height: 1.45;
}
.op-optional-label::marker { color: var(--op-copper); }
.op-tickets { display: grid; gap: .55rem; min-width: 0; }
.op-ticket {
  min-width: 0;
  border: 1px solid var(--op-rule); border-radius: .7rem;
  background: #fffefa;
}
.op-summary {
  display: grid; grid-template-columns: minmax(0,1fr) auto 1.35rem;
  align-items: center; gap: .45rem .75rem;
  min-width: 0; min-height: 4.2rem;
  padding: .7rem .9rem; border-radius: inherit; cursor: pointer; list-style: none;
}
.op-summary::-webkit-details-marker { display: none; }
.op-summary::after {
  content: ""; justify-self: center; width: .55rem; height: .55rem;
  border: solid var(--op-copper); border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-2px);
}
.op-ticket[open] { border-color: #abbbaa; }
.op-ticket[open] > .op-summary { background: #f1f4e8; border-radius: .65rem .65rem 0 0; }
.op-ticket[open] > .op-summary::after { transform: rotate(225deg) translateY(-2px); }
.op-ticket-head { display: grid; gap: .15rem; min-width: 0; }
.op-ticket-code { color: var(--op-copper); font-size: .81rem; font-weight: 400; }
.op-ticket-name {
  color: var(--op-ink); font-size: 1rem; font-weight: 400; line-height: 1.35;
  display: block;
}
.op-ticket[open] .op-ticket-name { display: block; overflow: visible; }
.op-tag, .op-current-status {
  --status-bg: #e6ecdf;
  --status-ink: #314e3d;
  display: inline-flex; align-items: center; align-self: center; justify-self: start;
  max-width: 100%; min-width: 0; padding: .18em .65em;
  border: 1px solid transparent; border-radius: 1.1rem;
  background: var(--status-bg); color: var(--status-ink);
  font-size: .81rem; font-weight: 400; line-height: 1.45;
}
.op-page [data-status="New"] { --status-bg:#f3e7d3; --status-ink:#754817; }
.op-page [data-status="Scheduled"] { --status-bg:#e5ebee; --status-ink:#2e505b; }
.op-page [data-status="In progress"] { --status-bg:#e2ebd5; --status-ink:#345228; }
.op-page [data-status="Waiting"] { --status-bg:#fae3ce; --status-ink:#7a4024; }
.op-page [data-status="Ready for inspection"] { --status-bg:#eae4ee; --status-ink:#543a60; }
.op-page [data-status="Closed"] { --status-bg:#d7e9d9; --status-ink:#254b35; }
.op-drawer { border-top: 1px solid var(--op-rule); padding: clamp(.7rem,2.2cqi,1.2rem); }
.op-description, .op-entry, .op-fact dd { white-space: pre-line; overflow-wrap: anywhere; }
.op-tracker {
  container-type: inline-size;
  display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center;
  gap: .55rem .7rem;
  min-width: 0; padding: .8rem .95rem;
  border: 1px solid #c5cfbb; border-radius: .65rem; background: #f1f4e9;
}
.op-current-status { justify-self: end; }
.op-steps {
  grid-column: 1/-1; display: grid; grid-template-columns: repeat(5,minmax(0,1fr));
  list-style: none; padding: .2rem 0 0; margin: 0; gap: 0;
}
.op-steps li {
  position: relative; display: grid; align-content: start; justify-items: start; gap: .35rem;
  margin: 0; color: var(--op-muted); font-size: .82rem; line-height: 1.35; padding-inline-end: .3rem;
}
.op-steps li::before {
  z-index: 1; content: ""; width: .7rem; height: .7rem; border: 1.5px solid #81917a;
  border-radius: 50%; background: #f1f4e9;
}
.op-steps li:not(:last-child)::after {
  content: ""; position: absolute; top: .32rem; left: .35rem; right: -.35rem; height: 1px; background: #aebba6;
}
.op-steps .op-step-done::before { border-color: #47654b; background: #47654b; }
.op-steps .op-step-current { color: var(--op-ink); font-weight: 400; }
.op-steps .op-step-current::before { border-color: var(--op-forest); background: var(--op-forest); box-shadow: 0 0 0 2px #f1f4e9,0 0 0 3px var(--op-forest); }
@container (max-width: 24rem) {
  .op-steps { grid-template-columns: 1fr; padding-top: .1rem; }
  .op-steps li { min-height: 1.32rem; grid-template-columns: .75rem minmax(0,1fr); align-items: center; gap: .5rem; }
  .op-steps li:not(:last-child)::after { top: .7rem; bottom: -.7rem; left: .3rem; width: 1px; height: auto; }
}
.op-facts { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,13rem),1fr)); gap: 0 1.1rem; padding: 0; }
.op-fact { display: grid; align-content: start; padding: .42rem 0; border-bottom: 1px solid #e1e4d8; }
.op-fact dt { color: var(--op-muted); font-size: .83rem; font-weight: 400; }
.op-fact dd { font-size: .98rem; line-height: 1.4; }
.op-log { display: grid; list-style: none; margin: 0; padding: 0; min-width: 0; }
.op-entry { min-width: 0; display: grid; gap: .12rem; padding: .65rem 0; border-bottom: 1px solid var(--op-rule); }
.op-entry:last-child { border-bottom: 0; }
.op-tracker-updates { padding-top: .8rem; border-top: 1px solid var(--op-rule); }
.op-tracker-updates .op-log { margin-top: .25rem; }
.op-tracker-updates .op-entry { position: relative; margin-inline-start: .22rem; padding-inline-start: 1.1rem; border: 0; }
.op-tracker-updates .op-entry::before {
  content: ""; position: absolute; left: 0; top: 1.06rem; width: .45rem; height: .45rem;
  border-radius: 50%; background: var(--op-copper);
}
.op-tracker-updates .op-entry:not(:last-child)::after {
  content: ""; position: absolute; left: .19rem; top: 1.5rem; bottom: -1rem; width: 1px; background: #d3d7c6;
}
.op-counts { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,7rem),1fr)); gap: .5rem; }
.op-count { min-width: 0; display: grid; align-content: start; gap: .2rem; padding: .8rem; border-radius: .5rem; background: var(--op-tint); border-top: 2px solid #b3bfa6; }
.op-count strong { color: var(--op-forest); font: 400 clamp(1.7rem,5cqi,2.3rem)/1.1 Playfair,Georgia,serif; font-variant-numeric: lining-nums tabular-nums; }
.op-count span { color: var(--op-muted); font-size: .86rem; font-weight: 400; }
.op-stock-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: baseline; gap: .65rem; padding: .72rem 0; border-bottom: 1px solid var(--op-rule); }
.op-stock-row:last-child { border-bottom: 0; }
.op-stock-row > span { max-width: 12rem; border-radius: .4rem; padding: .2em .6em; background: var(--op-tint); color: var(--op-forest); text-align: end; line-height: 1.4; font-variant-numeric: tabular-nums; }

/* The wide request form pairs its controls with the property's approved photograph. */
@container op-workspace (min-width: 49rem) {
  .op-page[data-view="report"] > .op-panel {
    grid-template-columns: minmax(0,1.35fr) minmax(0,.75fr); column-gap: 2rem;
  }
  .op-page[data-view="report"] > .op-panel::after {
    content: ""; grid-column: 2; grid-row: 1/3; align-self: stretch;
    border-radius: .6rem .6rem 0 0;
    background: linear-gradient(180deg,transparent 58%,#fffdf700 68%,var(--op-paper)),url("picture.php?name=estate-phone.jpg") 50% 39%/cover no-repeat;
  }
  .op-page[data-view="report"] > .op-panel > :is(.op-heading,.op-form) { grid-column: 1; }
}
@container op-workspace (max-width: 34rem) {
  .op-summary { grid-template-columns: minmax(0,1fr) 1rem; gap: .28rem .55rem; }
  .op-summary > .op-ticket-head { grid-column: 1; grid-row: 1; }
  .op-summary > .op-tag { grid-column: 1; grid-row: 2; }
  .op-summary::after { grid-column: 2; grid-row: 1/3; }
  .op-primary { width: 100%; }
  .op-facts { grid-template-columns: 1fr; }
  .op-fact { grid-template-columns: minmax(0,.72fr) minmax(0,1fr); align-items: baseline; gap: .6rem; }
}
@container op-workspace (max-width: 24rem) {
  .op-panel .op-panel { padding: .65rem; }
}
@container op-workspace (max-width: 16.25rem) {
  .op-booking-time:not(:empty) { display: block; }
}
@container op-workspace (max-width: 18rem) {
  .op-panel { padding: .75rem; border-radius: .65rem; }
  .op-drawer { padding: .65rem; }
  .op-tracker { grid-template-columns: minmax(0,1fr); padding: .65rem; }
  .op-current-status { justify-self: start; }
  .op-stock-row { grid-template-columns: minmax(0,1fr); gap: .25rem; }
  .op-stock-row > span { justify-self: start; text-align: start; }
}
@media (forced-colors:active) {
  .op-tag, .op-current-status, .op-count, .op-steps li::before { border: 1px solid CanvasText; }
  .op-steps .op-step-current::before { outline: 2px solid Highlight; }
  .op-steps .op-step-done::before { background: CanvasText; forced-color-adjust: none; }
}
