/* Preserve the complete evidence strip instead of cropping it like a thumbnail. */
.attendance-desktop { max-width:760px; margin:24px auto; padding:32px; }
.attendance-desktop .attendance-phone-hint { font-size:20px; line-height:1.7; color:var(--teal-dark); }
.patrol-main[data-view=attendance-detail] .report-photo img {
  display:block; width:100%; height:auto; object-fit:contain;
}
.patrol-main[data-view=attendance-detail] .report-photo-grid {
  grid-template-columns:repeat(auto-fit,minmax(min(280px,100%),1fr));
}

/* Next actions use the shared cards and button hierarchy at every viewport. */
.attendance-next { margin-bottom:20px; border-left:4px solid var(--accent, #d9f54a); }
.attendance-next .patrol-actions { gap:10px; flex-wrap:wrap; }
@media (max-width:600px) {
  .attendance-next .patrol-actions > * { flex:1 1 100%; text-align:center; }
}
@media (min-width:1100px) {
  .worker-app .worker-step:nth-child(2) { border-color:#739382; background:#edf3e8; }
}

.worker-step > div { display:flex; flex-wrap:wrap; gap:8px; }
.report-source-evidence { margin-bottom:20px; }

/* Location is the primary action; evidence remains an optional disclosure. */
.attendance-simple { max-width:760px; }
.attendance-simple .attendance-optional { margin:18px 0; }
.attendance-simple .attendance-optional .patrol-actions { margin:16px 0; gap:12px; }
.attendance-simple footer { margin-top:16px; }
.attendance-simple #attendance-submit { min-height:48px; min-width:160px; }
@media (max-width:600px) {
  .attendance-simple #attendance-submit { width:100%; }
}

/* Each step presents one primary action, using the workbench's existing palette. */
body.worker-app .patrol-main .patrol-form.attendance-simple {
  max-width:720px; margin:24px auto; padding:40px;
}
.attendance-start { text-align:center; padding:32px 0; }
.attendance-start #attendance-locate {
  width:168px; height:168px; border-radius:50%; padding:16px;
  font-size:28px; font-weight:700; box-shadow:0 0 0 12px #eaf0ce;
  transition:transform 180ms ease,box-shadow 180ms ease;
}
.attendance-start #attendance-locate:hover:not(:disabled) { transform:translateY(-2px); box-shadow:0 0 0 16px #eaf0ce; }
.attendance-start p { margin:32px 0 0; color:var(--muted); font-size:14px; line-height:1.6; }
.attendance-simple[data-phase=choose] .attendance-start { display:flex; flex-direction:row-reverse; align-items:center; justify-content:space-between; gap:16px; padding:0 0 24px; }
.attendance-simple[data-phase=choose] #attendance-locate { width:auto; height:48px; flex-shrink:0; border-radius:8px; font-size:14px; box-shadow:none; background:var(--panel); border:1px solid var(--line); }
.attendance-simple[data-phase=choose] .attendance-start p { margin:0; text-align:left; }
#attendance-choose { animation:attendance-reveal 180ms ease-out; }
.attendance-simple #attendance-target { font-size:18px; font-weight:600; padding:8px; height:auto; }
.attendance-simple #attendance-target option { padding:14px 12px; border-radius:6px; }
.attendance-simple #attendance-submit { width:100%; min-height:52px; }
.attendance-simple #attendance-selection { font-size:14px; }
.attendance-simple :focus-visible { outline:3px solid var(--teal); outline-offset:3px; }
.attendance-success { max-width:720px; margin:24px auto; padding:40px; text-align:center; animation:attendance-reveal 180ms ease-out; }
.attendance-success-mark { display:grid; place-items:center; width:80px; height:80px; margin:0 auto 24px; border-radius:50%; color:var(--teal-dark); background:#eaf0ce; }
.attendance-success-mark svg { width:44px; height:44px; }
.attendance-success h2 { font-size:28px; margin:0 0 20px; }
.attendance-success .attendance-success-parcel { font-size:24px; font-weight:700; overflow-wrap:anywhere; margin:0; }
.attendance-success > .button { min-height:52px; min-width:180px; }
.attendance-saved-details { margin-top:32px; padding-top:20px; border-top:1px solid var(--line); text-align:left; }
.attendance-saved-details summary { min-height:44px; cursor:pointer; color:var(--muted); }
@keyframes attendance-reveal { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:translateY(0); } }
@media(max-width:600px) {
  body.worker-app .patrol-main .patrol-form.attendance-simple,.attendance-success { margin:16px 0; padding:24px 20px; }
  .attendance-simple[data-phase=choose] .attendance-start { gap:12px; }
  .attendance-success > .button { width:100%; }
}
@media(prefers-reduced-motion:reduce) {
  #attendance-choose,.attendance-success { animation:none; }
  .attendance-start #attendance-locate { transition:none; }
}
body.worker-app .attendance-success .attendance-success-parcel { font-size:24px; font-weight:700; margin:0; }
body.worker-app .attendance-success > .button { min-height:52px; }
.attendance-simple #attendance-target option[value=""] { font-size:14px; font-weight:400; color:var(--muted); }
.attendance-simple #attendance-target option:checked { background:#eaf0ce; color:var(--ink); }

/* Attendance shares the workbench surface and lime action accent. */
body.worker-app .patrol-main .patrol-form.attendance-simple,
body.worker-app .patrol-main .attendance-success { margin:0 auto; padding:28px; max-width:680px; border:1px solid var(--line); border-radius:12px; background:var(--panel); box-shadow:0 8px 24px #103a3908; }
.attendance-panel-header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; text-align:left; margin-bottom:16px; }
body.worker-app .attendance-panel-header h2 { font-size:26px; line-height:1.3; margin:0 0 6px; color:var(--ink); }
.attendance-panel-header em { color:var(--teal); font-style:normal; }
body.worker-app .attendance-panel-header p { margin:0; font-size:13px; line-height:1.5; color:var(--muted); }
body.worker-app a.attendance-record-link { display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; gap:6px; min-height:44px; padding:8px 12px; border:1px solid var(--line); border-radius:6px; background:var(--panel); color:var(--teal-dark); font-size:13px; text-decoration:none; }
.attendance-stage { width:220px; aspect-ratio:1; margin:auto; position:relative; display:grid; place-items:center; }
.attendance-orbit { position:absolute; inset:5%; border:1px solid #bfd9d2; border-radius:50%; pointer-events:none; }
.attendance-halo { position:absolute; inset:13%; background:#e6f1ed; border-radius:50%; pointer-events:none; }
body.worker-app .attendance-stage #attendance-locate { position:relative; width:65%; height:auto; aspect-ratio:1; min-height:44px; border:0; background:var(--action); color:var(--ink); box-shadow:0 6px 16px #7f96251a; font-size:22px; white-space:nowrap; }
body.worker-app .attendance-stage #attendance-locate:hover:not(:disabled) { background:var(--action-hover); box-shadow:0 6px 20px #7f962530; }
body.worker-app .attendance-start { padding:12px 0; }
body.worker-app .attendance-start p { margin:12px 0 0; font-size:13px; }
.attendance-simple[data-phase=choose] .attendance-stage { width:auto; aspect-ratio:auto; margin:0; flex-shrink:0; }
.attendance-simple[data-phase=choose] .attendance-orbit,.attendance-simple[data-phase=choose] .attendance-halo { display:none; }
body.worker-app .attendance-simple[data-phase=choose] #attendance-locate { width:auto; height:44px; aspect-ratio:auto; font-size:13px; color:var(--teal-dark); background:#edf4f0; border:1px solid var(--line); box-shadow:none; }
body.worker-app .attendance-simple[data-phase=choose] .attendance-start { padding:0 0 12px; }
.attendance-simple #attendance-error:empty,.attendance-simple #attendance-nearby-note:empty { display:none; }
.attendance-metrics { display:grid; grid-template-columns:minmax(90px,1fr) minmax(0,1.7fr); gap:10px; margin:16px 0 0; text-align:left; }
.attendance-metric { min-width:0; padding:12px; background:#f0f5f1; border:1px solid var(--line); border-radius:8px; }
body.worker-app .attendance-metric > span { display:block; color:var(--muted); font-size:12px; line-height:1.4; margin-bottom:6px; }
body.worker-app .attendance-metric p { margin:0 0 4px; display:flex; align-items:baseline; gap:6px; }
body.worker-app #attendance-month-count { font-size:28px; line-height:1.1; color:var(--teal); font-variant-numeric:tabular-nums; }
body.worker-app .attendance-metric small { display:block; font-size:11px; line-height:1.4; color:var(--muted); }
body.worker-app #attendance-coordinates { display:block; white-space:pre-line; font-size:13px; line-height:1.5; font-weight:500; color:var(--ink); overflow-wrap:anywhere; margin-bottom:4px; font-variant-numeric:tabular-nums; }
#attendance-count-retry { min-height:44px; color:var(--teal-dark); background:transparent; border:0; text-decoration:underline; }
body.worker-app .attendance-success-mark { width:64px; height:64px; margin:12px auto 16px; color:var(--teal); background:#e2f0e9; }
body.worker-app .attendance-success h2 { margin-bottom:10px; }
body.worker-app .attendance-success .attendance-panel-header h2 { font-size:24px; margin-bottom:6px; }
body.worker-app .attendance-success .patrol-notice { margin:12px 0; padding:8px; }
.attendance-saved-details { margin-top:12px; padding-top:8px; }
@media(max-width:1099px) {
  body.worker-app .patrol-main:has(.attendance-simple),body.worker-app .patrol-main:has(.attendance-success) { padding:10px 12px; }
  body.worker-app .patrol-main .patrol-form.attendance-simple,body.worker-app .patrol-main .attendance-success { padding:16px; }
  body.worker-app .attendance-panel-header h2 { font-size:22px; }
  body.worker-app .attendance-panel-header p { font-size:12px; }
  .attendance-panel-header { margin-bottom:12px; }
  .attendance-stage { width:clamp(130px,25dvh,200px); }
  body.worker-app .attendance-start { padding:4px 0; }
  body.worker-app .attendance-start p { margin-top:8px; }
  .attendance-metrics { margin-top:12px; gap:8px; }
  .attendance-metric { padding:10px; }
  body.worker-app .attendance-simple .field { margin-bottom:10px; }
  body.worker-app .attendance-simple #attendance-target { font-size:16px; min-height:44px; }
  body.worker-app .attendance-simple footer { margin-top:8px; padding-top:8px; }
  body.worker-app .attendance-simple #attendance-submit { min-height:44px; }
  body.worker-app .attendance-simple #attendance-selection { margin:8px 0; }
  body.worker-app .attendance-simple .attendance-optional { margin:8px 0; }
  body.worker-app .attendance-simple .attendance-optional > summary { padding:8px; min-height:44px; }
  body.worker-app .attendance-success > .button { min-height:44px; }
}
@media(max-width:600px) and (max-height:700px) {
  body.worker-app .patrol-main .patrol-form.attendance-simple,body.worker-app .patrol-main .attendance-success { padding:12px; }
  .attendance-panel-header { margin-bottom:8px; }
  body.worker-app .attendance-panel-header h2 { font-size:20px; }
  .attendance-metrics { margin-top:8px; }
  .attendance-metric { padding:8px; }
  body.worker-app .attendance-success-mark { width:48px; height:48px; margin:8px auto; }
  body.worker-app .attendance-success h2 { font-size:24px; margin-bottom:6px; }
}
@media(max-width:1099px) {
  body.worker-app .attendance-simple .attendance-optional { padding:0; }
  body.worker-app .attendance-simple .attendance-optional[open] { padding:10px; }
}
@media(max-width:600px) and (max-height:700px) {
  body.worker-app .attendance-simple[data-phase=choose] .attendance-panel-header p { display:none; }
  body.worker-app .attendance-simple[data-phase=choose] .attendance-panel-header h2 { margin:8px 0; }
  body.worker-app .attendance-simple[data-phase=choose] .attendance-start { padding-bottom:8px; }
  body.worker-app .attendance-metric > span { margin-bottom:4px; }
  body.worker-app #attendance-coordinate-note { font-size:10px; }
}
@media(max-width:600px) {
  body.worker-app .patrol-main .attendance-success { display:grid; grid-template-columns:48px minmax(0,1fr); gap:6px 10px; }
  .attendance-success > * { grid-column:1/-1; }
  body.worker-app .attendance-success .attendance-panel-header { margin-bottom:4px; }
  body.worker-app .attendance-success-mark { grid-column:1; grid-row:2; width:48px; height:48px; margin:0; }
  body.worker-app .attendance-success #attendance-success-title { grid-column:2; grid-row:2; align-self:center; text-align:left; margin:0; font-size:24px; }
  body.worker-app .attendance-success > p { margin:0; }
  body.worker-app .attendance-success .attendance-metrics { margin-top:4px; }
  body.worker-app .attendance-success .patrol-notice { margin:2px 0; padding:6px; }
  body.worker-app .attendance-success .attendance-saved-details { margin-top:2px; padding-top:4px; }
}
@media(max-width:600px) and (max-height:700px) {
  body.worker-app .patrol-main .attendance-success { row-gap:2px; }
  body.worker-app .attendance-success .attendance-panel-header p { font-size:11px; }
  body.worker-app .attendance-success .attendance-metric { padding:6px 8px; }
}
/* Parcel cards appear in a compact two-column group; selection is explicit. */
body.worker-app .attendance-stage #attendance-locate,
body.worker-app .attendance-simple #attendance-submit,
body.worker-app .attendance-success > .button { background:var(--action); color:var(--ink); border:1px solid var(--action-border); box-shadow:0 6px 16px #7f96251a; }
body.worker-app .attendance-stage #attendance-locate:hover:not(:disabled),
body.worker-app .attendance-simple #attendance-submit:hover:not(:disabled),
body.worker-app .attendance-success > .button:hover { background:var(--sys-primary-hover); color:var(--sys-primary-foreground); }
.attendance-halo { background:#edf4d8; }
.attendance-orbit { border-color:#d5e4ae; }
.attendance-parcels { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.attendance-parcel { position:relative; min-height:64px; padding:10px 30px 10px 12px; border:1px solid var(--line); border-radius:10px; background:var(--panel); color:var(--ink); text-align:left; cursor:pointer; animation:parcel-appear 350ms both; animation-delay:var(--reveal-delay,0ms); transition:background 160ms,border-color 160ms,box-shadow 160ms; }
.attendance-parcel strong { display:block; font-size:14px; overflow-wrap:anywhere; }
.attendance-parcel small { display:block; color:var(--muted); font-size:11px; }
.attendance-parcel-check { position:absolute; right:10px; top:12px; font-size:16px; color:var(--teal); }
.attendance-parcel[aria-pressed=true] { background:#e7f1ed; border-color:var(--selected); box-shadow:inset 0 0 0 1px var(--selected); }
.attendance-pages { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:4px; }
.attendance-pages[hidden] { display:none; }
.attendance-pages button { min-height:44px; border:0; background:transparent; color:var(--teal-dark); padding:8px; font-size:12px; }
.attendance-pages span { color:var(--muted); font-size:12px; }
.attendance-pages button:disabled { opacity:.4; }
.attendance-result-link { display:block; padding:10px 0; min-height:44px; color:var(--teal-dark); }
@keyframes parcel-appear { from { opacity:0; transform:translateY(14px) scale(.96); } to { opacity:1; transform:translateY(0) scale(1); } }
@media(max-width:600px) and (max-height:700px) {
  .attendance-parcel { min-height:56px; padding:6px 26px 6px 8px; }
  body.worker-app .attendance-simple[data-phase=choose] .attendance-panel-header { margin-bottom:4px; }
  body.worker-app .attendance-simple[data-phase=choose] .attendance-start { padding-bottom:4px; }
  body.worker-app .attendance-simple[data-phase=choose] .attendance-metric small { font-size:10px; }
  body.worker-app .attendance-simple #attendance-selection { margin:4px 0; font-size:11px; }
}
@media(prefers-reduced-motion:reduce) {
  .attendance-parcel { animation:none; transition:none; }
}
@media(max-width:1099px) {
  #attendance-choose:not([hidden]):has(.attendance-pages:not([hidden])) { display:grid; grid-template-columns:minmax(0,1fr) auto; column-gap:6px; }
  #attendance-choose > .attendance-parcels,#attendance-choose > footer { grid-column:1/-1; }
  #attendance-choose:not([hidden]):has(.attendance-pages:not([hidden])) > #attendance-selection { grid-column:1; grid-row:2; align-self:center; }
  #attendance-choose > .attendance-pages { grid-column:2; grid-row:2; gap:2px; margin:0; }
  .attendance-pages button { padding:6px; }
}
/* Fill the space between the actual header and navigation, including dynamic browser bars. */
@media(max-width:1099px) {
  body.worker-app .patrol-main:has(.attendance-simple),
  body.worker-app .patrol-main:has(.attendance-success) { display:flex; flex-direction:column; }
  .patrol-main:has(.attendance-simple) #patrol-content,
  .patrol-main:has(.attendance-success) #patrol-content { display:flex; flex-direction:column; flex:1; }
  body.worker-app .patrol-main .patrol-form.attendance-simple { display:flex; flex-direction:column; flex:1; width:100%; }
  .attendance-simple #attendance-fields { display:flex; flex-direction:column; flex:1; }
  body.worker-app .attendance-simple:not([data-phase=choose]) .attendance-start { flex:1; display:flex; flex-direction:column; justify-content:center; }
  .attendance-simple:not([data-phase=choose]) .attendance-stage { margin:0 auto; width:clamp(130px,29dvh,280px); }
  .attendance-simple[data-phase=choose] #attendance-choose:not([hidden]) { display:grid; flex:1; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:minmax(min-content,1fr) auto auto; column-gap:6px; }
  #attendance-choose > .attendance-parcels { grid-row:1; grid-auto-rows:minmax(min-content,1fr); }
  #attendance-choose > #attendance-selection { grid-column:1/-1; grid-row:2; align-self:center; }
  #attendance-choose > footer { grid-row:3; }
  .attendance-parcel { display:flex; flex-direction:column; justify-content:center; }
  body.worker-app .patrol-main .attendance-success { flex:1; width:100%; align-content:space-between; }
}
@media(min-width:601px) and (max-width:1099px) {
  body.worker-app .patrol-main .attendance-success { display:flex; flex-direction:column; justify-content:space-between; }
}
@media(max-width:1099px) {
  .attendance-parcel:last-child:nth-child(odd) { grid-column:1/-1; }
}
/* The check-in accent is local. Only the inner light and the thin outer ring breathe. */
.business-attendance {
  --attendance-lime:#d9f54a;
  --attendance-lime-text:#243715;
  --attendance-motion-duration:3.4s;
  --attendance-motion-state:running;
}
.business-attendance[data-motion-paused=true] { --attendance-motion-state:paused; }
.business-attendance:not([data-phase=choose]) .attendance-stage .attendance-halo { background:#f0f6cb; }
.business-attendance:not([data-phase=choose]) .attendance-stage .attendance-orbit {
  inset:9.6%; border-color:#a6ba53;
  animation:attendance-ring-breath var(--attendance-motion-duration) ease-in-out infinite;
  animation-play-state:var(--attendance-motion-state);
}
:root body[data-system-ui].worker-app .business-attendance:not([data-phase=choose]) .attendance-stage #attendance-locate {
  isolation:isolate; background:var(--attendance-lime); color:var(--attendance-lime-text);
  border-color:transparent; box-shadow:0 6px 14px #33452022; transform:none;
  transition:background-color 125ms ease,box-shadow 125ms ease;
}
:root body[data-system-ui].worker-app .business-attendance:not([data-phase=choose]) .attendance-stage #attendance-locate::before {
  content:''; position:absolute; inset:0; z-index:-1; border-radius:inherit; pointer-events:none;
  background:radial-gradient(ellipse at 40% 27%,#fcffbd 0%,#f5ffab 32%,#ebfa7800 74%);
  animation:attendance-inner-breath var(--attendance-motion-duration) ease-in-out infinite;
  animation-play-state:var(--attendance-motion-state);
}
@media (hover:hover) {
  :root body[data-system-ui].worker-app .business-attendance:not([data-phase=choose]) .attendance-stage #attendance-locate:hover:not(:disabled) { background:#dff869; }
}
:root body[data-system-ui].worker-app .business-attendance:not([data-phase=choose]) .attendance-stage #attendance-locate:active:not(:disabled) {
  background:#cbe642; box-shadow:0 2px 6px #33452026;
}
:root body[data-system-ui].worker-app .business-attendance[data-phase=locating] .attendance-stage #attendance-locate { opacity:1; cursor:wait; }
@keyframes attendance-ring-breath {
  0%,100% { transform:scale(.96); opacity:.66; }
  50% { transform:scale(1.07); opacity:1; }
}
@keyframes attendance-inner-breath { 0%,100% { opacity:.10; } 50% { opacity:.78; } }
@media(prefers-reduced-motion:reduce) {
  .business-attendance:not([data-phase=choose]) .attendance-stage .attendance-orbit { animation:none; }
  :root body[data-system-ui].worker-app .business-attendance:not([data-phase=choose]) .attendance-stage #attendance-locate::before { animation:none; opacity:.33; }
  :root body[data-system-ui].worker-app .business-attendance:not([data-phase=choose]) .attendance-stage #attendance-locate { transition:none; }
}
body.worker-app .attendance-simple[data-phase=locating] #attendance-locate { font-size:18px; white-space:nowrap; }

/* Retry labels need less type size than the two-character primary label. */
body.worker-app .attendance-simple #attendance-locate[data-state=retry] { font-size:16px; padding-inline:10px; white-space:nowrap; }
body.worker-app .attendance-simple[data-phase=choose] #attendance-locate[data-state=retry] { font-size:14px; min-width:84px; }
/* Touch browsers may retain :hover after tapping; secondary actions stay the same color. */
body.worker-app .attendance-simple[data-phase=choose] .attendance-stage #attendance-locate,
body.worker-app .attendance-simple[data-phase=choose] .attendance-stage #attendance-locate:hover:not(:disabled),
body.worker-app .attendance-simple[data-phase=choose] .attendance-stage #attendance-locate:active:not(:disabled) {
  -webkit-appearance:none; appearance:none; background:var(--sys-selected); color:var(--sys-primary-hover);
  border:1px solid var(--sys-selected-border); box-shadow:none; transform:none;
}
body.worker-app .attendance-simple[data-phase=choose] .attendance-panel-header { margin-bottom:16px; }
@media(max-width:600px) and (max-height:700px) {
  body.worker-app .attendance-simple footer { margin-top:6px; padding-top:6px; }
}

.attendance-simple:not([data-phase=start]) .attendance-todo { display:none; }
.attendance-todo { margin:0 0 10px; }
.attendance-todo__link {
  display:flex; justify-content:space-between; align-items:center; gap:12px;
  min-height:54px; padding:8px 12px; border-radius:var(--sys-radius-control);
  background:var(--sys-selected); color:var(--sys-heading); text-decoration:none;
}
.attendance-todo__link > span:first-child { min-width:0; }
.attendance-todo__link > span:last-child {
  display:inline-flex; align-items:center; gap:5px; flex:none; font-size:13px; font-weight:650;
}
.attendance-todo__link small { display:block; color:var(--sys-muted); overflow-wrap:anywhere; }
.attendance-todo__link svg { width:16px; height:16px; flex:none; }
.attendance-todo__link:hover { text-decoration:underline; }
.attendance-report-next { width:100%; }
.attendance-report-next > .button { display:flex; width:100%; min-height:44px; }
details.attendance-report-next > summary { min-height:44px; padding:11px 8px; color:var(--sys-heading); cursor:pointer; }
details.attendance-report-next > div { display:grid; gap:6px; }
.attendance-success-utilities { display:flex; flex-flow:row wrap; gap:8px; justify-content:center; }
.attendance-success-utilities > .button { flex:1 1 112px; min-height:44px; }
.attendance-success-utilities > details { flex:1 1 100%; }
