.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.detail-grid > div { display: grid; gap: 5px; padding: 18px 20px; border-right: 1px solid var(--line); }
.detail-grid > div:last-child { border-right: 0; }
.detail-grid small { color: var(--muted); font-size: 11px; font-weight: 800; }
.detail-grid strong { overflow-wrap: anywhere; }
.execution { margin-bottom: 22px; }
.execution-body { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 18px 20px; }
.execution-body > p { flex-basis: 100%; margin: 0; color: var(--muted); }
.execution-records { margin-top: 22px; }
.execution-records + .card, .execution-records ~ .card { margin-top: 18px; }
.attachment-entry { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, .35fr) auto; gap: 12px; align-items: end; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.attachment-entry label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.attachment-entry input, .attachment-entry select { width: 100%; min-height: 42px; border: 1px solid #d5dae2; border-radius: 9px; background: #fff; padding: 8px 10px; color: var(--ink); font: inherit; }
.attachment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; padding: 18px 20px; }
.attachment-item { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: center; min-height: 72px; border: 1px solid var(--line); border-radius: 11px; padding: 8px; color: var(--ink); text-decoration: none; }
.attachment-item:hover { border-color: var(--blue); }
.attachment-item img, .document-icon { width: 72px; height: 64px; border-radius: 8px; object-fit: cover; background: #edf3fc; }
.document-icon { display: grid; place-items: center; color: var(--blue); font-size: 13px; font-weight: 900; }
.attachment-item div { display: grid; gap: 3px; min-width: 0; }
.attachment-item strong, .attachment-item small { overflow-wrap: anywhere; }
.attachment-item small { color: var(--muted); font-size: 11px; }
.section-heading { margin-bottom: 16px; }
.section-heading h2 { margin: 3px 0; font-size: 26px; }
.section-heading p { margin: 0; color: var(--muted); }
.record-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.record-card { align-self: start; }
.quick-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.quick-entry label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.quick-entry input, .quick-entry textarea { width: 100%; min-height: 42px; border: 1px solid #d5dae2; border-radius: 9px; padding: 9px 11px; color: var(--ink); font: inherit; }
.quick-entry textarea { min-height: 72px; resize: vertical; }
.quick-entry button { white-space: nowrap; }
.material-entry { grid-template-columns: minmax(0, 1.5fr) minmax(90px, .5fr) minmax(90px, .5fr) auto; }
.record-list { display: grid; }
.record-list article, .toggle-record, .empty-record { margin: 0; padding: 14px 20px; border-top: 1px solid var(--line); }
.record-list > :first-child { border-top: 0; }
.record-list article p { margin: 0 0 4px; }
.record-list article small { color: var(--muted); }
.toggle-record { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px; }
.toggle-record button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--blue); font-weight: 900; cursor: pointer; }
.toggle-record span { overflow-wrap: anywhere; }
.record-done span { color: var(--muted); text-decoration: line-through; }
.record-done button { background: #eaf7ef; color: var(--green); }
.empty-record { color: var(--muted); }
.worker-home { max-width: 980px; margin: 0 auto; }
.worker-day-heading { margin-bottom: 16px; }
.worker-quick-links { display: flex; gap: 10px; margin-bottom: 18px; }
.worker-quick-links a { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 9px 13px; color: var(--blue); font-weight: 800; text-decoration: none; }
.worker-section-title { margin: 26px 0 12px; }
.worker-section-title h2 { margin: 0; font-size: 22px; }
.worker-section-title p { margin: 3px 0 0; color: var(--muted); }
.worker-order-list { display: grid; gap: 14px; }
.worker-order-card { display: grid; gap: 12px; border: 1px solid var(--line); border-radius: 15px; background: #fff; padding: 19px; }
.worker-order-card.next-order { border-color: #b9d2f6; box-shadow: 0 8px 24px #1268e512; }
.worker-order-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; font-weight: 800; }
.worker-order-card h3 { margin: 0; font-size: 20px; }
.worker-order-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 13px; }
.worker-open-order { display: flex; align-items: center; justify-content: space-between; min-height: 46px; border-radius: 10px; background: var(--blue); padding: 10px 14px; color: #fff; font-weight: 900; text-decoration: none; }
.worker-empty { padding: 24px; }
.mobile-execution-steps { display: none; }
.photo-preview { grid-column: 1 / -1; align-items: center; gap: 12px; border: 1px dashed #b8c2d1; border-radius: 10px; background: #f8fafc; padding: 10px; }
.photo-preview:not([hidden]) { display: flex; }
.photo-preview img { width: 76px; height: 64px; border-radius: 8px; object-fit: cover; background: #e8eef7; }
.photo-preview strong { overflow-wrap: anywhere; }

.activity-list-modern,.activity-detail-stack,.field-record-stack { display: grid; gap: 18px; }
.activity-card-modern { overflow: hidden; border: 1px solid #dde5ef; border-radius: 16px; background: #fff; box-shadow: 0 8px 28px rgba(28,48,72,.06); transition: border-color .2s,box-shadow .2s,transform .2s; }
.activity-card-modern:hover { border-color: #c4d5ea; box-shadow: 0 13px 34px rgba(28,48,72,.1); transform: translateY(-1px); }
.activity-card-main { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 22px; padding: 24px 26px 20px; }
.activity-card-main h2 { margin: 10px 0 16px; font-size: 21px; letter-spacing: -.02em; }
.activity-card-main>.pill { align-self: start; justify-self: end; }
.activity-card-kicker { display: flex; flex-wrap: wrap; gap: 8px; }
.activity-card-kicker span { border-radius: 999px; background: #f0f4f9; padding: 5px 10px; color: #536174; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.activity-card-meta { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.activity-card-meta span { display: grid; gap: 3px; }
.activity-card-meta small { color: var(--muted); font-size: 11px; font-weight: 700; }
.activity-card-meta strong { color: #2b3b4f; font-size: 13px; }
.activity-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid #edf0f4; background: #fafbfd; padding: 12px 18px 12px 26px; color: var(--muted); font-size: 13px; }
.activity-card-footer .button { text-decoration: none; }
.activity-detail-section { overflow: hidden; }
.activity-detail-section>.header-actions,.activity-detail-section>.notice,.activity-detail-section>.inline-details { margin: 18px 22px; }
.activity-session-list { padding: 0 20px 20px; }
.activity-timeline { display: grid; padding: 2px 22px 22px; }
.activity-timeline article { position: relative; display: grid; grid-template-columns: 18px minmax(0,1fr); gap: 11px; padding: 9px 0 14px; }
.activity-timeline article:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 24px; bottom: -4px; width: 2px; background: #dfe8f3; }
.timeline-dot { position: relative; z-index: 1; width: 14px; height: 14px; margin-top: 3px; border: 3px solid #bcd4f5; border-radius: 50%; background: var(--blue); }
.activity-timeline strong,.activity-timeline small { display: block; }
.activity-timeline small { margin-top: 3px; color: var(--muted); }
.activity-timeline p { margin: 7px 0 0; }
.field-record-heading .header-actions { flex-wrap: wrap; justify-content: flex-end; }
.field-record-heading .button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; border: 1px solid #c9d6e6; border-radius: 9px; background: #fff; padding: 9px 14px; color: #31506f; font-weight: 800; text-decoration: none; }
.field-record-heading .button:hover { border-color: var(--blue); color: var(--blue); }
.field-record-heading .button.primary { border-color: var(--blue); background: var(--blue); color: #fff; }
.field-record-card { overflow: hidden; }
.checklist-form { padding-top: 18px; }
.material-list-modern { display: grid; }
.material-list-modern article { display: grid; grid-template-columns: minmax(0,1fr) minmax(360px,.8fr); gap: 24px; padding: 20px 22px; border-top: 1px solid var(--line); }
.material-list-modern article:first-child { border-top: 0; }
.material-main h3 { margin: 4px 0 14px; }
.material-main>small { color: var(--muted); }
.material-metrics { display: flex; flex-wrap: wrap; gap: 8px; }
.material-metrics span { display: grid; min-width: 78px; border-radius: 9px; background: #f4f7fa; padding: 7px 10px; color: var(--muted); font-size: 10px; font-weight: 700; }
.material-metrics strong { margin-top: 2px; color: var(--ink); font-size: 14px; }
.material-action { display: grid; grid-template-columns: minmax(90px,.7fr) minmax(150px,1fr) auto; gap: 9px; align-items: end; }
.material-action label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.material-action input,.material-action select { width: 100%; min-height: 41px; border: 1px solid #d5dae2; border-radius: 9px; padding: 8px 10px; font: inherit; }
.field-record-card>.inline-details { margin: 18px 22px; }

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid > div:nth-child(2) { border-right: 0; }
  .detail-grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .record-grid { grid-template-columns: 1fr; }
  .material-list-modern article { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .activity-card-main { grid-template-columns: 1fr; padding: 20px; }
  .activity-card-main>.pill { justify-self: start; }
  .activity-card-meta { display: grid; gap: 10px; }
  .activity-card-footer { align-items: flex-start; padding: 14px 20px; }
  .activity-card-footer>span { display: none; }
  .activity-card-footer .button { width: 100%; text-align: center; }
  .field-record-heading .header-actions { justify-content: stretch; }
  .field-record-heading .header-actions .button { width: 100%; text-align: center; }
  .material-action { grid-template-columns: 1fr; }
  .worker-home { margin: -4px; }
  .worker-day-heading h1 { font-size: 29px; }
  .worker-day-heading .updated { display: none; }
  .worker-quick-links { display: grid; grid-template-columns: 1fr 1fr; }
  .worker-quick-links a { text-align: center; }
  .worker-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .worker-stats .stat { padding: 12px 10px; }
  .worker-stats .stat strong { font-size: 22px; margin: 4px 0; }
  .worker-stats .stat span { font-size: 10px; }
  .worker-order-card { padding: 16px; }
  .worker-order-meta { display: grid; gap: 5px; }
  .worker-open-order { min-height: 52px; font-size: 16px; }
  .mobile-execution-steps { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: -20px -20px 18px; border-bottom: 1px solid var(--line); background: #fff; padding: 8px 10px; }
  .mobile-execution-steps a { display: grid; justify-items: center; gap: 3px; color: var(--muted); font-size: 10px; font-weight: 800; text-decoration: none; }
  .mobile-execution-steps span { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: #eaf2ff; color: var(--blue); font-size: 12px; }
  .worker-execution-page > .heading h1 { font-size: 27px; line-height: 1.2; }
  .worker-execution-page > .heading .pill { margin-top: 12px; }
  .worker-execution-page .execution-body { display: grid; grid-template-columns: 1fr; }
  .worker-execution-page .execution-action { width: 100%; min-height: 54px; font-size: 16px; font-weight: 900; }
  .worker-execution-page .card-title { padding: 16px; }
  .worker-execution-page .record-list article,
  .worker-execution-page .toggle-record,
  .worker-execution-page .empty-record { padding: 14px 16px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .detail-grid > div:nth-child(2) { border-right: 0; }
  .detail-grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .detail-grid > div:last-child { border-bottom: 0; }
  .quick-entry, .material-entry { grid-template-columns: 1fr; }
  .attachment-entry { grid-template-columns: 1fr; }
  .attachment-entry button { justify-self: stretch; }
  .quick-entry button { justify-self: stretch; }
  .photo-preview { grid-column: auto; }
}
