/* Scope operational controls so the familiar monitoring cards remain unchanged. */
body[data-role=leader],body[data-role=office]{font:16px system-ui,"Meiryo UI",sans-serif;color:#0f172a;background:#f3f6f9;margin:0}
body[data-role=leader]{background:#0f172a;color:#e2e8f0}
:is(body[data-role=leader],body[data-role=office]) header{background:#0f172a;color:#fff;padding:16px max(16px,calc((100vw - 1120px)/2))}
:is(body[data-role=leader],body[data-role=office]) h1{font-size:1.5rem;margin:0}
:is(body[data-role=leader],body[data-role=office]) header p{margin:4px 0}
:is(body[data-role=leader],body[data-role=office]) main{max-width:1120px;margin:auto;padding:20px;display:grid;gap:16px}
body[data-role=leader] main{max-width:620px;padding:12px}
:is(body[data-role=leader],body[data-role=office],#transferDialog) section{padding:18px;border:1px solid #cbd5e1;border-radius:12px;background:#fff;color:#0f172a}
body[data-role=leader] section{background:#1e293b;color:#f1f5f9;border-color:#475569}
:is(body[data-role=leader],body[data-role=office],#transferDialog) h2{font-size:1.15rem;margin:0 0 12px}
:is(body[data-role=leader],body[data-role=office],#transferDialog) label{display:grid;gap:6px;margin:12px 0}
:is(body[data-role=leader],body[data-role=office],#transferDialog) :is(input,select,textarea,button){font:inherit;padding:10px;border:1px solid #94a3b8;border-radius:8px;box-sizing:border-box}
:is(body[data-role=leader],body[data-role=office],#transferDialog) button{cursor:pointer;background:#2563eb;color:#fff;border:0;min-height:48px;font-weight:700}
:is(body[data-role=leader],body[data-role=office],#transferDialog) button.secondary{background:#475569}
:is(body[data-role=leader],body[data-role=office],#transferDialog) button:disabled{opacity:.4;cursor:not-allowed}
:is(body[data-role=leader],body[data-role=office],#transferDialog) .actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
:is(body[data-role=leader],body[data-role=office],#transferDialog) .vehicle{display:flex;align-items:center;gap:8px;margin:4px;padding:8px;border:1px solid #94a3b8;border-radius:6px}
:is(body[data-role=leader],body[data-role=office],#transferDialog) #qr{display:block;max-width:100%;max-height:60vh;object-fit:contain;background:#fff;margin:auto}
:is(body[data-role=leader],body[data-role=office],#transferDialog) #video{display:block;width:min(100%,520px);background:#000;margin:10px auto}
:is(body[data-role=leader],body[data-role=office],#transferDialog) [hidden]{display:none!important}
:is(body[data-role=leader],body[data-role=office],#transferDialog) details{margin:12px 0}
:is(body[data-role=leader],body[data-role=office],#transferDialog) summary{cursor:pointer;padding:8px 0}
:is(body[data-role=leader],body[data-role=office],#transferDialog) #status{padding:12px;border-left:4px solid #38bdf8;background:#e0f2fe;color:#0f172a}
:is(body[data-role=leader],body[data-role=office],#transferDialog) .error{color:#b91c1c;background:#fee2e2}
:is(body[data-role=leader],body[data-role=office],#transferDialog) textarea{width:100%}
#transferDialog{width:min(94vw,640px);max-height:90dvh;overflow:auto;background:#0f172a;color:white;padding:16px;box-sizing:border-box}
#transferDialog .operation-head{display:flex;justify-content:space-between;align-items:center}
.metadata{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 16px}.metadata label{min-width:0}.table-scroll{overflow:auto}table{border-collapse:collapse;width:100%;font-size:14px}th,td{border:1px solid #cbd5e1;padding:8px;vertical-align:middle;text-align:left}tr.anchor{background:#fff8d4}
#aggregate,#export{font-size:1.1rem;min-width:230px}#scanStatus{min-height:24px;overflow-wrap:anywhere}#offlineStatus{font-size:13px}.accepted{border-bottom:1px solid #94a3b8;padding:8px}
@media(max-width:650px){body[data-role=office] main{padding:10px}.metadata{grid-template-columns:1fr 1fr}.scanner button{min-width:140px}#transferDialog .actions>button{flex:1}.table-scroll{max-width:100%}}

/* Leader uses production monitoring styles. Office keeps its approved desktop interface. */
body[data-role=leader]{background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Hiragino Sans","Yu Gothic UI","Yu Gothic",sans-serif}
body[data-role=leader] main{max-width:620px;padding:10px;gap:10px}
body[data-role=leader] header{padding:12px 10px;background:var(--bg)}
body[data-role=leader] section{padding:12px;background:var(--panel);border:1px solid var(--line);border-radius:12px}
body[data-role=leader] button{padding:12px 14px;min-height:48px;border-radius:10px;font-weight:900;background:#0c4a6e;color:#fff}
body[data-role=leader] .secondary{background:#475569}
body[data-role=leader] .scanner{display:flex;gap:8px;flex-wrap:wrap}
body[data-role=leader] #aggregate,body[data-role=leader] #newRound{width:100%;margin-top:8px}
body[data-role=leader] #status{background:#172033;color:var(--text);border-color:var(--cyan);border-radius:10px}
body[data-role=leader] #status.error{background:#422006;color:#fde68a}
body[data-role=leader] #handoverImportDialog button{padding:12px;font-weight:900;border:0;border-radius:10px}
body[data-role=leader] #handoverImportDialog .saveedit{background:var(--cyan);color:#07131c}
body[data-role=leader] #handoverImportDialog .cancel{background:#475569;color:#fff}
body[data-role=leader] #qr{width:100%;height:auto;max-height:none}
body[data-role=leader] #handoverImportDialog{font:inherit;color:var(--text);background:var(--panel)}
body[data-role=leader] .handover-camera{width:100%;max-width:none}
