#operationStatus{background:var(--ui-panel,var(--card));color:var(--ui-ink,var(--ink));border-bottom:1px solid var(--ui-line,var(--line));position:sticky;top:0;z-index:40}
body[data-theme] .modal-backdrop{padding-top:calc(var(--operation-status-bottom,0px) + 16px)}
body[data-theme] .modal{max-height:calc(100dvh - var(--operation-status-bottom,0px) - 32px)}
body[data-theme] .drawer{top:var(--operation-status-bottom,0px)}
#syncStatus{font-size:14px;line-height:1.4;padding:8px 16px;font-variant-numeric:tabular-nums}
#syncStatus[data-status]:not([data-status=connected]){font-weight:700}
#commandStatus{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:10px 16px;border-top:1px solid var(--ui-line,var(--line));max-height:35dvh;overflow:auto}
#commandStatus[hidden]{display:none}
#commandStatus small{overflow-wrap:anywhere}
#commandStatus .btn{min-height:48px}
#operationStatus{max-height:55dvh;overflow-y:auto}
#draftStatus{padding:10px 16px;border-top:1px solid var(--ui-line,var(--line));max-height:28dvh;overflow:auto;font-size:14px;line-height:1.4}
#draftStatus[hidden]{display:none}#draftStatus p{margin:6px 0 10px}.draft-row{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:8px 0;border-top:1px solid var(--ui-line,var(--line))}.draft-row span{min-width:0}.draft-row small{display:block;overflow-wrap:anywhere}.draft-row>div{display:flex;gap:8px;flex-wrap:wrap}.draft-row .btn{min-height:48px}
#draftStatus:has(.active-draft):not(:has(details)){padding:6px 16px;max-height:none;border-top:0}.active-draft{font-size:13px;color:var(--ui-muted,var(--muted))}.draft-tray summary{min-height:48px;display:flex;align-items:center;gap:8px;cursor:pointer;font-weight:600}.draft-tray summary::before{content:'▸'}.draft-tray[open] summary::before{content:'▾'}.draft-tray-content{padding-top:8px}.draft-tray-content p{font-size:14px}
@media(max-width:700px){.draft-row{align-items:flex-start;flex-direction:column}.draft-row>div{width:100%}.draft-row .btn{flex:1}}
.conflict-review{flex-basis:100%;min-width:0}.conflict-review table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:14px}.conflict-review th,.conflict-review td{text-align:left;vertical-align:top;padding:8px;border-bottom:1px solid var(--ui-line,var(--line));overflow-wrap:anywhere;white-space:pre-wrap}.conflict-review p{font-size:14px;line-height:1.4;margin:8px 0}
body[data-connection]:not([data-connection=connected]) .live-indicator>span{background:#b78945;box-shadow:none}
body[data-theme] #commandStatus :is(span,small){font-size:14px}
@media(max-width:700px){#commandStatus{gap:8px}#commandStatus strong,#commandStatus small{flex-basis:100%}}

/* Each active dialog owns its connection/recovery surface in the same
   accessible tree. Lower dialogs and the workspace become inert. */
.visit-layer{position:fixed;inset:0;z-index:20;pointer-events:none}.visit-layer>:is(#operationStatus,.drawer,.drawer-backdrop){pointer-events:auto}.visit-layer>#operationStatus{position:relative;z-index:22;top:0;width:100%}
body[data-theme] .modal-backdrop[role]{display:flex;flex-direction:column;justify-content:flex-start;align-items:center;padding:0;gap:0}
.modal-backdrop[role]>#operationStatus{position:relative;top:0;flex:none;width:100%;max-height:45dvh;overflow:auto}
body[data-theme] .modal-backdrop[role]>.modal{flex:0 1 auto;min-height:0;margin:16px;max-height:calc(100dvh - var(--modal-status-height,0px) - 32px);width:min(560px,calc(100% - 32px))}
body[data-theme] .modal-backdrop[role]>.modal.wide{width:min(720px,calc(100% - 32px))}
#confirmationRoot .modal-backdrop{z-index:60}.confirmation-detail{white-space:pre-wrap;line-height:1.55;font-size:16px}
body[data-theme] :is(.modal-backdrop,.visit-layer):focus{outline:none}
body[data-theme] :is(button,a,input,select,textarea,[tabindex]):focus-visible{outline:3px solid var(--ui-accent,#237b79);outline-offset:3px}
@media(max-width:700px){body[data-theme] .modal-backdrop[role]>.modal{width:calc(100% - 20px);margin:10px;max-height:calc(100dvh - var(--modal-status-height,0px) - 20px)}}
@media(max-width:700px){body[data-theme].mobile-nav-open .sidebar{z-index:50}}
