:root {
  color-scheme: dark;
  --op-bg: #101011;
  --op-panel: #182227;
  --op-field: #10191e;
  --op-line: #46545d;
  --op-text: #f4f6f7;
  --op-muted: #bfcbd1;
  --op-accent: #ff9c4a;
  --op-orange: #f47a20;
  font: 16px/1.4 Arial, Helvetica, sans-serif;
  background: var(--op-bg);
  color: var(--op-text);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 0; margin: 0; }
:is(h1, h2, h3, p, ul) { margin: 0; }
h1 { font-size: clamp(1.45rem, 5.3vw, 2.2rem); line-height: 1.12; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
button, input, select, textarea {
  min-width: 0;
  min-height: 44px;
  padding: .55rem .7rem;
  border: 1px solid var(--op-line);
  border-radius: 9px;
  background: var(--op-field);
  color: var(--op-text);
  font: inherit;
}

button { cursor: pointer; font-weight: 700; }
button:disabled { opacity: .6; cursor: default; }
button:hover:not(:disabled), select:hover { border-color: var(--op-accent); }
button.op-primary { border-color: #ffaf6c; background: var(--op-orange); color: #211206; }
button.op-primary:hover:not(:disabled) { background: var(--op-accent); }
a { color: #ffad71; }
:is(button, select, input, textarea, a, summary, [tabindex]):focus-visible { outline: 3px solid var(--op-accent); outline-offset: 2px; }
textarea { display: block; width: 100%; min-height: 92px; resize: vertical; }
input[readonly] { background: #202d34; }

.op-header {
  position: relative;
  width: min(100%, 740px);
  margin-inline: auto;
  padding: max(12px, calc(env(safe-area-inset-top, 0px) + 12px))
    max(14px, env(safe-area-inset-right, 0px)) 21px max(14px, env(safe-area-inset-left, 0px));
  background: linear-gradient(133deg, #272a2c, #101011 70%);
}

.op-header::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 16px;
  background: linear-gradient(100deg, #ffad20, #f2700b 70%, #ff9618);
  clip-path: polygon(0 18%, 25% 42%, 54% 72%, 77% 68%, 100% 6%, 100% 42%, 77% 100%, 54% 100%, 25% 70%, 0 46%);
}

.op-brand { display: block; width: min(62vw, 220px); height: auto; margin-inline: auto; }
.op-tools, .op-portal {
  width: min(100%, 1120px);
  margin-inline: auto;
  padding-inline: max(12px, env(safe-area-inset-left, 0px)) max(12px, env(safe-area-inset-right, 0px));
}

.op-tools { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .45rem; padding-block: .65rem; }
.op-portal { padding-bottom: max(20px, calc(env(safe-area-inset-bottom, 0px) + 12px)); overflow-wrap: anywhere; }
.op-narrow { width: min(100%, 660px); margin-inline: auto; }
.op-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.op-welcome {
  width: min(100%, 740px);
  margin-inline: auto;
  overflow: hidden;
  border-radius: 12px;
  background: #faf8f5;
  color: #0b1d33;
  text-align: center;
}

.op-welcome-hero { padding-top: clamp(12px, 3vw, 23px); background: linear-gradient(#9ed2f4, #dfedfa 42%, #faf8f5); }
.op-welcome h1 { max-width: 21ch; margin-inline: auto; padding-inline: .45rem; font-size: clamp(1.6rem, 7.6vw, 3.05rem); text-wrap: balance; }
.op-welcome-hero > img { display: block; width: 100%; height: auto; max-height: 365px; margin-top: .2rem; object-fit: cover; mask-image: linear-gradient(transparent, #000 14%, #000 87%, transparent); }
.op-welcome-emblem { display: block; position: relative; width: 67px; height: 47px; margin: 0 auto .35rem; color: #df6706; }
.op-clipboard { position: absolute; inset: 5px 20px 3px 6px; border: 3px solid currentColor; border-radius: 5px; }
.op-clipboard::before { content: ''; position: absolute; inset: -7px auto auto 8px; width: 18px; height: 9px; border-radius: 4px; background: currentColor; }
.op-clipboard i { position: absolute; inset: 10px 5px auto 8px; height: 3px; border-radius: 2px; background: currentColor; }
.op-clipboard i + i { top: 19px; }
.op-helmet { position: absolute; inset: auto 1px 6px auto; width: 32px; height: 20px; border-radius: 20px 20px 5px 5px; background: linear-gradient(#ffb230, #e56c06); box-shadow: 0 0 0 2px #dcefff; }
.op-helmet::before { content: ''; position: absolute; inset: auto -3px -3px; height: 5px; border-radius: 5px; background: #e56c06; }
.op-welcome-action { padding: .2rem .85rem .85rem; }
.op-welcome-action p { margin-bottom: .55rem; font-weight: 700; }
.op-welcome-action button { width: min(100%, 480px); min-height: 52px; border-radius: 999px; font-size: clamp(1rem, 4.5vw, 1.3rem); }
.op-welcome footer { padding: .6rem; background: #17181a; color: var(--op-text); font-size: .85rem; font-style: italic; }

.op-panel {
  min-width: 0;
  padding: clamp(.75rem, 2vw, 1.15rem);
  border: 1px solid var(--op-line);
  border-radius: 12px;
  background: var(--op-panel);
}

.op-panel > :is(p, form, details, a):not(:first-child) { margin-top: .6rem; }
.op-muted, .op-context { color: var(--op-muted); }
.op-context { margin-bottom: .65rem; }
.op-notice:empty { display: none; }
.op-notice:not(:empty) { margin-top: .65rem; color: var(--op-muted); }
.op-error, .op-notice.op-error { color: #ffc5bc; }
.op-page-head { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .8rem; margin-bottom: .7rem; }
.op-page-head h1 { flex: 1 1 10rem; }
.op-back { border-color: #875931; background: #241b15; color: #ffd3ad; }
.op-list { display: grid; gap: .55rem; margin-bottom: .65rem; padding: 0; list-style: none; }
.op-job { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; padding: .7rem; border: 1px solid var(--op-line); border-radius: 10px; background: var(--op-panel); }
.op-job > div { min-width: 0; }
.op-signin-link { display: inline-flex; min-height: 44px; align-items: center; }
#operator-sign-in { display: grid; gap: .45rem; }
#operator-sign-in button { justify-self: start; }

.op-equipment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(7px, 1.6vw, 13px); }
.op-equipment-tile { display: grid; grid-template-rows: auto 1fr; gap: 5px; padding: clamp(5px, 1.1vw, 8px); border-color: #624523; background: #181513; }
.op-equipment-tile strong { display: grid; place-items: center; min-height: 34px; padding: 5px 4px; border-radius: 6px; background: #fb9137; color: #1b1007; font-size: clamp(.79rem, 2.9vw, 1rem); line-height: 1.15; }
.op-photo-frame { position: relative; display: block; width: 100%; aspect-ratio: 1.74; overflow: hidden; border: 2px solid #f4c543; border-radius: 8px; background: #fff; }
.op-photo-frame img { position: absolute; inset: 0; width: 100%; height: 100%; padding: 4px; object-fit: contain; }
.op-photo-frame img[data-machine="telehandler"] { object-view-box: inset(10% 10% 9% 3%); }
.op-photo-frame img[data-machine="excavator"] { object-view-box: inset(0 20% 2% 20%); }
.op-photo-frame img[data-machine="wheel-loader"] { object-view-box: inset(14% 2.5% 18% 2%); }
.op-photo-frame img[data-machine="backhoe"] { object-view-box: inset(8% 2% 14% 2%); }
.op-photo-frame img[data-machine="track-loader"] { object-view-box: inset(12% .5% 12% 0); }
.op-skid-steer { position: absolute; top: 4px; left: 50%; height: calc(100% - 8px); aspect-ratio: 1; transform: translateX(-50%); background: url("equipment-menu-photos.jpg") 50% 100% / 300% 200% no-repeat; }
.op-unit-list { display: grid; gap: .5rem; }
.op-unit-list button { display: grid; justify-items: start; gap: .15rem; min-height: 54px; text-align: start; }
.op-unit-list button span { color: var(--op-muted); font-weight: 400; }

.op-field { display: grid; min-width: 0; gap: .25rem; }
.op-field label, .op-check-note label { color: var(--op-muted); font-size: .88rem; font-weight: 700; }
.op-identification { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr)); gap: .65rem; margin-bottom: .7rem; }
.op-week { display: grid; grid-template-columns: minmax(135px, .35fr) minmax(0, 1fr); gap: .7rem; align-items: end; margin-bottom: .7rem; }
.op-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .28rem; }
.op-days button { display: grid; gap: .12rem; padding: .34rem .08rem; text-align: center; line-height: 1.1; }
.op-days strong { font-size: .86rem; }
.op-days small { color: var(--op-muted); font-size: .69rem; font-weight: 500; }
.op-days button[aria-pressed="true"], .op-results button[aria-pressed="true"] { border-color: #ff9c4a; background: #4d2e1b; color: #ffd4b1; }
.op-results button[data-result="issue"][aria-pressed="true"] { border-color: #e69180; background: #512b23; color: #ffd2c9; }
.op-form-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, .37fr); align-items: start; gap: .7rem; }
.op-checks { display: grid; min-width: 0; gap: .7rem; }
.op-day-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .45rem; }
.op-day-head + .op-field { margin-top: .65rem; }
details summary { color: #ffad71; cursor: pointer; }
details p { margin-top: .45rem; }
.op-check-group h3 { margin-bottom: .45rem; color: #ffd1a8; }
.op-check { padding-block: .55rem; border-top: 1px solid var(--op-line); }
.op-check-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .5rem; }
.op-results { display: flex; flex-wrap: wrap; gap: .35rem; }
.op-results button { font-size: .9rem; }
.op-check-note { display: grid; gap: .25rem; margin-top: .45rem; }
.op-draft { position: sticky; top: .75rem; display: grid; gap: .65rem; }
.op-draft p:not(:first-child) { margin: 0; }

@media (max-width: 760px) {
  .op-form-layout { grid-template-columns: minmax(0, 1fr); }
  .op-draft { position: static; }
}

@media (max-width: 540px) {
  .op-photo-frame { aspect-ratio: 2.05; }
  .op-week, .op-check-row { grid-template-columns: minmax(0, 1fr); }
  .op-tools { padding-block: .45rem; }
  .op-brand { width: min(56vw, 175px); }
}
