/* Field UI uses the current admitted records and existing action controls. */
.field-list-toolbar { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin:0 0 16px; position:sticky; top:0; z-index:3; background:var(--surface); }
.field-list-toolbar input { flex:1; min-width:0; font-size:16px; }
[data-ticket-mode=list] .ticket-browser { display:grid; grid-template-columns:210px minmax(0,1fr); gap:20px; }
[data-ticket-mode=list] [data-ticket=filters] { display:flex; flex-direction:column; gap:6px; border-right:1px solid var(--border); padding-right:14px; }
[data-ticket=filters] button { text-align:left; border:0; }
[data-ticket=filters] button[aria-current=true] { background:#2c6a38; color:white; }
[data-ticket-mode=list] [data-ticket=queue] { max-height:none; overflow:visible; }
[data-ticket-mode=list] .ticket-heading > div > p { display:none; }
.ticket-table { width:100%; border-collapse:collapse; }
.ticket-table th button { border:0; padding:0; font-weight:650; text-align:left; background:transparent; }
.ticket-table .field-sort-header { color:var(--muted); }
.ticket-table th.field-sort-active { background:color-mix(in srgb,var(--text) 7%,var(--surface)); }
.ticket-table th.field-sort-active .field-sort-header { color:var(--text); font-weight:750; }
.field-sort-hint { opacity:0; }
.field-sort-header:hover .field-sort-hint { opacity:.4; }
.field-sort-reset { border:0; padding:0; background:transparent; text-decoration:underline; }
.field-list-back { min-width:44px; min-height:44px; padding:6px 10px; background:transparent; border:0; font-size:18px; }
.field-new-tickets { border-radius:20px; margin-left:auto; }
.field-row-changed { animation:field-row-refresh 3s ease-out; }
@keyframes field-row-refresh { from { box-shadow:inset 0 0 0 2px #83aa70; } to { box-shadow:inset 0 0 0 2px transparent; } }
.ticket-table tbody tr { cursor:pointer; }
.ticket-table td[data-column] { min-width:0; max-width:none; }
.ticket-table .ticket-list-secondary { font-size:13px; }
.ticket-table td[data-column=ticket] { font-weight:750; font-size:17px; }
.ticket-table td[data-column=response] { min-width:130px; }
.ticket-table td[data-column=response_due] { min-width:145px; }
.field-notice { display:block; width:fit-content; font-size:11px; border-radius:4px; padding:3px 7px; margin-top:7px; }
.field-tone-urgent { color:#a72727; background:#fcecec; }
.response-state.field-response-compact,.ticket-response-summary .field-response-compact { display:none; }
.response-state { border-radius:18px; padding:5px 10px; display:inline-block; font-size:13px; }
.response-state-accepted { background:#e5f3e3; color:#315b20; }
.response-state-interim { background:#fff0d9; color:#79500f; }
.response-state-rejected,.response-state-failed { background:#fce8e8; color:#a22222; }
.response-state-none { background:#eef1ef; color:#56635c; }
.field-due-state { display:block; font-size:13px; line-height:1.5; }
.ticket-table [data-column=response_due] .response-state { background:none; padding:0; }
.ticket-table [data-column=response_due]:has(.response-state-urgent) small,[data-tone=urgent] .field-due-state { color:#b02323; }
.ticket-table [data-column=response_due]:has(.response-state-soon) small,[data-tone=soon] .field-due-state { color:#8b5900; }
[data-tone=accepted] .field-due-state { color:#315b20; }
.ticket-header-identity .ticket-response-summary { max-width:100%; }
.ticket-header-identity .field-notice { margin:0; }
.ticket-table tr:has(.field-notice) .ticket-emergency-badge { display:none !important; }
.ticket-table tbody tr.ticket-emergency { background:var(--surface); color:var(--text); border-left:4px solid #d54343; }
.ticket-coverage { color:var(--muted); font-size:12px; }
.field-sheet { max-height:90dvh; width:min(720px,calc(100% - 32px)); box-sizing:border-box; border:1px solid var(--border); border-radius:16px; padding:24px; color:var(--text); background:var(--surface); overflow:auto; }
.field-sheet::backdrop { background:#0007; }
.field-sheet .ticket-form { margin:0; border:0; padding:0; }
.field-sheet .evidence-capture-bar { position:sticky; bottom:0; }
.field-sheet label { margin-block:8px; }
.field-time-presets { display:flex; gap:6px; flex-wrap:wrap; }
.field-sheet .positive-codes { display:flex; flex-wrap:wrap; gap:6px; }
.field-reopen { border:2px solid #2c6a38 !important; background:transparent !important; color:#2c6a38 !important; }
.evidence-panel > p[role=status]:not(.evidence-media-count) { font-size:12px; }
.evidence-panel > p[role=status]:empty { display:none; }
.evidence-list { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.evidence-list .evidence-tile,.evidence-list .evidence-upload-tile { padding:0 !important; border:0 !important; min-width:0; position:relative; aspect-ratio:1; overflow:hidden; border-radius:9px; background:#e7ede6; }
.evidence-list .evidence-tile-open { padding:0; width:100%; height:100%; border:0; position:relative; display:block; cursor:pointer; }
.evidence-list .evidence-saved-preview { width:100%; height:100%; }
.evidence-list .evidence-saved-preview img { width:100%; height:100%; object-fit:cover; }
.evidence-tile-time,.evidence-tile-gps { position:absolute; bottom:5px; left:5px; background:#18221dc9; color:white; padding:3px 5px; font-size:11px; border-radius:3px; }
.evidence-tile-gps { bottom:auto; top:5px; }
.evidence-tile-play { position:absolute; inset:35% 35%; color:white; font-size:30px; }
.evidence-upload-tile { display:grid; place-items:center; font-size:13px; }
.field-media-viewer { position:fixed; inset:0; margin:0; width:100vw; max-width:none; height:100dvh; max-height:none; border:0; padding:0; background:black; color:white; box-sizing:border-box; overflow:hidden; }
.field-media-viewer[open] { display:grid; grid-template-rows:auto minmax(0,1fr) auto auto; }
.field-media-viewer::backdrop { background:black; }
.field-viewer-top { display:flex; justify-content:space-between; align-items:center; padding:12px 20px; }
.field-viewer-top button,.field-viewer-top summary,.field-viewer-nav button { color:white; background:transparent; border:0; min-width:44px; min-height:44px; }
.field-viewer-top details { position:relative; }
.field-viewer-top details[open] { background:#202820; border:1px solid #748074; }
.field-viewer-top details button { display:block; }
.field-viewer-stage { overflow:hidden; display:flex; align-items:center; justify-content:center; touch-action:none; }
.field-viewer-stage img,.field-viewer-stage video { width:100%; height:100%; max-width:100%; max-height:100%; object-fit:contain; }
.field-viewer-caption { padding:12px 24px; font-size:14px; }
.field-viewer-caption p { margin:4px 0; }
.field-viewer-nav { display:flex; justify-content:center; gap:36px; }
.field-response-history > summary { font-weight:650; }
.field-response-history article h5 { margin:6px 0; font-size:14px; font-weight:500; }
.field-segmented { display:flex; gap:0; margin-block:10px; }
.field-segmented button { border-radius:0; min-width:100px; }
.field-segmented button[aria-checked=true] { background:#2c6a38; color:white; }
.field-visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
#locator-workspace:has([data-ticket-mode=list][data-field-map=true]) { display:flex; flex-direction:column; }
@media(max-width:1280px) {
 [data-ticket-mode=list] .ticket-browser { display:flex; flex-direction:column; gap:8px; }
 [data-ticket-mode=list] [data-ticket=filters] { flex-direction:row; flex-wrap:wrap; border:0; padding:0; }
 [data-ticket=filters] > strong,[data-ticket=filters] > small { flex-basis:100%; }
 .ticket-table,.ticket-table tbody { display:block; width:100%; white-space:normal; }
 .ticket-table thead { display:none; }
 .ticket-table tbody tr { position:relative; display:grid; grid-template-columns:minmax(0,1fr) minmax(130px,auto); gap:7px 12px; padding:18px; margin:0 0 12px; border:1px solid var(--border); border-radius:12px; background:var(--surface); }
 .ticket-table td[data-column] { display:block; border:0; padding:0; overflow-wrap:anywhere; }
 .ticket-table td::before { display:none; }
 .ticket-table td[data-column=ticket] { grid-column:1; grid-row:1; order:0; }
 .ticket-table td[data-column=response_due] { grid-column:2; grid-row:1; text-align:right; min-width:0; }
 .ticket-table td[data-column=address] { grid-column:1/-1; grid-row:2; font-size:18px; }
 .ticket-table td[data-column=work] { grid-column:1; grid-row:3; }
 .ticket-table td[data-column=excavator] { grid-column:1; grid-row:4; color:var(--muted); }
 .ticket-table td[data-column=response] { grid-column:2; grid-row:3/5; min-width:0; justify-self:end; align-self:center; }
 .ticket-table td[data-column=phone] { grid-column:1/-1; color:var(--muted); font-size:12px; }
 .ticket-table .ticket-list-value { font-size:16px; }
 .ticket-table td[data-column=ticket] .ticket-list-value { font-size:20px; }
 .field-sheet { margin:auto 0 0; width:100%; max-width:none; border-radius:18px 18px 0 0; animation:field-sheet-in .15s ease-out; }
}
@media(max-width:600px) {
 .field-back-label { display:none; }
 .field-response-full { display:none; }
 .response-state.field-response-compact,.ticket-response-summary .field-response-compact { display:inline-block; }
 .evidence-list { grid-template-columns:repeat(3,minmax(0,1fr)); }
 .field-list-toolbar { flex-wrap:wrap; }
 .field-list-toolbar input { flex-basis:70%; }
 .field-list-toolbar select { max-width:100%; }
 .ticket-table tbody tr { padding:14px; grid-template-columns:minmax(0,1fr) minmax(105px,auto); }
}
@keyframes field-sheet-in { from { transform:translateY(20px); opacity:.7; } to { transform:translateY(0); opacity:1; } }
@media(prefers-reduced-motion:reduce) { .field-sheet { animation:none; } .field-row-changed { animation-duration:.01ms; } }

.field-card-company { display:none; }
[data-ticket-mode=list] .ticket-heading { display:none; }
body.dark [data-tone=urgent] .field-due-state { color:#ffb4aa; }
body.dark [data-tone=soon] .field-due-state { color:#ffd590; }
body.dark [data-tone=accepted] .field-due-state { color:#aada9b; }
@media(max-width:1280px) {
 [data-ticket-mode=list] .ticket-content { display:contents; }
 [data-ticket-mode=list] .field-list-toolbar { order:-2; padding:12px 12px 0; }
 [data-ticket-mode=list] [data-ticket=filters] { order:-1; padding:0 12px 12px; }
 [data-ticket-mode=list] [data-ticket=filters] > strong,[data-ticket-mode=list] [data-ticket=filters] > small { display:none; }
 [data-ticket-mode=list] [data-ticket=filters] hr { display:none; }
 [data-ticket-mode=list] [data-ticket=queue],[data-ticket-mode=list] [data-ticket=coverage] { margin-inline:12px; }
 .field-card-company { display:inline; color:var(--muted); }
 .ticket-table td[data-column=excavator],.ticket-table td[data-column=phone][data-available=false] { display:none; }
 .ticket-table td[data-column=response] { grid-row:3; }
}

.ticket-media-card .evidence-panel .evidence-list { grid-template-columns:repeat(4,minmax(0,1fr)); }
.ticket-media-card:not(.ticket-media-expanded) .evidence-list article:nth-child(4) { display:block; }
.ticket-media-card .evidence-media-count { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
@media(max-width:600px) {
 .ticket-media-card .evidence-panel .evidence-list { grid-template-columns:repeat(3,minmax(0,1fr)); }
 .ticket-media-card:not(.ticket-media-expanded) .evidence-list article:nth-child(4) { display:none; }
}
.ticket-workspace summary { min-height:44px; box-sizing:border-box; }
.ticket-header-actions > details > summary { min-width:44px; min-height:44px; list-style:none; display:flex; align-items:center; justify-content:center; }
.field-viewer-top summary { list-style:none; }
.field-viewer-top summary::-webkit-details-marker,.ticket-header-actions > details > summary::-webkit-details-marker { display:none; }

/* The column control is not a sortable or hideable data column. */
.ticket-table th.ticket-column-control { width:44px; min-width:44px; padding:0; right:0; z-index:2; overflow:visible; }
.ticket-column-chooser { position:relative; margin-left:auto; flex:none; }
.ticket-workspace .ticket-column-button { display:grid; place-items:center; width:max-content; min-width:44px; height:auto; min-height:44px; padding:0; font-size:26px; line-height:1; text-align:center; }
.ticket-columns-menu { position:absolute; top:100%; right:0; z-index:6; width:min(280px,calc(100vw - 32px)); max-height:min(65dvh,520px); overflow:auto; padding:8px; box-sizing:border-box; border:1px solid var(--border); border-radius:8px; background:var(--surface); color:var(--text); box-shadow:0 5px 18px #0003; }
.ticket-columns-menu[hidden],.ticket-column-chooser[hidden] { display:none; }
.ticket-columns-menu label { display:flex; align-items:center; gap:10px; min-height:44px; margin:0; font-size:14px; white-space:normal; }
.ticket-workspace .ticket-columns-menu input { flex:none; width:20px; height:20px; min-height:20px; }
.ticket-columns-menu button { min-height:44px; width:100%; margin-top:4px; }
@media(max-width:1280px) {
 .ticket-column-spacer { display:none !important; }
}

.ticket-hide-completed { display:flex; align-items:center; gap:6px; min-height:44px; font-size:14px; flex-wrap:wrap; }
.field-list-toolbar .ticket-hide-completed input { flex:none; width:20px; height:20px; min-height:20px; }
.ticket-read-only-badge { display:inline-block; margin:4px; padding:3px 7px; border-radius:5px; background:#e7e8e9; color:#46494b; font-size:13px; font-weight:600; }
body.dark .ticket-read-only-badge { background:#3c4145; color:#e5e7e9; }
