body:has(.plur-record[open]) { overflow: hidden; }
.plur-record [hidden] { display: none !important; }
.plur-record { width: min(940px, calc(100vw - 40px)); max-width: none; max-height: calc(var(--record-viewport, 100dvh) - 40px); padding: 0; border: 1px solid var(--line); border-radius: 22px; color: var(--ink); background: var(--bg); box-shadow: 0 24px 90px #1e15294d; overflow: hidden; }
.plur-record[open] { display: flex; flex-direction: column; animation: record-enter 160ms ease-out; }
.plur-record::backdrop { background: #171b2b80; backdrop-filter: blur(3px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); background: var(--panel, white); flex: none; }
.modal-head h2 { margin: 4px 0 0; font-size: 1.3rem; outline: none; overflow-wrap: anywhere; }
.modal-head .eyebrow { font-size: .7rem; }
.modal-x { font-size: 24px; flex: none; width: 44px; height: 44px; padding: 0; }
.modal-body { padding: 20px 24px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; scrollbar-gutter: stable; }
.modal-body > .card:first-child { margin-top: 0; }
.modal-body > form.card { box-shadow: none; }
.modal-body .stop-list { grid-template-columns: 1fr; }
.modal-body .modal-launch { display: flex; width: 100%; justify-content: space-between; text-align: left; padding: 14px 16px; margin-block: 8px; border-color: #edcbd0; background: #fff8f9; color: #9c1630; transition: background 140ms, border-color 140ms; }
.modal-launch::after { content: '↗'; margin-left: 12px; }
.modal-launch:hover { background: #ffedf0; border-color: #d98796; }
.modal-foot { flex: none; padding: 12px 24px 18px; border-top: 1px solid var(--line); background: var(--panel, white); box-shadow: 0 -4px 18px #17213508; }
.modal-save-status { font-size: .8rem; color: var(--muted); margin: 0 0 10px; }
.modal-save-status[data-dirty=true] { color: #9a4d00; font-weight: 650; }
.modal-footer-buttons, .modal-save-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.modal-save-actions:empty { display: none; }
.modal-footer-buttons .btn { min-height: 44px; }
.modal-notice { flex: none; padding: 10px 24px; font-size: .85rem; background: #fff3d6; white-space: pre-line; max-height: 20vh; overflow: auto; }
.modal-notice.error { color: #a2162d; background: #ffedf0; }
.modal-notice.success { color: #195f3c; background: #e9f6ee; }
.modal-notice[hidden] { display: none; }
.record-editor .modal-body > .sectionhead > [data-action=route-cancel], .record-overview .modal-body [data-action=jobs], .record-overview .modal-body [data-action=box-list] { display: none; }
@keyframes record-enter { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  .plur-record { width: calc(100vw - 16px); max-height: calc(var(--record-viewport, 100dvh) - 16px); border-radius: 16px; }
  .modal-head { padding: 12px; gap: 8px; }
  .modal-head h2 { font-size: 1.05rem; }
  .modal-body { padding: 12px; scrollbar-gutter: auto; }
  .modal-foot { padding: 10px 12px max(10px, env(safe-area-inset-bottom)); }
  .modal-footer-buttons > .btn { flex: 1; }
  .modal-save-actions { flex: 2; min-width: 0; }
  .modal-save-actions .btn { flex: 1 1 100%; white-space: normal; }
  .modal-body .grid2 { grid-template-columns: 1fr; }
  .modal-notice { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) { .plur-record[open] { animation: none; } .modal-launch { transition: none; } }
