/* v1.9: a single theme-aware finish for the inherited component styles. */
:root{--mf-accent:var(--accent);--mf-bg:var(--bg);--mf-surface:var(--surface);--mf-text:var(--text);--mf-muted:var(--muted);--mf-line:color-mix(in srgb,var(--text) 13%,var(--surface));--border:var(--mf-line);--mf-shadow:0 10px 32px color-mix(in srgb,var(--sidebar) 8%,transparent)}
html body,body .layout,body .main,body .control-centre{background:var(--bg)!important;color:var(--text)!important;font-family:var(--font)!important}
body .sidebar{background:linear-gradient(160deg,var(--sidebar),color-mix(in srgb,var(--sidebar) 90%,var(--accent)))!important}
body .nav-item.active,body .btn.primary,body .fab,body input[type=checkbox]:checked{background:var(--accent)!important;border-color:var(--accent)!important;color:var(--accent-ink,#fff)!important;box-shadow:0 5px 18px color-mix(in srgb,var(--accent) 23%,transparent)!important}
body .card,body .workspace-card,body .command-tile,body .modal,body .control-panel,body .control-launch,body .control-tab.active,body td{background:var(--surface)!important;color:var(--text)!important;border-color:var(--mf-line)!important;border-radius:var(--radius)!important}
body h1,body h2,body h3,body .item-title,body .command-tile strong,body .control-title h1,body .field label,body .field>label{color:var(--text)!important}
body .subtle,body .item-meta,body .modal-head .subtle,body .command-tile small,body .command-tile>span:not(.tile-icon){color:var(--muted)!important}
body .command-hero,body .ai-command{background:linear-gradient(120deg,var(--sidebar),color-mix(in srgb,var(--sidebar) 74%,var(--accent)))!important;box-shadow:0 16px 40px color-mix(in srgb,var(--sidebar) 16%,transparent)!important}
body .command-hero h1,body .ai-command h3{color:#fff!important}
body .field input,body .field select,body .field textarea,body form input,body form select,body form textarea,body .rich-editor{background:color-mix(in srgb,var(--surface) 94%,var(--bg))!important;color:var(--text)!important;border-color:var(--mf-line)!important}
body .field input:focus,body .field select:focus,body .field textarea:focus,body form input:focus,body form select:focus,body form textarea:focus,body .rich-editor:focus{border-color:var(--accent)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 16%,transparent)!important;outline:none!important}
body .rich-toolbar,body .focus-item,body .capture-action,body .control-tabs,body th,body .template-help{background:color-mix(in srgb,var(--surface) 65%,var(--bg))!important;color:var(--text)!important;border-color:var(--mf-line)!important}
body tr:hover td,body .focus-item:hover,body .capture-action:hover,body .control-launch.active{background:color-mix(in srgb,var(--surface) 94%,var(--accent))!important}
body .topbar,body .control-top{background:color-mix(in srgb,var(--bg) 88%,transparent)!important;backdrop-filter:blur(16px);border-color:var(--mf-line)!important}
body .btn:not(.primary):not(.danger){background:var(--surface)!important;color:var(--text)!important;border-color:var(--mf-line)!important}
body .btn,body .command-tile,body .nav-item,body .control-launch{transition:transform .18s ease,box-shadow .18s ease,background .18s ease,border-color .18s ease!important}
body .command-tile:hover,body .control-launch:hover{transform:translateY(-2px);border-color:color-mix(in srgb,var(--accent) 40%,var(--surface))!important;box-shadow:0 14px 30px color-mix(in srgb,var(--accent) 10%,transparent)!important}
button:focus-visible,a:focus-visible{outline:3px solid var(--accent)!important;outline-offset:3px}
body .modal{animation:release-enter .2s ease-out}
@keyframes release-enter{from{opacity:0;transform:translateY(8px) scale(.99)}to{opacity:1;transform:none}}
.history-filter{display:flex;gap:12px;align-items:center;margin:0 0 20px}.history-filter select{min-width:220px;padding:10px;background:var(--surface);border:1px solid var(--mf-line);border-radius:10px}
.report-table{overflow:auto;margin-top:20px}.report-table td,.report-table th{text-align:left;padding:14px;vertical-align:top}.report-open{background:none;border:0;color:var(--accent);font-weight:650;text-align:left;cursor:pointer;padding:0}.report-print-title{margin:24px 0 16px}.report-print-title p{color:var(--muted);font-size:14px;line-height:1.6}
#link-results{max-height:240px;overflow:auto;margin-top:10px}#record-links .item{flex-wrap:wrap}#record-links .link-remove{margin-left:auto}
html[data-density=compact] .item{padding:9px!important}html[data-density=compact] .card{padding:16px!important}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@media print{
 body.printing-report{background:white!important;color:black!important}
 body.printing-report .sidebar,body.printing-report .topbar,body.printing-report .page-head,body.printing-report #report-form,body.printing-report .fab,body.printing-report #modal-root,body.printing-report #toast-root,body.printing-report #dock-root{display:none!important}
 body.printing-report .layout,body.printing-report .main{display:block!important;margin:0!important;padding:0!important;width:100%!important}
 body.printing-report #report-output *{box-shadow:none!important;text-shadow:none!important;color:black!important;background:white!important}
 body.printing-report .report-table{overflow:visible!important;padding:0!important;border:0!important}
 body.printing-report table{table-layout:fixed!important;font-size:10pt!important}body.printing-report td{overflow-wrap:anywhere;border-bottom:1px solid #ddd!important;border-radius:0!important}
 body.printing-report tr{break-inside:avoid}body.printing-report thead{display:table-header-group}body.printing-report .report-open{font:inherit}
 @page{size:landscape;margin:12mm}
}
